From 034f3938f36ab2ffbd9efa302901104dc981396f Mon Sep 17 00:00:00 2001 From: Senthurapandi <127392902+senthurapandi2000@users.noreply.github.com> Date: Sun, 20 Sep 2026 19:12:49 -0700 Subject: [PATCH] style: format streaming handler --- .../litellm_core_utils/streaming_handler.py | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index dbbdcba6a88..660e85f676b 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -2116,31 +2116,17 @@ class CustomStreamWrapper: complete_streaming_response = None if complete_streaming_response is not None and isinstance(self.model, str) and self.model: - litellm_params = self.logging_obj.model_call_details.get( - "litellm_params", {} - ) + litellm_params = self.logging_obj.model_call_details.get("litellm_params", {}) proxy_request = litellm_params.get("proxy_server_request", {}) - request_body = ( - proxy_request.get("body", {}) - if isinstance(proxy_request, dict) - else {} - ) - client_requested_model = ( - request_body.get("model") - if isinstance(request_body, dict) - else None - ) + request_body = proxy_request.get("body", {}) if isinstance(proxy_request, dict) else {} + client_requested_model = request_body.get("model") if isinstance(request_body, dict) else None assembled_model = complete_streaming_response.model builder_recovered_routed_model = ( isinstance(assembled_model, str) and bool(assembled_model) and any( - ( - chunk.get("model") - if isinstance(chunk, dict) - else getattr(chunk, "model", None) - ) + (chunk.get("model") if isinstance(chunk, dict) else getattr(chunk, "model", None)) == assembled_model for chunk in self.chunks[1:] )