> ## 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 عملية للأدوات والموافقات والبث وعمليات التشغيل المحدودة.

## نشر يتطلب موافقة

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

احفظ عملية التشغيل المعادة عند دخولها `waiting_for_human`، ثم تابعها بقرار مرتبط بمعرّف الاستدعاء المعلّق.

## بث النص

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

## تقييد العمل المستقل

اجمع حدود الخطوات والرموز والتكلفة والمدة حتى لا يتجاوز الوكيل ميزانية التطبيق، حتى إذا واصل العثور على عمل مفيد.

للاطلاع على التفاصيل الكاملة، راجع [الأدوات](./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.