mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
fix(streaming): scope role-only chunk preservation to Azure only
The Azure streaming fix (PR #25638) made is_chunk_non_empty() treat any first chunk with role!=None as non-empty, for all providers. This broke OpenAI/Mistral tests where the role-only first chunk was expected to be filtered, and test idx==0 assumed the first emitted chunk had actual content (tool_calls, logprobs, etc.). Restrict the condition to Azure, which is the provider that actually needs it: Azure sends prompt_filter_results before the first content chunk, which consumes sent_first_chunk and strips role from the real first chunk. Other providers should retain the original behavior.
This commit is contained in:
parent
bd5740a367
commit
9640dd5765
1 changed files with 1 additions and 4 deletions
|
|
@ -839,10 +839,7 @@ class CustomStreamWrapper:
|
|||
not self.sent_first_chunk
|
||||
and hasattr(model_response.choices[0].delta, "role")
|
||||
and model_response.choices[0].delta.role is not None
|
||||
and not (
|
||||
model_response.choices[0].logprobs is not None
|
||||
and not model_response.choices[0].logprobs.content
|
||||
)
|
||||
and self.custom_llm_provider == "azure"
|
||||
)
|
||||
):
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue