bstraehle commited on
Commit
216cad8
1 Parent(s): b3a9e72

Update assistants.py

Browse files
Files changed (1) hide show
  1. assistants.py +11 -10
assistants.py CHANGED
@@ -169,16 +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
- print(get_json("tool_call", tool_call))
173
-
174
- func_name = ""
175
-
176
- if hasattr(tool_call, "function"):
177
- func_name = tool_call.function.name
178
- tool_call_ids.append(tool_call.id)
179
- tool_call_results.append(execute_tool_call(tool_call))
180
- else:
181
- gr.Info(f"Tool: {tool_call.type}", duration=30)
 
182
 
183
  return tool_call_ids, tool_call_results
184
 
 
169
 
170
  if hasattr(step_details, "tool_calls"):
171
  for tool_call in step_details.tool_calls:
172
+ if tool_call.output != None
173
+ print(get_json("tool_call", tool_call))
174
+
175
+ func_name = ""
176
+
177
+ if hasattr(tool_call, "function"):
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