What it builds
- ✓A Lead Pydantic model with 5 typed fields
- ✓PydanticAI agent with result_type=LeadList
- ✓Grid created with a select action column (outreach status)
- ✓Real CRM-lite UX in zero lines of frontend code
The key step
class Lead(BaseModel):
company: str
domain: str
industry: str
size: str
why_fit: str
agent = Agent(
"anthropic:claude-opus-4-7",
result_type=LeadList,
system_prompt="Generate 8 high-fit example companies for the ICP.",
)
result = agent.run_sync(icp)
push_to_instadash([l.model_dump() for l in result.data.leads])note ▸
This is the core of the recipe. The full file (including setup, error handling, and the surrounding scaffolding) lives in the GitHub folder linked below — clone or copy it directly.
Run it
Stack
pydantic-aipythonanthropic
Full source on GitHub
README, runnable code, .env.example, dependencies — all in one folder.