From 46caaf97b34fb93ff88ed650f923ca4e110ce2cc Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 6 Mar 2025 07:23:19 -0800 Subject: [PATCH] fix streaming handler --- litellm/litellm_core_utils/streaming_handler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index a02e5d2c9c4..4b331688b77 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -72,8 +72,8 @@ class CustomStreamWrapper: self.sent_first_chunk = False self.sent_last_chunk = False - litellm_params: GenericLiteLLMParams = self.logging_obj.model_call_details.get( - "litellm_params", {} + litellm_params: GenericLiteLLMParams = GenericLiteLLMParams( + **self.logging_obj.model_call_details.get("litellm_params", {}) ) self.merge_reasoning_content_in_choices = ( litellm_params.merge_reasoning_content_in_choices @@ -976,7 +976,9 @@ class CustomStreamWrapper: and model_response.choices[0].delta.content ): self.thinking_content += "" - model_response.choices[0].delta.content += self.thinking_content + model_response.choices[0].delta.content = ( + self.thinking_content + model_response.choices[0].delta.content + ) self.sent_last_thinking_block = True return model_response