Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
Aggregator collects usage grouped by model name.
func FromContext ¶
func FromContext(ctx context.Context) *Aggregator
func WithAggregator ¶
func WithAggregator(ctx context.Context) (context.Context, *Aggregator)
WithAggregator injects Aggregator into context.
func (*Aggregator) Add ¶
func (a *Aggregator) Add(model string, prompt, completion, embed, cached int)
Add records token counts for a specific model. Add records token counts for a specific model. Cached tokens are optional – pass 0 when not applicable.
func (*Aggregator) Keys ¶
func (a *Aggregator) Keys() []string
Keys returns sorted list of model names.
Click to show internal directories.
Click to hide internal directories.