Back to prompt library
Pydantic AI Agent Setup
Linked challenge: Pydantic AI Type-Safe Reinsurance Broker Matching Engine
Prompt source
implementation10 lines4 sectionsNo variables0 checklist items
from pydantic import BaseModel, Field
from pydantic_ai import Agent
class TreatyRecommendation(BaseModel):
treaty_type: str
attachment_point: float
limit: float
estimated_rate_on_line: float
reinsurer_panel: list[str]
agent = Agent('openai:gpt-4o', result_type=TreatyRecommendation)
# Run agent on primary insurer submission...