Structured Output
Reka Research supports structured output, so you can define exactly how responses should be formatted. Use a JSON Schema to ensure responses are always parseable, typed, and ready for downstream use — no fragile post-processing required.
Structured outputs are useful for applications requiring predictable output, such as:
- Enforcing contracts between systems
- Validating results automatically
- Integrating seamlessly with other systems
Supported format
Structured output is supported via JSON Schema. Use the response_format
field to specify your expected structure.
JSON Schema
Define the fields and types your response must follow — the model will only return content that matches.
The schema must be a valid JSON Schema object.
How to use
We recommend using the OpenAI SDK helper to parse the agent’s output into your desired format.
Python
What you get back
Tips and best practices
- Be explicit — include a short note in your prompt that describes the expected structure. It helps the model stay on track and improves reliability.
- Mistakes can still happen. If the output isn’t what you expect, refine your instructions, break down the task, or include structured examples.
- Use Pydantic in Python to define your schema. It’s the easiest way to produce a valid JSON Schema from a class. Learn more.