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(
286286 for tool_call in delta .tool_calls :
287287 # Aggregate chunks into tool calls
288288 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)
290292 tool_call .function .arguments = ""
291293 final_tool_calls [tool_call .index ] = tool_call
292294
293- if tool_call .function .arguments :
295+ elif tool_call .function .arguments :
294296 final_tool_calls [tool_call .index ].function .arguments += tool_call .function .arguments
295297
296298 # Optionally exit early if no tools in first chunks
You can’t perform that action at this time.
0 commit comments