Fix cache usage tracking for openai-compatible (#2401)

This commit is contained in:
Matt Rubens 2025-04-08 01:20:45 -04:00 committed by GitHub
parent 903f3b64a1
commit 72a9e0bd39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -211,6 +211,8 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
type: "usage",
inputTokens: usage?.prompt_tokens || 0,
outputTokens: usage?.completion_tokens || 0,
cacheWriteTokens: usage?.cache_creation_input_tokens || undefined,
cacheReadTokens: usage?.cache_read_input_tokens || undefined,
}
}