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

# الاستخدام

> شغّل حلقات الأدوات والمراجعة البشرية وإعادة المحاولة والوكلاء القابلين للاستئناف باستخدام Agent SDK لـ Ruby.

## إعداد بيئة التشغيل

لم تُنشر حزمة Agent SDK على RubyGems بعد. اتبع [تعليمات التثبيت من المصدر](./agent-sdk-installation.mdx).

## البدء السريع

```ruby theme={null}
require "phaseo_agent_sdk"

agent = PhaseoAgentSdk.create_agent(
  id: "quickstart-agent",
  model: "openai/gpt-5.4-nano",
  instructions: "Answer concisely and helpfully."
)

result = agent.run(
  input: "Give me one fun fact about cURL.",
  client: PhaseoAgentSdk.create_gateway_agent_client
)

puts result.output
```

## ما الذي توفره

* `PhaseoAgentSdk.create_agent(...)`
* `PhaseoAgentSdk.define_tool(...)`
* `PhaseoAgentSdk.create_gateway_agent_client(...)`
* حلقة أدوات محدودة فوق واجهة `responses` في Phaseo

## بيئة تشغيل متقدمة

يدعم Ruby وظائف التحقق والموافقة وأدوات HITL واليدوية والتقدم والأخطاء القابلة للتعافي والمكررات القابلة لإعادة التشغيل ومساعدات الإيقاف والجولات الديناميكية ومعلمات الجولة التالية المحفوظة والاستخدام/التكلفة الموحّدين وأدوات الوصول إلى الحالة ذات الأنواع المرنة.

## البث والإلغاء

يستهلك `Agent#stream(...)` و`Agent#continue_stream(...)` تدفق Responses SSE من البوابة في خيط عامل. استخدم `text_stream` أو `reasoning_stream` أو `item_stream` أو `full_stream`؛ واستدعِ `cancel` لإيقاف العامل وإغلاق تدفق HTTP. تحتفظ الخطوات المكتملة بمعرّفات الطلب وبيانات المزوّد الوصفية وأسباب الإنهاء والتحذيرات والاستخدام والتكلفة.

## مواضيع ذات صلة

* [نظرة عامة على Agent SDK](../agent-sdk/overview.mdx)
* [Agent SDK de TypeScript](../typescript/agent-sdk.mdx)


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