> ## 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 एजेंट रन को steps, tokens, लागत, अवधि, tools या finish reason से सीमित करें।

स्वायत्त काम को ऐप के budget के अंदर रखने के लिए stop helper मिलाएँ।

```ruby theme={null}
agent = PhaseoAgentSdk.create_agent(
  id: "bounded-research",
  model: "openai/gpt-5.4-nano",
  stop_when: [
    PhaseoAgentSdk.step_count_is(12),
    PhaseoAgentSdk.max_tokens_used(40_000),
    PhaseoAgentSdk.max_cost(2.50),
    PhaseoAgentSdk.max_duration(120_000)
  ]
)
```

tool-call और finish-reason conditions भी उपलब्ध हैं। पूरा होने के बाद `result.run.stop_reason` और सामान्यीकृत usage देखकर budget stop और मॉडल के सामान्य finish में अंतर करें।

रुकना एक सीमित परिणाम है, अपने-आप exception नहीं। तय करें कि किन कारणों को सफल माना जाए, फिर से आज़माया जाए या उपयोगकर्ता को दिखाया जाए।


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