mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: use direct attribute access for enforce_openai_completion_token_invariant
Replace getattr() with direct attribute access so CodeQL can trace the usage of the module-level variable.
This commit is contained in:
parent
9b42f1eb1a
commit
02d55be891
1 changed files with 1 additions and 1 deletions
|
|
@ -728,7 +728,7 @@ class ChunkProcessor:
|
|||
# Gate behind litellm.enforce_openai_completion_token_invariant so
|
||||
# operators who rely on raw backend values can opt out.
|
||||
if (
|
||||
getattr(litellm, "enforce_openai_completion_token_invariant", True)
|
||||
litellm.enforce_openai_completion_token_invariant
|
||||
and returned_usage.completion_tokens_details is not None
|
||||
and returned_usage.completion_tokens_details.reasoning_tokens is not None
|
||||
and returned_usage.completion_tokens_details.reasoning_tokens
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue