Week 1 every result was a plain string — you read it, maybe .strip().lower()'d it, and moved on. What changed the moment you passed result_type=Contact on Day 10?
result.output wasn't a string anymore. It was a Contact object — .name, .email right there as typed fields. I actually said out loud "the Pydantic model is a form the AI must fill out completely."
That framing holds across every pattern this week. Literal["high","medium","low"] is a multiple-choice form — three options, pick one. list[str] is a bullet-point form — return as many items as the text contains. result_type is always the contract between you and the LLM.
Day 13 was the one that made me pause. Summarise first, then classify the summary — two agents, each with its own result_type. The chain output is a clean label, not a paragraph about urgency.
And Day 14 extended that to three fields in one model. category, urgency, one_line_summary — you defined the form, the LLM filled it, .model_dump() handed you a dict ready for a dashboard or an email. Let's see what stuck.
Create a free account to get started. Paid plans unlock all tracks.
Week 1 every result was a plain string — you read it, maybe .strip().lower()'d it, and moved on. What changed the moment you passed result_type=Contact on Day 10?
result.output wasn't a string anymore. It was a Contact object — .name, .email right there as typed fields. I actually said out loud "the Pydantic model is a form the AI must fill out completely."
That framing holds across every pattern this week. Literal["high","medium","low"] is a multiple-choice form — three options, pick one. list[str] is a bullet-point form — return as many items as the text contains. result_type is always the contract between you and the LLM.
Day 13 was the one that made me pause. Summarise first, then classify the summary — two agents, each with its own result_type. The chain output is a clean label, not a paragraph about urgency.
And Day 14 extended that to three fields in one model. category, urgency, one_line_summary — you defined the form, the LLM filled it, .model_dump() handed you a dict ready for a dashboard or an email. Let's see what stuck.