sitatech commited on
Commit
ce940a0
·
1 Parent(s): a385c60

Fix Function object instantiation

Browse files
Files changed (1) hide show
  1. mcp_host/agent.py +6 -2
mcp_host/agent.py CHANGED
@@ -351,11 +351,15 @@ class VibeShoppingAgent:
351
  )
352
  for match in matches:
353
  try:
 
354
  pending_custom_tool_calls.append(
355
  ChoiceDeltaToolCall(
356
  index=len(pending_custom_tool_calls),
357
- function=ChoiceDeltaToolCallFunction.model_validate_json(
358
- match.strip()
 
 
 
359
  ),
360
  )
361
  )
 
351
  )
352
  for match in matches:
353
  try:
354
+ tool_call_data = json.loads(match)
355
  pending_custom_tool_calls.append(
356
  ChoiceDeltaToolCall(
357
  index=len(pending_custom_tool_calls),
358
+ function=ChoiceDeltaToolCallFunction(
359
+ name=tool_call_data["name"],
360
+ arguments=json.dumps(
361
+ tool_call_data.get("arguments", {})
362
+ ),
363
  ),
364
  )
365
  )