Unverified Commit b46bd8b9 authored by Aymeric Roucher's avatar Aymeric Roucher Committed by GitHub
Browse files

Fix error when streaming to gradio with non-string tool arguments (#32360)

Fix error when streaming agent run to gradio with non-string tool arguments
parent ef177a5e
......@@ -34,7 +34,7 @@ def pull_message(step_log: dict):
yield ChatMessage(
role="assistant",
metadata={"title": f"🛠️ Used tool {step_log['tool_call']['tool_name']}"},
content=content,
content=str(content),
)
if step_log.get("observation"):
yield ChatMessage(role="assistant", content=f"```\n{step_log['observation']}\n```")
......@@ -72,4 +72,4 @@ def stream_to_gradio(agent: ReactAgent, task: str, **kwargs):
content={"path": step_log.to_string(), "mime_type": "audio/wav"},
)
else:
yield ChatMessage(role="assistant", content=step_log)
yield ChatMessage(role="assistant", content=str(step_log))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment