Hello
Is there a list somewhere?
Hey @shai
Thank you for your question
You don’t need to manually check if a model supports structured outputs - Agno handles this automatically. When you set a response_model
, Agno will:
- Use native structured outputs if the model supports them
- Fall back to JSON mode if native structured outputs aren’t available
- Allow you to force JSON mode with
use_json_mode=True
if needed
The documentation indicates that most modern models from major providers (OpenAI’s GPT-4o, Anthropic’s Claude-3.5-Sonnet, etc.) support some form of structured output, with Agno handling the implementation details for you.
For more details you can check our docs: Basic Agent - Agno
We have added details of structured outputs under the models
Thank for the explanation - at least if makes clear what is the intent.
However, when I follow the instruction on Sonnet 3.5,
'Let me retrieve the issue details first.{\n "error_message": "",\n "error": false,\n "summary": "... something...",\n "description": "... something ...",\n "issue_key": "DT-10742"\n}'
This is neither a json nor a structured format. it is a string that contains a string of a json with the fields of my structured output
Hey @shai,
Thanks for the follow-up!
What you’re observing is expected behavior. Claude 3.5 Sonnet doesn’t support native structured outputs (like some OpenAI models do), so Agno automatically falls back to JSON mode.
In JSON mode, Agno:
- Injects the expected schema into the prompt
- Instructs the model to return a JSON object
- Parses the output into your
response_model
However, since the model doesn’t support native tooling or structured schemas, it often returns the JSON as a stringified object (a string that looks like JSON). This is what you’re seeing. Agno still parses and validates it behind the scenes, but this intermediate format may be visible during debugging.
If you want to control this explicitly, you can add use_json_mode=True
when defining your agent. This will always use the JSON-based strategy.
We’ve documented this behavior here for reference:
Structured Outputs vs JSON Mode: Structured outputs - Agno
Let me know if you’d like help tweaking your setup.