Adjust model parameters turn-by-turn based on what the agent has seen so far.
Not yet available. The Agent SDK is tracked to be built — today, use the Client SDKs against the live chat completions API. The docs below describe the intended design.
Static parameters — a fixed temperature, a single model slug — work for most loops. Dynamic parameters let you compute them fresh each turn based on the current item list, so the agent can adapt as it runs.
dynamicParams function#Pass a function to callModel() under dynamicParams. The SDK calls it with the current item list immediately before each turn and merges the returned values into the call parameters.
Return a new model slug from dynamicParams to route different turns to different models — for example, use a cheaper model for tool-heavy exploration turns and a more capable one for final synthesis.
Return a different tools array to expose or hide tools as the loop progresses — restricting tools when the agent should focus on outputting a result rather than making more calls.
The function may return any subset of CallModelParams. These fields are merged on top of the static parameters you passed to callModel():
modeltoolstemperaturetopPmaxTokensstreamstopConditionsYou cannot change messages or inputItems via dynamicParams — those are set once per callModel() call.
Dynamic stop conditions (returned from dynamicParams) are merged with any static stop conditions you declared. The loop stops as soon as any condition is met.
callModel() API.