bstraehle commited on
Commit
9aa5953
·
verified ·
1 Parent(s): 95ae670

Update assistants.py

Browse files
Files changed (1) hide show
  1. assistants.py +6 -9
assistants.py CHANGED
@@ -155,25 +155,22 @@ def execute_tool_call(tool_call):
155
  return tools[name](**args)
156
 
157
  def execute_tool_calls(run_steps):
158
- run_step_details = []
159
  tool_call_ids = []
160
  tool_call_results = []
161
 
162
  for step in run_steps.data:
163
  step_details = step.step_details
164
- run_step_details.append(step_details)
165
- #print(get_json("step_details", step_details))
166
- str = get_json("step_details", step_details)
167
- print(str)
168
- gr.Info(str, duration=15)
169
 
170
  if hasattr(step_details, "tool_calls"):
171
  for tool_call in step_details.tool_calls:
172
- #str = get_json("tool_call", tool_call)
173
- #print(str)
174
- #gr.Info(str, duration=15)
175
 
176
  if hasattr(tool_call, "function"):
 
177
  tool_call_ids.append(tool_call.id)
178
  tool_call_results.append(execute_tool_call(tool_call))
179
 
 
155
  return tools[name](**args)
156
 
157
  def execute_tool_calls(run_steps):
158
+ #run_step_details = []
159
  tool_call_ids = []
160
  tool_call_results = []
161
 
162
  for step in run_steps.data:
163
  step_details = step.step_details
164
+ #run_step_details.append(step_details)
165
+ print(get_json("step_details", step_details))
166
+ gr.Info(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
  if hasattr(tool_call, "function"):
173
+ gr.Info(tool_call.function.name)
174
  tool_call_ids.append(tool_call.id)
175
  tool_call_results.append(execute_tool_call(tool_call))
176