> ## 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}
deploy = PhaseoAgentSdk.define_tool(
  id: "deploy",
  description: "Deploy the selected release",
  require_approval: true,
  execute: ->(input, runtime) { deployments.deploy(input) }
)
```

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

## بث النص

```ruby theme={null}
stream = agent.stream(input: prompt, client: client)
stream.text_stream.each { |delta| print delta }
result = stream.result
```

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

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

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