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

# रोकने की शर्तें

> PHP एजेंट रन को steps, tokens, लागत, अवधि, tools या finish reason से सीमित करें।

मॉडल के जारी रखने के निर्णय से स्वतंत्र product budget लागू करने के लिए stop helper मिलाएँ।

```php theme={null}
$agent = AgentSdk::createAgent(new AgentDefinition(
    id: "bounded-research",
    model: "openai/gpt-5.4-nano",
    stopWhen: [
        AgentSdk::stepCountIs(12),
        AgentSdk::maxTokensUsed(40000),
        AgentSdk::maxCost(2.50),
        AgentSdk::maxDuration(120000),
    ]
));
```

SDK में tool-call और finish-reason conditions भी हैं। रन पूरा होने पर `$result->run->stopReason` और सामान्यीकृत usage देखकर ऐप budget stop और मॉडल के सामान्य finish में अंतर कर सकता है।

रुकना एक सीमित परिणाम है, अपने-आप exception नहीं। तय करें कि product किन stop reasons को सफल, retryable या user-visible मानेगा।


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