Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +2 -6
assistants.py
CHANGED
@@ -163,7 +163,7 @@ def execute_tool_calls(run_steps):
|
|
163 |
print(get_json("step_details", step_details))
|
164 |
|
165 |
if step.usage:
|
166 |
-
gr.Info(f"Step: {step_details.type} {get_json('usage', step.usage)}", duration=30)
|
167 |
|
168 |
if hasattr(step_details, "tool_calls"):
|
169 |
for tool_call in step_details.tool_calls:
|
@@ -196,9 +196,7 @@ def recurse_execute_tool_calls(thread, run, run_steps, iteration):
|
|
196 |
"tool_call_id": tool_call_ids[iteration],
|
197 |
"output": tool_call_results[iteration]
|
198 |
}
|
199 |
-
|
200 |
-
gr.Info(tool_output, duration=30)
|
201 |
-
|
202 |
# https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
|
203 |
run = openai_client.beta.threads.runs.submit_tool_outputs(
|
204 |
thread_id=thread.id,
|
@@ -228,10 +226,8 @@ def extract_content_values(data):
|
|
228 |
if content.type == "text":
|
229 |
text_value = content.text.value
|
230 |
text_values.append(text_value)
|
231 |
-
#gr.Info(text_value, duration=15)
|
232 |
if content.type == "image_file":
|
233 |
image_value = content.image_file.file_id
|
234 |
image_values.append(image_value)
|
235 |
-
#gr.Info(image_value, duration=15)
|
236 |
|
237 |
return text_values, image_values
|
|
|
163 |
print(get_json("step_details", step_details))
|
164 |
|
165 |
if step.usage:
|
166 |
+
gr.Info(f"Step: {step_details.type}, {get_json('usage', step.usage)}", duration=30)
|
167 |
|
168 |
if hasattr(step_details, "tool_calls"):
|
169 |
for tool_call in step_details.tool_calls:
|
|
|
196 |
"tool_call_id": tool_call_ids[iteration],
|
197 |
"output": tool_call_results[iteration]
|
198 |
}
|
199 |
+
|
|
|
|
|
200 |
# https://platform.openai.com/docs/api-reference/runs/submitToolOutputs
|
201 |
run = openai_client.beta.threads.runs.submit_tool_outputs(
|
202 |
thread_id=thread.id,
|
|
|
226 |
if content.type == "text":
|
227 |
text_value = content.text.value
|
228 |
text_values.append(text_value)
|
|
|
229 |
if content.type == "image_file":
|
230 |
image_value = content.image_file.file_id
|
231 |
image_values.append(image_value)
|
|
|
232 |
|
233 |
return text_values, image_values
|