Structured outputs
Ask an agent for data in a fixed shape and get back an object your code can use directly. Watch a shop order message become a typed OrderInfo object, and compare it with free text and with a plain JSON schema.
9 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 9 minutes.
Written from the official documentation
In this module: Agents and models
- Chat clients: OpenAI, Azure OpenAI and FoundryOne Agent class with a swappable chat client behind it.Pro
- Anthropic, Gemini, Bedrock and OllamaThe same agent on other clouds or on a local model.Pro
- Agent services: Foundry, Copilot and ClaudeWrapping agents that another service already runs.Pro
- Structured outputsGetting typed data back instead of free text.Pro
- Declarative agents in YAMLDefining an agent in YAML and loading it with AgentFactory.Pro
- Custom agentsWriting your own agent class on top of BaseAgent.Pro