mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
test(bedrock): take the gated byte stream's chunks as an immutable Sequence
This commit is contained in:
parent
b503762289
commit
67c156f213
1 changed files with 4 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ import struct
|
|||
import zlib
|
||||
from datetime import datetime
|
||||
from types import SimpleNamespace
|
||||
from collections.abc import AsyncIterator, Mapping
|
||||
from collections.abc import AsyncIterator, Mapping, Sequence
|
||||
from typing import Final
|
||||
from unittest.mock import Mock
|
||||
|
||||
|
|
@ -3427,7 +3427,7 @@ def _bedrock_event_frame(payload: Mapping[str, object]) -> bytes:
|
|||
|
||||
|
||||
class _GatedAsyncByteStream(httpx.AsyncByteStream):
|
||||
def __init__(self, chunks: list[bytes], gate: asyncio.Event) -> None:
|
||||
def __init__(self, chunks: Sequence[bytes], gate: asyncio.Event) -> None:
|
||||
self._chunks = chunks
|
||||
self._gate = gate
|
||||
|
||||
|
|
@ -3447,7 +3447,7 @@ async def test_get_async_streaming_response_iterator_yields_small_frame_before_u
|
|||
response: Final = httpx.Response(
|
||||
200,
|
||||
stream=_GatedAsyncByteStream(
|
||||
chunks=[
|
||||
chunks=(
|
||||
_bedrock_event_frame(
|
||||
{
|
||||
"type": "message_start",
|
||||
|
|
@ -3467,7 +3467,7 @@ async def test_get_async_streaming_response_iterator_yields_small_frame_before_u
|
|||
"usage": {"input_tokens": 3, "output_tokens": 9},
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
gate=gate,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue