The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(test_assemble_streaming_responses.py): update test to use correct type
Krrish Dholakia359b8298f82b
diff --git a/tests/logging_callback_tests/test_assemble_streaming_responses.py b/tests/logging_callback_tests/test_assemble_streaming_responses.pyindex 1101350fa29..20e46db229d 100644--- a/tests/logging_callback_tests/test_assemble_streaming_responses.py+++ b/tests/logging_callback_tests/test_assemble_streaming_responses.py@@ -24,7 +24,14 @@ import pytestfrom respx import MockRouterimport litellm-from litellm import Choices, Message, ModelResponse, TextCompletionResponse, TextChoices+from litellm import (+ Choices,+ Message,+ ModelResponse,+ ModelResponseStream,+ TextCompletionResponse,+ TextChoices,+)from litellm.litellm_core_utils.logging_utils import (_assemble_complete_response_from_streaming_chunks,@@ -63,7 +70,7 @@ def test_assemble_complete_response_from_streaming_chunks_1(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)complete_streaming_response = _assemble_complete_response_from_streaming_chunks(result=chunk,start_time=datetime.now(),@@ -103,7 +110,7 @@ def test_assemble_complete_response_from_streaming_chunks_1(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)complete_streaming_response = _assemble_complete_response_from_streaming_chunks(result=chunk,start_time=datetime.now(),@@ -164,7 +171,7 @@ def test_assemble_complete_response_from_streaming_chunks_2(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)chunk = _text_completion_stream_wrapper.convert_to_text_completion_object(chunk)complete_streaming_response = _assemble_complete_response_from_streaming_chunks(@@ -206,7 +213,7 @@ def test_assemble_complete_response_from_streaming_chunks_2(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)chunk = _text_completion_stream_wrapper.convert_to_text_completion_object(chunk)complete_streaming_response = _assemble_complete_response_from_streaming_chunks(result=chunk,@@ -261,7 +268,7 @@ def test_assemble_complete_response_from_streaming_chunks_3(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)complete_streaming_response = _assemble_complete_response_from_streaming_chunks(result=chunk,start_time=datetime.now(),@@ -338,7 +345,7 @@ def test_assemble_complete_response_from_streaming_chunks_4(is_async):"system_fingerprint": None,"usage": None,}- chunk = litellm.ModelResponse(**chunk, stream=True)+ chunk = ModelResponseStream(**chunk)# remove attribute id from chunkdel chunk.object