Define observed cost values and aggregation
This commit is contained in:
4
types.go
4
types.go
@@ -298,6 +298,8 @@ type RunResult struct {
|
||||
InputHashes map[string]string `json:"input_hashes,omitempty"`
|
||||
// Usage is the token accounting reported by the LLM client.
|
||||
Usage TokenUsage `json:"usage"`
|
||||
// CostUSD is the observed charge subtotal across dispatched attempts.
|
||||
CostUSD ObservedCost `json:"cost_usd"`
|
||||
// StartTime is the UTC time immediately before ordinary Run preparation or
|
||||
// after RunPrepared claims its handle.
|
||||
StartTime time.Time `json:"start_time,omitempty"`
|
||||
@@ -692,6 +694,8 @@ type GenerateResponse struct {
|
||||
// UsagePresence states which usage fields were reported, including zeros.
|
||||
// Nil uses the legacy observation fallback described by LLMClient.
|
||||
UsagePresence *TokenUsagePresence `json:"usage_presence,omitempty"`
|
||||
// CostUSD is an optional reported charge; a pointer to zero reports zero.
|
||||
CostUSD *float64 `json:"cost_usd,omitempty"`
|
||||
}
|
||||
|
||||
// TokenUsagePresence identifies provider-reported token counts for observation.
|
||||
|
||||
Reference in New Issue
Block a user