mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(router): annotate _stream_chunks_have_generated_content with Sequence, not list
The type_discipline_gate LIT001 check flags mutable-collection parameter annotations. chunks is only iterated, never mutated, so Sequence is the correct read-only annotation and clears the ratcheted budget ceiling.
This commit is contained in:
parent
3f0f1380a4
commit
ebc3845dac
1 changed files with 2 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ import threading
|
|||
import time
|
||||
import traceback
|
||||
from collections import defaultdict
|
||||
from collections.abc import AsyncGenerator, Callable, Generator, Mapping
|
||||
from collections.abc import AsyncGenerator, Callable, Generator, Mapping, Sequence
|
||||
from functools import lru_cache
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
|
|
@ -308,7 +308,7 @@ def model_info_is_active_for_environment(model_info: Mapping[str, object] | None
|
|||
_PreRoutingStrategyT = TypeVar("_PreRoutingStrategyT")
|
||||
|
||||
|
||||
def _stream_chunks_have_generated_content(chunks: list[ModelResponseStream]) -> bool:
|
||||
def _stream_chunks_have_generated_content(chunks: Sequence[ModelResponseStream]) -> bool:
|
||||
for chunk in chunks:
|
||||
if not chunk.choices:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue