Documentation
¶
Index ¶
- func RenderItemText(item Item) string
- func WithScope(ctx context.Context, scope Scope) context.Context
- type Item
- type Scope
- type Store
- func (s *Store) CommandFunc(conversationKey string) func() (string, error)
- func (s *Store) Get(conversationKey string) (Item, bool, error)
- func (s *Store) ObserveUsage(ctx context.Context, sample UsageSample)
- func (s *Store) RenderCommandText(conversationKey string) (string, error)
- func (s *Store) UpdateFromSample(scope Scope, sample UsageSample) error
- type UsageSample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderItemText ¶
Types ¶
type Item ¶
type Item struct {
ConversationKey string `json:"conversation_key"`
TopicID string `json:"topic_id,omitempty"`
Runtime string `json:"runtime,omitempty"`
Model string `json:"model,omitempty"`
NormalizedModel string `json:"normalized_model,omitempty"`
ContextWindowTokens int64 `json:"context_window_tokens,omitempty"`
ContextWindowSource string `json:"context_window_source,omitempty"`
UsedInputTokens int64 `json:"used_input_tokens,omitempty"`
CachedInputTokens int64 `json:"cached_input_tokens,omitempty"`
CacheCreationInputTokens int64 `json:"cache_creation_input_tokens,omitempty"`
UsageRatio float64 `json:"usage_ratio,omitempty"`
LastRunID string `json:"last_run_id,omitempty"`
LastOriginEventID string `json:"last_origin_event_id,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CommandFunc ¶ added in v0.3.3
func (*Store) ObserveUsage ¶ added in v0.3.3
func (s *Store) ObserveUsage(ctx context.Context, sample UsageSample)
func (*Store) RenderCommandText ¶ added in v0.3.3
func (*Store) UpdateFromSample ¶
func (s *Store) UpdateFromSample(scope Scope, sample UsageSample) error
Click to show internal directories.
Click to hide internal directories.