Documentation
¶
Index ¶
- func AddUsageStats(dst *UsageStats, src UsageStats)
- func AutomationScope(req Request) (automation.Scope, error)
- func NewestUsageUpdate(items []BotUsage) time.Time
- func NormalizeBotLabel(botID, botName string) (string, string)
- func VisibilityKey(req Request) string
- type AutomationTaskStore
- type BotUsage
- type Request
- type Result
- type Service
- type UsageProvider
- type UsageStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUsageStats ¶
func AddUsageStats(dst *UsageStats, src UsageStats)
func AutomationScope ¶
func AutomationScope(req Request) (automation.Scope, error)
func NewestUsageUpdate ¶
func NormalizeBotLabel ¶
func VisibilityKey ¶
Types ¶
type AutomationTaskStore ¶
type AutomationTaskStore interface {
ListTasks(scope automation.Scope, statusFilter string, limit int) ([]automation.Task, error)
}
type BotUsage ¶
type BotUsage struct {
BotID string
BotName string
Usage UsageStats
}
type Result ¶
type Result struct {
ScopeLabel string
TotalUsage UsageStats
BotUsages []BotUsage
Tasks []automation.Task
TaskError error
UsageError error
}
func (Result) IsPartialSuccess ¶ added in v0.6.0
type Service ¶
type Service struct {
Automation AutomationTaskStore
Usage UsageProvider
}
type UsageProvider ¶
type UsageProvider interface {
UsageForScope(scopeKey string) (UsageStats, []BotUsage, error)
}
type UsageStats ¶
type UsageStats struct {
InputTokens int64 `json:"input_tokens,omitempty"`
CachedInputTokens int64 `json:"cached_input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
Turns int64 `json:"turns,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
func (UsageStats) HasUsage ¶
func (s UsageStats) HasUsage() bool
func (UsageStats) TotalTokens ¶
func (s UsageStats) TotalTokens() int64
Click to show internal directories.
Click to hide internal directories.