fix: add null check for delta in streaming mode to prevent AttributeError when tool calls are returned (#6365)

This commit is contained in:
Rin
2026-03-15 22:17:12 +08:00
committed by GitHub
parent 20efaa5320
commit b0e10cf479
@@ -322,7 +322,7 @@ class ProviderOpenAIOfficial(Provider):
if reasoning:
llm_response.reasoning_content = reasoning
_y = True
if delta.content:
if delta and delta.content:
# Don't strip streaming chunks to preserve spaces between words
completion_text = self._normalize_content(delta.content, strip=False)
llm_response.result_chain = MessageChain(