Spaces:
Running
Running
Fix Function object instantiation
Browse files- 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
|
| 358 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
)
|