Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +8 -8
assistants.py
CHANGED
|
@@ -169,17 +169,17 @@ def execute_tool_calls(run_steps):
|
|
| 169 |
|
| 170 |
if hasattr(step_details, "tool_calls"):
|
| 171 |
for tool_call in step_details.tool_calls:
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
if
|
| 178 |
func_name = tool_call.function.name
|
| 179 |
tool_call_ids.append(tool_call.id)
|
| 180 |
tool_call_results.append(execute_tool_call(tool_call))
|
| 181 |
-
|
| 182 |
-
|
| 183 |
|
| 184 |
return tool_call_ids, tool_call_results
|
| 185 |
|
|
|
|
| 169 |
|
| 170 |
if hasattr(step_details, "tool_calls"):
|
| 171 |
for tool_call in step_details.tool_calls:
|
| 172 |
+
print(get_json("tool_call", tool_call))
|
| 173 |
+
|
| 174 |
+
func_name = ""
|
| 175 |
+
|
| 176 |
+
if hasattr(tool_call, "function"):
|
| 177 |
+
if tool_call.output == None:
|
| 178 |
func_name = tool_call.function.name
|
| 179 |
tool_call_ids.append(tool_call.id)
|
| 180 |
tool_call_results.append(execute_tool_call(tool_call))
|
| 181 |
+
else:
|
| 182 |
+
gr.Info(f"Tool: {tool_call.type}", duration=30)
|
| 183 |
|
| 184 |
return tool_call_ids, tool_call_results
|
| 185 |
|