feat(usage): add support for detailed token breakdown in usage tracking

- Introduced `CacheReadTokens` and `CacheCreationTokens` to enhance token breakdown.
- Refactored `parseClaudeUsageNode` for cleaner and reusable logic.
- Adjusted helpers and updated token calculations to align with the new fields.
This commit is contained in:
Luis Pater
2026-05-12 11:59:07 +08:00
parent 041ccf0195
commit bd8c05a830
3 changed files with 37 additions and 31 deletions

View File

@@ -34,11 +34,13 @@ type Failure struct {
// Detail holds the token usage breakdown.
type Detail struct {
InputTokens int64
OutputTokens int64
ReasoningTokens int64
CachedTokens int64
TotalTokens int64
InputTokens int64
OutputTokens int64
ReasoningTokens int64
CachedTokens int64
CacheReadTokens int64
CacheCreationTokens int64
TotalTokens int64
}
type requestedModelAliasContextKey struct{}