File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/huggingface_hub/inference/_mcp Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -286,11 +286,13 @@ async def process_single_turn_with_tools(
286
286
for tool_call in delta .tool_calls :
287
287
# Aggregate chunks into tool calls
288
288
if tool_call .index not in final_tool_calls :
289
- if tool_call .function .arguments is None : # Corner case (depends on provider)
289
+ if (
290
+ tool_call .function .arguments is None or tool_call .function .arguments == "{}"
291
+ ): # Corner case (depends on provider)
290
292
tool_call .function .arguments = ""
291
293
final_tool_calls [tool_call .index ] = tool_call
292
294
293
- if tool_call .function .arguments :
295
+ elif tool_call .function .arguments :
294
296
final_tool_calls [tool_call .index ].function .arguments += tool_call .function .arguments
295
297
296
298
# Optionally exit early if no tools in first chunks
You can’t perform that action at this time.
0 commit comments