Skip to content

Commit 46caaf9

Browse files
committed
fix streaming handler
1 parent 1ce3020 commit 46caaf9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

litellm/litellm_core_utils/streaming_handler.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def __init__(
7272
self.sent_first_chunk = False
7373
self.sent_last_chunk = False
7474

75-
litellm_params: GenericLiteLLMParams = self.logging_obj.model_call_details.get(
76-
"litellm_params", {}
75+
litellm_params: GenericLiteLLMParams = GenericLiteLLMParams(
76+
**self.logging_obj.model_call_details.get("litellm_params", {})
7777
)
7878
self.merge_reasoning_content_in_choices = (
7979
litellm_params.merge_reasoning_content_in_choices
@@ -976,7 +976,9 @@ def _optional_combine_thinking_block_in_choices(
976976
and model_response.choices[0].delta.content
977977
):
978978
self.thinking_content += "</thinking>"
979-
model_response.choices[0].delta.content += self.thinking_content
979+
model_response.choices[0].delta.content = (
980+
self.thinking_content + model_response.choices[0].delta.content
981+
)
980982
self.sent_last_thinking_block = True
981983

982984
return model_response

0 commit comments

Comments
 (0)