bstraehle commited on
Commit
bd01f4f
1 Parent(s): 2187755

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -105,19 +105,23 @@ def get_run_step_details(run_steps):
105
 
106
  show_json("step_details", step_details)
107
 
 
108
  if hasattr(step_details, "tool_calls"):
109
  for tool_call in step_details.tool_calls:
110
  print("\n\n")
111
  show_json("tool_call", tool_call)
112
  print("\n\n")
113
- print(tool_call.code_interpreter)
114
- print("\n\n")
115
- print(tool_call.code_interpreter.outputs)
116
- # [CodeInterpreterOutputImage(image=CodeInterpreterOutputImageImage(file_id='file-qmr1d6ObICSjyGvmoncXvBPj'), type='image')]
117
- print("\n\n")
118
- print(tool_call.code_interpreter.outputs[0].file_id)
119
- print(tool_call.code_interpreter.outputs[0].type)
120
- print("\n\n")
 
 
 
121
 
122
  def get_messages(client, thread):
123
  messages = client.beta.threads.messages.list(
 
105
 
106
  show_json("step_details", step_details)
107
 
108
+ ###
109
  if hasattr(step_details, "tool_calls"):
110
  for tool_call in step_details.tool_calls:
111
  print("\n\n")
112
  show_json("tool_call", tool_call)
113
  print("\n\n")
114
+ if hasattr(tool_call, "code_interpreter"):
115
+ print(tool_call.code_interpreter)
116
+ print("\n\n")
117
+ if hasattr(tool_call.code_interpreter, "outputs"):
118
+ print(tool_call.code_interpreter.outputs)
119
+ # [CodeInterpreterOutputImage(image=CodeInterpreterOutputImageImage(file_id='file-qmr1d6ObICSjyGvmoncXvBPj'), type='image')]
120
+ if len(outputs) > 0:
121
+ print("\n\n")
122
+ print(tool_call.code_interpreter.outputs[0].file_id)
123
+ print(tool_call.code_interpreter.outputs[0].type)
124
+ print("\n\n")
125
 
126
  def get_messages(client, thread):
127
  messages = client.beta.threads.messages.list(