From eb7a6040c1db989a6a6735fa67047d38aa4e36a9 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 26 Feb 2026 12:55:59 +0530 Subject: [PATCH] Fix pass through tests --- litellm/litellm_core_utils/realtime_streaming.py | 4 ++-- .../pass_through_endpoints/test_llm_pass_through_endpoints.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/realtime_streaming.py b/litellm/litellm_core_utils/realtime_streaming.py index 898acadda60..8df41aea4a3 100644 --- a/litellm/litellm_core_utils/realtime_streaming.py +++ b/litellm/litellm_core_utils/realtime_streaming.py @@ -159,7 +159,7 @@ class RealTimeStreaming: event_type == "conversation.item.input_audio_transcription.completed" ): - transcript = event_obj.get("transcript", "") + transcript = cast(str, event_obj.get("transcript", "")) if transcript: self.input_messages.append( {"role": "user", "content": transcript} @@ -174,7 +174,7 @@ class RealTimeStreaming: try: if event_obj.get("type") != "response.done": return - response = event_obj.get("response", {}) + response = cast(Dict[str, Any], event_obj.get("response", {})) for item in response.get("output", []): if item.get("type") == "function_call": self.tool_calls.append( diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py index cac8f98cbb7..fdc821ef8bb 100644 --- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py +++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py @@ -224,6 +224,7 @@ class TestVertexAIPassThroughHandler: # Mock request mock_request = Mock() + mock_request.state = None # Prevent Mock from returning a truthy _cached_headers mock_request.method = "POST" mock_request.headers = { "Authorization": "Bearer test-creds", @@ -323,6 +324,7 @@ class TestVertexAIPassThroughHandler: # Mock request mock_request = Mock() + mock_request.state = None # Prevent Mock from returning a truthy _cached_headers mock_request.method = "POST" mock_request.headers = { "Authorization": "Bearer test-creds", @@ -905,6 +907,7 @@ class TestVertexAIDiscoveryPassThroughHandler: # Mock request mock_request = Mock() + mock_request.state = None # Prevent Mock from returning a truthy _cached_headers mock_request.method = "POST" mock_request.headers = { "Authorization": "Bearer test-key",