Use dynamic values when later model turns should respond to application context or earlier tool results. A value can be fixed or computed from the current turn.
Choose a model at runtime
The agent definition accepts dynamic model, models, instructions, temperature, maxOutputTokens, and topP values.
Update application context from a tool
Tools can store information for later turns with context.setContext():
Keep context small and serializable when a run may be persisted and continued later.
Override only the next turn
Use nextTurnParams when a tool should change the immediately following request without permanently changing the agent definition:
Next-turn values can change the model, instructions, temperature, maximum output tokens, top-p sampling, or available tools.
Last modified on July 26, 2026