mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-28 06:23:07 +00:00
Format cost utility after merge
This commit is contained in:
parent
ceb8dd8074
commit
50ff0c1346
1 changed files with 1 additions and 8 deletions
|
|
@ -754,14 +754,7 @@ def _get_effective_prompt_tokens_for_tiered_pricing(usage: Usage) -> float:
|
|||
audio_tokens: Final = _loose_token_count(_detail_token(details, "audio_tokens"))
|
||||
image_tokens: Final = _loose_token_count(_detail_token(details, "image_tokens"))
|
||||
video_tokens: Final = _loose_token_count(_detail_token(details, "video_tokens"))
|
||||
detail_total: Final = (
|
||||
text_tokens
|
||||
+ audio_tokens
|
||||
+ image_tokens
|
||||
+ video_tokens
|
||||
+ cached_tokens
|
||||
+ cache_creation
|
||||
)
|
||||
detail_total: Final = text_tokens + audio_tokens + image_tokens + video_tokens + cached_tokens + cache_creation
|
||||
modality_cache_tokens: Final = cached_tokens + cache_creation
|
||||
if modality_cache_tokens > 0 and detail_total > prompt_tokens:
|
||||
return prompt_tokens
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue