mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-08 08:08:37 +00:00
chore: suppress LIT002 on messages fallback for Gemini token counter
Adds `# mutable-ok:` suppression on the `messages or []` fallback passed to `_gemini_convert_messages_with_history`. The [] is a None-fallback; the helper signature requires list[AllMessageValues], so a tuple would violate the type contract. Resolves type-discipline-budget CI failure on PR #36981. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
35993ecd37
commit
d0bd9f5cd5
1 changed files with 5 additions and 1 deletions
|
|
@ -1170,7 +1170,11 @@ class VertexAITokenCounter(BaseTokenCounter):
|
|||
)
|
||||
|
||||
resolved_contents: Final = (
|
||||
contents if contents is not None else _gemini_convert_messages_with_history(messages=messages or [])
|
||||
contents
|
||||
if contents is not None
|
||||
else _gemini_convert_messages_with_history(
|
||||
messages=messages or [] # mutable-ok: fallback for None messages; helper signature requires list
|
||||
)
|
||||
)
|
||||
|
||||
count_tokens_params: Final = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue