mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Trim the clamp comment down to the reason for it
This commit is contained in:
parent
face423e26
commit
e0de9cbab2
1 changed files with 2 additions and 5 deletions
|
|
@ -947,11 +947,8 @@ def generic_cost_per_token(
|
|||
usage.completion_tokens - reasoning_tokens - audio_tokens - image_tokens - video_tokens,
|
||||
)
|
||||
else:
|
||||
# No breakdown at all, all tokens are text tokens.
|
||||
# Clamped for the same reason the branch above is: a negative count
|
||||
# would otherwise multiply straight into a negative cost, and this
|
||||
# is the only one of the four token paths in this module that did
|
||||
# not guard against it.
|
||||
# No breakdown at all, all tokens are text tokens. Clamped like
|
||||
# the branch above, so a negative count cannot credit the budget.
|
||||
text_tokens = max(0, usage.completion_tokens)
|
||||
is_text_tokens_total = True
|
||||
## TEXT COST
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue