> ## 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.

# الخطوات الديناميكية

> غيّر التوجيه والتعليمات والأدوات وإعدادات أخذ العينات بين خطوات وكيل Ruby.

تعيد حقول الوكيل القابلة للاستدعاء حساب معلمات الطلب من حالة التشغيل الحالية قبل كل خطوة للنموذج.

```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."
  }
)
```

يمكن للأدوات الديناميكية وقيم أخذ العينات اتباع النمط نفسه. ويمكن للأداة تعيين `next_turn_params` لتعديل الطلب التالي مباشرةً فقط. وتظل هذه التجاوزات بعد نقطة الموافقة وتنتهي بعد الخطوة التالية.

استخدم الدوال القابلة للاستدعاء للسياسات التي ينبغي إعادة حسابها في كل خطوة. واستخدم `next_turn_params` لتمرير إعداد خاص بأداة.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.