> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic turns

> Change routing, instructions, tools, and sampling settings between Ruby agent turns.

Callable agent fields recalculate request parameters from the current run state before each model turn.

```ruby theme={null}
agent = PhaseoAgentSdk.create_agent(
  id: "support-agent",
  model: ->(turn) {
    turn.run.step_count > 3 ? "openai/gpt-5.4" : "openai/gpt-5.4-nano"
  },
  instructions: ->(turn) {
    "Resolve the request using the current context."
  }
)
```

Dynamic tools and sampling values can follow the same pattern. A tool may set `next_turn_params` to change only the immediately following request. These overrides survive an approval checkpoint and expire after the next turn.

Use callables for policy that should be recomputed every turn. Use `next_turn_params` for a tool-specific handoff.
