Learn how to create AI agents that return structured, type-safe outputs using Pydantic models and JSON.
Install Package
First, install the Praison Labs Agents package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file app.py
with the
basic setup:
Start Agents
Type this in your terminal to run your agents:
Install Package
First, install the Praison Labs Agents package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file app.py
with the
basic setup:
Start Agents
Type this in your terminal to run your agents:
Install Package
Install the Praison Labs package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file agents.yaml
with
the basic setup:
Start Agents
Type this in your terminal to run your agents:
Requirements
Structured outputs allow you to:
Define exact data structures with validation.
Get structured JSON responses.
Ensure type-safe, validated outputs.
Choose between Pydantic or JSON.
Install Package
First, install the Praison Labs Agents package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file app.py
with the
basic setup:
Start Agents
Type this in your terminal to run your agents:
Install Package
First, install the Praison Labs Agents package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file app.py
with the
basic setup:
Start Agents
Type this in your terminal to run your agents:
Install Package
Install the Praison Labs package:
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Create a file
Create a new file agents.yaml
with
the basic setup:
Start Agents
Type this in your terminal to run your agents:
If model validation fails:
If output format is incorrect:
Learn about automatically created and managed AI agents
Explore lightweight, focused AI agents
For optimal results, ensure your Pydantic models accurately represent your desired output structure.