Custom agents
Write your own agent class on top of BaseAgent. Watch a small canteen agent answer with no model at all, stream its reply word by word, and see what you must handle yourself when you leave the built-in Agent.
11 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 11 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