Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer periodically reads completed sessions from bee_executions and asks the matching engine adapter to produce per-model token usage, then upserts into bee_token_stats. Engines whose bee_executions.engine field is empty (legacy data) are dispatched through a fixed fallback chain.
func NewSyncer ¶
func NewSyncer(db *sql.DB, tokenStore *store.TokenStatsStore, adapters map[string]ai.EngineAdapter, fallbackOrder []string) *Syncer
NewSyncer builds a Syncer that dispatches to the supplied adapters. fallbackOrder controls the legacy fallback chain — pass ai.AllEngines() to preserve the historical chain order.