mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
Format cost utility after merge
This commit is contained in:
parent
b0e2852f25
commit
97d331f7fb
1 changed files with 1 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue