framework: pydantic_ai in agents YAML — or use the Agent class directly as above.
Requires
praisonai-frameworks 0.1.9+. OpenAI models use OPENAI_API_KEY. Gemini uses GOOGLE_API_KEY or GEMINI_API_KEY.Quick Start
Models
| Model | API key |
|---|---|
openai/gpt-4o-mini | OPENAI_API_KEY |
gemini-2.0-flash | GOOGLE_API_KEY or GEMINI_API_KEY |
Supported Patterns
| Phase | Pattern | Status |
|---|---|---|
| 1 | Single role, single task | Supported |
| 2 | Sequential tasks with context: | Supported |
| 3 | handoff.to (single task → delegation tools) | Supported |
Handoffs
Use the samehandoff.to pattern as OpenAI Agents — one router role with a single task, specialists without tasks:
handoff.to fall back to sequential execution (OpenAI parity).
Migrate from Pydantic AI
praisonai migrate converts Pydantic AI code to PraisonAI automatically.
What gets rewritten
| Pydantic AI | PraisonAI |
|---|---|
from pydantic_ai import Agent | from praisonaiagents import Agent |
agent.run_sync("...") | agent.start("...") |
Doctor Check
The Pydantic AI runtime card reports:| Capability | Status |
|---|---|
agent_creation | ✅ Supported |
tool_execution | ✅ Supported |
sequential_execution | ✅ Supported |
handoff_support | ✅ Supported |
Limitations
| Feature | Status |
|---|---|
| pydantic-graph workflows | Not used |
| Agent spec YAML bridge | Not supported |
| Built-in capabilities (WebSearch, Thinking) | Not mapped |
Workflow YAML with framework: pydantic_ai | Not supported — raises ValueError |
output_schema / structured deps | Not mapped in v1 |
| A2A broker | Not supported |
Best Practices
Use Phase 1 for simple tasks
Use Phase 1 for simple tasks
Start with a single role and single task to validate your setup before adding complexity.
Use Phase 2 for dependent steps
Use Phase 2 for dependent steps
Add
context: to tasks when each step needs output from the previous one.Use Phase 3 for routing
Use Phase 3 for routing
Keep the router role to a single task with
handoff.to; multi-task routers fall back to sequential.Match model to API key
Match model to API key
Set
OPENAI_API_KEY for openai/ prefixed models and GOOGLE_API_KEY for Gemini models to avoid auth errors.Migrate existing Pydantic AI code
Migrate existing Pydantic AI code
Use
praisonai migrate ./your-app to preview conversion before applying with --apply.Related
Agno
Run agents YAML through Agno framework
Google ADK
Run agents YAML through Google Agent Development Kit
Code Migration
Migrate existing agent code to PraisonAI
Framework Adapter Plugins
All supported framework adapters

