Model I/O
The two contract surfaces between your code and the model: tool schemas going in, structured data coming out. Both fail the same way β the model treats a contract as a suggestion.
Section headings are in place; content fills in as use cases touch each topic.
Input side: tool schemasβ
How tool definitions reach the model β type hints and docstrings auto-generated into JSON schemas, so ordinary functions become the API contract.
Dynamic tool loadingβ
Loading tools at runtime by capability or discovery instead of a fixed registry.
Output side: parsing model responsesβ
The parse fallback chain: strict parse β extract from decoration β degrade to a usable default. Written up in context in the Researcher Agent planner; to be generalized here.
Structured output enforcementβ
Pydantic validation, provider response_format schemas, and instructor β what each solves, what each can't, and when the parse chain remains necessary.
Used in: Researcher Agent β planner parse chain and the Pydantic trade-off discussion.