#1396·smolagents

[BUG] Gradio render raw json when use_structured_outputs_internally

Author: joejoe2Created May 29, 2025Updated Sep 25, 2026
Labelsenhancement

Describe the bug When use_structured_outputs_internally=True, gradio will directly display raw json like

{
"thought": "xxxx",
"code": "final_answer(x)"
}

Code to reproduce the error The simplest code snippet that produces your bug.

Error logs (if any) Provide error logs if there are any.

Expected behavior Should we convert the raw json to a more readable format in gradio ? Like the original Thought: xxxxx

Code:

xxxxx

Packages version: 1.17.0

Additional context Add any other context about the problem here.