Update litellm/litellm_core_utils/streaming_handler.py

Accepting the suugestion.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
lido-alexion 2026-03-18 18:54:19 +05:30 • committed by GitHub
parent ee7b0cdf02
commit 589169c715
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1109,10 +1109,11 @@ class CustomStreamWrapper:
and self.custom_llm_provider in litellm._custom_providers
):
if self.received_finish_reason is not None:
_chunk_has_content = isinstance(chunk, dict) and (
_chunk_has_content = isinstance(chunk, dict) and (
bool(chunk.get("text", ""))
or chunk.get("tool_use") is not None
or chunk.get("reasoning_content") is not None
or bool(chunk.get("reasoning_content", ""))
)
if not _chunk_has_content and (
not isinstance(chunk, dict)