Free-form text is easy for people to read and hard for code to use. To build a real product, your application needs answers in a shape it can rely on, and it often needs the model to do something instead of just talking. This module covers both: structured outputs and tool use.
It starts with getting reliable JSON from a model by describing the shape you want with a schema, then validating the result with a library such as Pydantic. It then moves to function calling, where the model decides when to call a function you wrote and with which arguments, and your code runs it and returns the result.
Watch the lessons in order, then continue on to Retrieval & RAG.
A talk on turning model output into typed objects: Pydantic models as the contract, OpenAI function calling, the Instructor library, and validation with retries.
Defining a JSON schema with Pydantic and using an output parser so the model returns data that matches it.
A practical walkthrough of tool calling in Python: describing a function to the model and letting it decide when to use it.
Building AI agents that call Python functions dynamically using the function tool decorator.