Spaces:
Runtime error
Runtime error
Leonardo
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -285,12 +285,12 @@ def stream_to_gradio(
|
|
| 285 |
role="assistant",
|
| 286 |
content=f"**Final answer:**\n{final_answer.to_string()}\n",
|
| 287 |
)
|
| 288 |
-
|
| 289 |
yield gr.ChatMessage(
|
| 290 |
role="assistant",
|
| 291 |
content={"image": final_answer.to_string(), "type": "file"},
|
| 292 |
) # Send as Gradio-compatible file object:
|
| 293 |
-
|
| 294 |
yield gr.ChatMessage(
|
| 295 |
role="assistant",
|
| 296 |
content={"audio": final_answer.to_string(), "type": "file"},
|
|
|
|
| 285 |
role="assistant",
|
| 286 |
content=f"**Final answer:**\n{final_answer.to_string()}\n",
|
| 287 |
)
|
| 288 |
+
if isinstance(final_answer, AgentImage):
|
| 289 |
yield gr.ChatMessage(
|
| 290 |
role="assistant",
|
| 291 |
content={"image": final_answer.to_string(), "type": "file"},
|
| 292 |
) # Send as Gradio-compatible file object:
|
| 293 |
+
if isinstance(final_answer, AgentAudio):
|
| 294 |
yield gr.ChatMessage(
|
| 295 |
role="assistant",
|
| 296 |
content={"audio": final_answer.to_string(), "type": "file"},
|