mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-05 07:37:50 +00:00
fix(proxy): compare the stream buffer through a cast
Binding the narrowed operand to Sequence[object] moved the error from reportUnknownArgumentType to reportUnknownVariableType. Cast it where it is compared, with the cast-ok marker the discipline gate asks for.
This commit is contained in:
parent
ed916038be
commit
340061916e
1 changed files with 2 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from collections import deque
|
||||
from collections.abc import Iterator, Sequence
|
||||
from typing import Final, overload
|
||||
from typing import Final, cast, overload
|
||||
|
||||
_FRAME_SEPARATORS: Final = (b"\r\n\r\n", b"\n\n")
|
||||
|
||||
|
|
@ -110,8 +110,7 @@ class BoundedChunkBuffer(Sequence[bytes]):
|
|||
def __eq__(self, other: object) -> bool:
|
||||
if not isinstance(other, Sequence):
|
||||
return False
|
||||
other_items: Final[Sequence[object]] = other
|
||||
return list(self) == list(other_items)
|
||||
return list(self) == list(cast(Sequence[object], other)) # cast-ok: isinstance narrows to Sequence[Unknown]
|
||||
|
||||
def __bool__(self) -> bool:
|
||||
return self.total_bytes > 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue