Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +5 -1
assistants.py
CHANGED
|
@@ -191,7 +191,9 @@ def recurse_execute_tool_calls(thread, run, run_steps, iteration):
|
|
| 191 |
"tool_call_id": tool_call_ids[iteration],
|
| 192 |
"output": tool_call_results[iteration]
|
| 193 |
}
|
| 194 |
-
|
|
|
|
|
|
|
| 195 |
# https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
|
| 196 |
run = openai_client.beta.threads.runs.submit_tool_outputs(
|
| 197 |
thread_id=thread.id,
|
|
@@ -221,8 +223,10 @@ def extract_content_values(data):
|
|
| 221 |
if content.type == "text":
|
| 222 |
text_value = content.text.value
|
| 223 |
text_values.append(text_value)
|
|
|
|
| 224 |
if content.type == "image_file":
|
| 225 |
image_value = content.image_file.file_id
|
| 226 |
image_values.append(image_value)
|
|
|
|
| 227 |
|
| 228 |
return text_values, image_values
|
|
|
|
| 191 |
"tool_call_id": tool_call_ids[iteration],
|
| 192 |
"output": tool_call_results[iteration]
|
| 193 |
}
|
| 194 |
+
|
| 195 |
+
gr.Info(tool_output, duration=30)
|
| 196 |
+
|
| 197 |
# https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
|
| 198 |
run = openai_client.beta.threads.runs.submit_tool_outputs(
|
| 199 |
thread_id=thread.id,
|
|
|
|
| 223 |
if content.type == "text":
|
| 224 |
text_value = content.text.value
|
| 225 |
text_values.append(text_value)
|
| 226 |
+
gr.Info(text_value, duration=15)
|
| 227 |
if content.type == "image_file":
|
| 228 |
image_value = content.image_file.file_id
|
| 229 |
image_values.append(image_value)
|
| 230 |
+
gr.Info(image_value, duration=15)
|
| 231 |
|
| 232 |
return text_values, image_values
|