Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +3 -5
assistants.py
CHANGED
@@ -152,7 +152,7 @@ def execute_tool_call(tool_call):
|
|
152 |
except json.JSONDecodeError as e:
|
153 |
print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
|
154 |
|
155 |
-
|
156 |
|
157 |
return tools[name](**args)
|
158 |
|
@@ -165,18 +165,16 @@ def execute_tool_calls(run_steps):
|
|
165 |
step_details = step.step_details
|
166 |
run_step_details.append(step_details)
|
167 |
show_json("step_details", step_details)
|
168 |
-
|
169 |
-
gr.Info(f"Step details {step_details}")
|
170 |
|
171 |
if hasattr(step_details, "tool_calls"):
|
172 |
for tool_call in step_details.tool_calls:
|
173 |
show_json("tool_call", tool_call)
|
174 |
|
175 |
-
#gr.Info(f"Calling tool {tool_call}")
|
176 |
-
|
177 |
if hasattr(tool_call, "function"):
|
178 |
tool_call_ids.append(tool_call.id)
|
179 |
tool_call_results.append(execute_tool_call(tool_call))
|
|
|
|
|
180 |
|
181 |
return tool_call_ids, tool_call_results
|
182 |
|
|
|
152 |
except json.JSONDecodeError as e:
|
153 |
print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
|
154 |
|
155 |
+
gr.Info(f"{name} {args}")
|
156 |
|
157 |
return tools[name](**args)
|
158 |
|
|
|
165 |
step_details = step.step_details
|
166 |
run_step_details.append(step_details)
|
167 |
show_json("step_details", step_details)
|
|
|
|
|
168 |
|
169 |
if hasattr(step_details, "tool_calls"):
|
170 |
for tool_call in step_details.tool_calls:
|
171 |
show_json("tool_call", tool_call)
|
172 |
|
|
|
|
|
173 |
if hasattr(tool_call, "function"):
|
174 |
tool_call_ids.append(tool_call.id)
|
175 |
tool_call_results.append(execute_tool_call(tool_call))
|
176 |
+
else
|
177 |
+
gr.Info(tool_call)
|
178 |
|
179 |
return tool_call_ids, tool_call_results
|
180 |
|