mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix streaming handler
This commit is contained in:
parent
1ce302055a
commit
46caaf97b3
1 changed files with 5 additions and 3 deletions
|
|
@ -72,8 +72,8 @@ class CustomStreamWrapper:
|
||||||
self.sent_first_chunk = False
|
self.sent_first_chunk = False
|
||||||
self.sent_last_chunk = False
|
self.sent_last_chunk = False
|
||||||
|
|
||||||
litellm_params: GenericLiteLLMParams = self.logging_obj.model_call_details.get(
|
litellm_params: GenericLiteLLMParams = GenericLiteLLMParams(
|
||||||
"litellm_params", {}
|
**self.logging_obj.model_call_details.get("litellm_params", {})
|
||||||
)
|
)
|
||||||
self.merge_reasoning_content_in_choices = (
|
self.merge_reasoning_content_in_choices = (
|
||||||
litellm_params.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
|
and model_response.choices[0].delta.content
|
||||||
):
|
):
|
||||||
self.thinking_content += "</thinking>"
|
self.thinking_content += "</thinking>"
|
||||||
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
|
self.sent_last_thinking_block = True
|
||||||
|
|
||||||
return model_response
|
return model_response
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue