Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +7 -1
assistants.py
CHANGED
@@ -124,7 +124,13 @@ def execute_tool_call(tool_call):
|
|
124 |
args = {}
|
125 |
|
126 |
if len(tool_call.function.arguments) > 10:
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
return tools[name](**args)
|
130 |
|
|
|
124 |
args = {}
|
125 |
|
126 |
if len(tool_call.function.arguments) > 10:
|
127 |
+
args_json = ""
|
128 |
+
|
129 |
+
try:
|
130 |
+
args_json = tool_call.function.arguments
|
131 |
+
args = json.loads(args_json)
|
132 |
+
except json.JSONDecodeError as e:
|
133 |
+
print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
|
134 |
|
135 |
return tools[name](**args)
|
136 |
|