bstraehle commited on
Commit
e2679ed
1 Parent(s): 5abdb45

Update assistants.py

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