mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix: add reasoning field check to is_chunk_non_empty for streaming
This fixes the issue where streaming responses from vLLM/SGLang backends were missing reasoning_content. The backend sends 'reasoning' field but LiteLLM's is_chunk_non_empty() was only checking for 'reasoning_content', causing chunks with only reasoning content to be filtered out. Fixes: BerriAI/litellm#20246
This commit is contained in:
parent
b4a5e51668
commit
da4f5cd9ed
1 changed files with 5 additions and 0 deletions
|
|
@ -794,6 +794,11 @@ class CustomStreamWrapper:
|
|||
"reasoning_content" in model_response.choices[0].delta
|
||||
and model_response.choices[0].delta.reasoning_content is not None
|
||||
)
|
||||
or (
|
||||
"reasoning" in completion_obj
|
||||
and completion_obj["reasoning"] is not None
|
||||
and len(str(completion_obj["reasoning"])) > 0
|
||||
)
|
||||
or (model_response.choices[0].delta.provider_specific_fields is not None)
|
||||
or (
|
||||
"provider_specific_fields" in model_response
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue