Trim the clamp comment down to the reason for it

This commit is contained in:
nazsats 2026-08-24 13:41:20 +05:30
parent face423e26
commit e0de9cbab2

View file

@ -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