Update utils.py

This commit is contained in:
Praveen11558 2026-03-17 16:40:16 +05:30 • committed by GitHub
parent 39c7ba3cc5
commit 74edf2d531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -659,7 +659,7 @@ def generic_cost_per_token( # noqa: PLR0915
## EDGE CASE - text tokens not set or includes cached tokens (double-counting)
## Some providers (like xAI) report text_tokens = prompt_tokens (including cached)
## We detect this when: text_tokens + cached_tokens + other > prompt_tokens
## We detect this when: text_tokens + cached_tokens + other > prompt_tokens.
## Ref: https://github.com/BerriAI/litellm/issues/19680, #14874, #14875
cache_hit = prompt_tokens_details["cache_hit_tokens"]