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