Decode provider reasoning and cache usage details

This commit is contained in:
2026-11-22 18:20:11 +00:00
parent c3257b63f0
commit db1cad6d2d
11 changed files with 108 additions and 9 deletions

View File

@@ -568,6 +568,8 @@ type TokenUsage struct {
PromptTokens int `json:"prompt_tokens"`
// CompletionTokens is the reported generated-token count.
CompletionTokens int `json:"completion_tokens"`
// ReasoningTokens is the reported reasoning subset of completion tokens.
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.
@@ -697,6 +699,7 @@ type GenerateResponse struct {
type TokenUsagePresence struct {
PromptTokens bool `json:"prompt_tokens"`
CompletionTokens bool `json:"completion_tokens"`
ReasoningTokens bool `json:"reasoning_tokens"`
TotalTokens bool `json:"total_tokens"`
CachedTokens bool `json:"cached_tokens"`
CacheWriteTokens bool `json:"cache_write_tokens"`