Instructions, prompt templates and cloning
See three ways to tell an agent how to behave. A fixed string, a function that writes the instructions for each run, and a prompt stored on the OpenAI platform. Then copy an agent with clone() and learn what the copy shares.
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 in depth
- Instructions, prompt templates and cloningStatic or dynamic instructions, stored prompts and agent copies.Pro
- Output types and tool use behaviorTyped final output, forced tool calls and when a run stops.Pro
- Lifecycle hooksRun code when agents, tools and model calls start and end.Pro
- Context and RunContextWrapperPass your own data to tools and hooks without showing the model.Pro