Initialize the delta tool call fields explicitly (#17340)

Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Co-authored-by: igmainc <igmainc@icloud.com>
This commit is contained in:
Maximilien de Bayser
2025-05-12 10:28:58 -03:00
committed by GitHub
parent 7ea6cb28b2
commit 05a4324f8e
12 changed files with 51 additions and 34 deletions

View File

@@ -32,7 +32,7 @@ class StreamingToolReconstructor:
assert len(delta.tool_calls) < 2, (
"Streaming should include only one tool call per update.")
for call_delta in delta.tool_calls:
assert call_delta.type == "function", (
assert call_delta.type is None or call_delta.type == "function", (
"Streaming tool calls should only emit function calls. Got "
f"{call_delta.type}")
current_tool_call = self.tool_calls[