What it builds
- ✓Researcher + Analyst agents in a sequential crew
- ✓Output constrained to a Pydantic CompetitorList model
- ✓One HTTP push lands the validated rows in a grid
- ✓Optional action column lets a human drive the next step
The key step
class Competitor(BaseModel):
company: str
url: str
pricing: str
summary: str
class CompetitorList(BaseModel):
competitors: List[Competitor]
analyse_task = Task(
description="Validate pricing + summary for each row.",
agent=analyst,
context=[research_task],
output_pydantic=CompetitorList, # ← typed contract
)
result = crew.kickoff(inputs={"category": "agent infrastructure"})
push_to_instadash([c.model_dump() for c in result.pydantic.competitors])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
crewaipythonpydantic
Full source on GitHub
README, runnable code, .env.example, dependencies — all in one folder.