| 1 | package event |
| 2 | |
| 3 | // ResponseSummary is content-free, local evidence for a committed model |
| 4 | // response. It is stored in an optional diagnostic/response event, never in |
| 5 | // model messages. Usage covers the sampling round, including protocol repairs. |
| 6 | // Missing summaries in older sessions mean unknown, not zero output. |
| 7 | type ResponseSummary struct { |
| 8 | Provider string `json:"provider"` |
| 9 | ModelRef string `json:"modelRef,omitempty"` |
| 10 | FinishReason string `json:"finishReason"` |
| 11 | TextBytes int `json:"textBytes"` |
| 12 | ReasoningBytes int `json:"reasoningBytes"` |
| 13 | ToolCalls int `json:"toolCalls"` |
| 14 | ServerSearches int `json:"serverSearches"` |
| 15 | StreamComplete bool `json:"streamComplete"` |
| 16 | RecoveryAttempts int `json:"recoveryAttempts"` |
| 17 | Usage *ResponseUsage `json:"usage,omitempty"` |
| 18 | } |
| 19 | |
| 20 | // A missing Usage means unavailable. Estimated/Unknown preserve the provider |
| 21 | // accounting distinction instead of presenting inferred counters as exact. |
| 22 | type ResponseUsage struct { |
| 23 | InputTokens int `json:"inputTokens"` |
| 24 | OutputTokens int `json:"outputTokens"` |
| 25 | ReasoningTokens int `json:"reasoningTokens"` |
| 26 | RequestCount int `json:"requestCount"` |
| 27 | Estimated bool `json:"estimated"` |
| 28 | Unknown bool `json:"unknown"` |
| 29 | } |
| 30 |