Format cost utility after merge

This commit is contained in:
its-amann 2026-06-28 10:32:28 +05:30 • committed by Aman Agnihotri
parent b0e2852f25
commit 97d331f7fb

View file

@ -635,14 +635,7 @@ def _get_effective_prompt_tokens_for_tiered_pricing(usage: Usage) -> float:
audio_tokens = float(getattr(details, "audio_tokens", 0) or 0)
image_tokens = float(getattr(details, "image_tokens", 0) or 0)
video_tokens = float(getattr(details, "video_tokens", 0) or 0)
detail_total = (
text_tokens
+ audio_tokens
+ image_tokens
+ video_tokens
+ cached_tokens
+ cache_creation
)
detail_total = text_tokens + audio_tokens + image_tokens + video_tokens + cached_tokens + cache_creation
cache_detail_tokens = cached_tokens + cache_creation
if cache_detail_tokens > 0 and detail_total > prompt_tokens:
return prompt_tokens