bstraehle commited on
Commit
9d6cba0
·
verified ·
1 Parent(s): ce17c83

Update assistants.py

Browse files
Files changed (1) hide show
  1. assistants.py +4 -2
assistants.py CHANGED
@@ -175,7 +175,7 @@ def extract_content_values(data):
175
  def recurse_execute_tool_calls(thread, run, run_steps, iteration):
176
  tool_call_ids, tool_call_results = execute_tool_calls(run_steps)
177
 
178
- if len(tool_call_ids) > 0:
179
  # https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
180
  tool_output = {}
181
 
@@ -199,4 +199,6 @@ def recurse_execute_tool_calls(thread, run, run_steps, iteration):
199
  run = wait_on_run(openai_client, thread, run)
200
  run_steps = get_run_steps(openai_client, thread, run)
201
 
202
- recurse_execute_tool_calls(thread, run, run_steps, iteration + 1)
 
 
 
175
  def recurse_execute_tool_calls(thread, run, run_steps, iteration):
176
  tool_call_ids, tool_call_results = execute_tool_calls(run_steps)
177
 
178
+ if len(tool_call_ids) > iteration:
179
  # https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
180
  tool_output = {}
181
 
 
199
  run = wait_on_run(openai_client, thread, run)
200
  run_steps = get_run_steps(openai_client, thread, run)
201
 
202
+ recurse_execute_tool_calls(thread, run, run_steps, iteration + 1)
203
+ else
204
+ return