Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +6 -5
assistants.py
CHANGED
|
@@ -163,20 +163,21 @@ def execute_tool_calls(run_steps):
|
|
| 163 |
print(get_json("step_details", step_details))
|
| 164 |
|
| 165 |
if step.usage:
|
| 166 |
-
gr.Info(f"Step: {step_details.type}
|
| 167 |
|
| 168 |
if hasattr(step_details, "tool_calls"):
|
| 169 |
for tool_call in step_details.tool_calls:
|
| 170 |
print(get_json("tool_call", tool_call))
|
| 171 |
|
| 172 |
-
|
| 173 |
-
gr.Info(tool_call.type, duration=30)
|
| 174 |
|
| 175 |
if hasattr(tool_call, "function"):
|
| 176 |
-
|
| 177 |
tool_call_ids.append(tool_call.id)
|
| 178 |
tool_call_results.append(execute_tool_call(tool_call))
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
return tool_call_ids, tool_call_results
|
| 181 |
|
| 182 |
def recurse_execute_tool_calls(thread, run, run_steps, iteration):
|
|
|
|
| 163 |
print(get_json("step_details", step_details))
|
| 164 |
|
| 165 |
if step.usage:
|
| 166 |
+
gr.Info(f"Step: {get_json('step_details', step_details.type)} {get_json('usage', step.usage)}", duration=30)
|
| 167 |
|
| 168 |
if hasattr(step_details, "tool_calls"):
|
| 169 |
for tool_call in step_details.tool_calls:
|
| 170 |
print(get_json("tool_call", tool_call))
|
| 171 |
|
| 172 |
+
func_name = ""
|
|
|
|
| 173 |
|
| 174 |
if hasattr(tool_call, "function"):
|
| 175 |
+
func_name = tool_call.function.name
|
| 176 |
tool_call_ids.append(tool_call.id)
|
| 177 |
tool_call_results.append(execute_tool_call(tool_call))
|
| 178 |
+
|
| 179 |
+
gr.Info(f"Tool: {tool_call.type} {func_name}", duration=30)
|
| 180 |
+
|
| 181 |
return tool_call_ids, tool_call_results
|
| 182 |
|
| 183 |
def recurse_execute_tool_calls(thread, run, run_steps, iteration):
|