Document invocation observation and cost reporting
This commit is contained in:
6
types.go
6
types.go
@@ -574,7 +574,7 @@ type TokenUsage struct {
|
||||
ReasoningTokens int `json:"reasoning_tokens"`
|
||||
// TotalTokens is the reported total-token count.
|
||||
TotalTokens int `json:"total_tokens"`
|
||||
// CachedTokens is the reported cached-input-token count.
|
||||
// CachedTokens is the reported input-token cache-read count.
|
||||
CachedTokens int `json:"cached_tokens"`
|
||||
// CacheWriteTokens is the reported cache-write-token count.
|
||||
CacheWriteTokens int `json:"cache_write_tokens"`
|
||||
@@ -660,7 +660,9 @@ type StructuredOutputJSONSpec struct {
|
||||
// treated as known and zero counts as unknown for observation only; the legacy
|
||||
// interface cannot distinguish omitted zero from measured zero. An explicit
|
||||
// UsagePresence can report known zero counts. Result usage sums the supplied
|
||||
// Usage values independently of presence.
|
||||
// Usage values independently of presence. A non-nil CostUSD is copied and
|
||||
// retained for attempt accounting even when returned alongside an error;
|
||||
// non-finite values are treated as unknown before configured-zero fallback.
|
||||
type LLMClient interface {
|
||||
Generate(context.Context, GenerateRequest) (*GenerateResponse, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user