bstraehle commited on
Commit
8a263ec
1 Parent(s): 4408670

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -263,12 +263,12 @@ def chat(message, history):
263
  print("###")
264
  print(len(tool_call_ids))
265
  print(tool_call_ids)
266
- print(tool_call_ids[0])
267
  print(tool_call_results)
268
- print(tool_call_results[0])
269
  print("###")
270
 
271
- if tool_call_ids[0]:
272
  # https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
273
  run = client.beta.threads.runs.submit_tool_outputs(
274
  thread_id=thread.id,
@@ -276,8 +276,8 @@ def chat(message, history):
276
  #tool_outputs=generate_tool_outputs(tool_call_ids, tool_call_results)
277
  tool_outputs=[
278
  {
279
- "tool_call_id": tool_call_ids[0],
280
- "output": tool_call_results[0]
281
  }
282
  ]
283
  )
 
263
  print("###")
264
  print(len(tool_call_ids))
265
  print(tool_call_ids)
266
+ print(tool_call_ids[1])
267
  print(tool_call_results)
268
+ print(tool_call_results[1])
269
  print("###")
270
 
271
+ if tool_call_ids[1]:
272
  # https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
273
  run = client.beta.threads.runs.submit_tool_outputs(
274
  thread_id=thread.id,
 
276
  #tool_outputs=generate_tool_outputs(tool_call_ids, tool_call_results)
277
  tool_outputs=[
278
  {
279
+ "tool_call_id": tool_call_ids[1],
280
+ "output": tool_call_results[1].to_json()
281
  }
282
  ]
283
  )