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

# उदाहरण

> Tools, approvals, streaming और सीमित runs के लिए PHP patterns अपनाएँ।

## अनुमोदन के साथ डिप्लॉयमेंट

```php theme={null}
$deploy = new Tool(
    id: "deploy",
    description: "Deploy the selected release",
    requireApproval: true,
    execute: fn (array $input, $runtime) => $deployments->deploy($input)
);
```

Run के `waiting_for_human` में पहुँचने पर उसे सहेजें, फिर pending call ID से जुड़ा निर्णय देकर जारी रखें।

## टेक्स्ट स्ट्रीम करें

```php theme={null}
$stream = $agent->stream(input: $prompt, client: $client);
foreach ($stream->textStream() as $delta) { echo $delta; }
$result = $stream->getResult();
```

## स्वायत्त काम सीमित करें

Step, token, cost और duration limits मिलाएँ, ताकि उपयोगी काम मिलता रहने पर भी agent application budget से आगे न जाए।

पूरे contracts के लिए [टूल](./agent-sdk-tools.mdx), [स्थिति और अनुमोदन](./agent-sdk-state-and-approval.mdx) और [रोकने की शर्तें](./agent-sdk-stop-conditions.mdx) देखें।


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