diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index f453687450b..580a522be18 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -955,7 +955,7 @@ class CustomStreamWrapper: if reasoning_content: if self.sent_first_thinking_block is False: self.thinking_content += ( - model_response.choices[0].delta.content or "" + model_response.choices[0].delta.content or "" ) + f"{model_response.choices[0].delta.reasoning_content}" self.sent_first_thinking_block = True return None @@ -973,8 +973,8 @@ class CustomStreamWrapper: and not self.sent_last_thinking_block and model_response.choices[0].delta.content ): - self.thinking_content += "" - model_response.choices[0].delta.content = self.thinking_content + self.thinking_content += "" + model_response.choices[0].delta.content += self.thinking_content self.sent_last_thinking_block = True return model_response diff --git a/litellm/types/utils.py b/litellm/types/utils.py index b118b2634f9..c2c0a4c8bf0 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -584,14 +584,6 @@ class Delta(OpenAIObject): super(Delta, self).__init__(**params) add_provider_specific_fields(self, params.get("provider_specific_fields", {})) self.content = content - - if litellm.merge_reasoning_content_in_choices: - self.content = ( - (self.content or "") + f"{reasoning_content}" - if reasoning_content - else self.content - ) - self.role = role # Set default values and correct types self.function_call: Optional[Union[FunctionCall, Any]] = None