Learning Map
1
Messages
Messages
Compress or delete messages to control which history enters the model context.
2
HITL
HITL
Add approve, reject and edit approval flows for high-risk tool calls.
3
Dynamic Models
Dynamic Models
Switch models based on conversation length or task complexity.
4
Dynamic Prompts
Dynamic Prompts
Generate different system prompts from runtime context.
5
Dynamic Tools
Dynamic Tools
Restrict tool visibility based on user role or authentication state.
Lesson Summary
1
3.2 Managing Messages
Open the explained page
Manage message history with SummarizationMiddleware and RemoveMessage.
- summary
- trim
- RemoveMessage
2
3.3 Human-in-the-loop
Open the explained page
Pause high-risk tools such as sending email for human approval.
- approve
- reject
- edit
3
3.4a Dynamic Models
Open the explained page
Use wrap_model_call to switch between a standard model and a larger model at runtime.
- model routing
- override
- metadata
4
3.4b Dynamic Prompts
Open the explained page
Generate system prompts dynamically from the user language context.
- dynamic_prompt
- context
- language
5
3.4c Dynamic Tools
Open the explained page
Use user_role to restrict external users to Web Search only.
- tool permissions
- role
- security
6
3.5 Email Agent
Open the explained page
Build an email Agent by combining authentication, dynamic tools, dynamic prompts and HITL.
- auth
- HITL
Completion Criteria
- Explain in your own words what problem each lesson in this module solves.
- Identify the key API in each example and where it fits in the Agent workflow.
- Apply this module's techniques to a new small Agent task.