> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorbit.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI

> تكوين إجراءات مخصصة في Gorbit مع OpenAPI

يمكنك إنشاء إجراءات مخصصة في Gorbit باستخدام مواصفات OpenAPI 3.0 أو 3.1 لواجهة API.
هذا يمكّن وكلاء الذكاء الاصطناعي الخاصين بك من التفاعل مع واجهات REST API وتشغيل سير العمل في الأنظمة الخارجية.

<Tip>
  ضمّن فقط نقاط النهاية التي تريد أن يستدعيها وكيلك في مواصفات OpenAPI.
  أزل أي نقاط نهاية لا تريد للوكيل الوصول إليها.
</Tip>

## إعداد الإجراءات المخصصة

<Steps>
  <Step title="انتقل إلى لوحة الإجراءات">
    انقر على أيقونة ملف المستخدم الخاص بك واختر **لوحة الإدارة**، ثم انقر على علامة تبويب **الإجراءات** في الشريط الجانبي.

    <img className="rounded-image" src="https://mintcdn.com/gorbit/i9pIrvFbh53KkrjR/assets/admins/actions/actions_overview.png?fit=max&auto=format&n=i9pIrvFbh53KkrjR&q=85&s=4767ca1a61da49c5c289958013a36b1f" alt="Actions dashboard in Gorbit Admin Panel" width="2760" height="1106" data-path="assets/admins/actions/actions_overview.png" />
  </Step>

  <Step title="إنشاء إجراء OpenAPI">
    انقر على **من مخطط OpenAPI** تحت **إنشاء إجراء**.

    الصق مواصفات OpenAPI الخاصة بك وقم بتكوين أي مصادقة أو رؤوس مطلوبة.

    <img className="rounded-image" src="https://mintcdn.com/gorbit/i9pIrvFbh53KkrjR/assets/admins/actions/openapi.png?fit=max&auto=format&n=i9pIrvFbh53KkrjR&q=85&s=6e0a2a54272c2f422814aac02a7fecc1" alt="Creating an OpenAPI action in Gorbit Admin Panel" width="2016" height="2078" data-path="assets/admins/actions/openapi.png" />
  </Step>
</Steps>

## مثال

يمكن استخدام مواصفات OpenAPI أدناه لإنشاء إجراء مخصص لجلب وإنشاء وكلاء في Gorbit.

```json OpenAPI expandable theme={null}
{
  "openapi": "3.1.0",
  "info": {
    "title": "Agents API",
    "version": "1.0.0",
    "description": "Minimal OpenAPI schema for creating and fetching agents in Gorbit"
  },
  "servers": [
    {
      "url": "https://cloud.gorbit.app/api"
    }
  ],
  "paths": {
    "/persona": {
      "post": {
        "summary": "Create Agent (Persona)",
        "operationId": "create_persona",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": { "type": "string" },
                  "description": { "type": "string" },
                  "document_set_ids": {
                    "type": "array",
                    "items": { "type": "integer" }
                  },
                  "num_chunks": { "type": "number" },
                  "is_public": { "type": "boolean" },
                  "recency_bias": {
                    "type": "string",
                    "enum": ["favor_recent", "base_decay", "no_decay", "auto"]
                  },
                  "llm_filter_extraction": { "type": "boolean" },
                  "llm_relevance_filter": { "type": "boolean" },
                  "tool_ids": {
                    "type": "array",
                    "items": { "type": "integer" }
                  },
                  "system_prompt": { "type": "string" },
                  "task_prompt": { "type": "string" },
                  "datetime_aware": { "type": "boolean" }
                },
                "required": [
                  "name",
                  "description",
                  "document_set_ids",
                  "num_chunks",
                  "is_public",
                  "recency_bias",
                  "llm_filter_extraction",
                  "llm_relevance_filter",
                  "tool_ids",
                  "system_prompt",
                  "task_prompt",
                  "datetime_aware"
                ]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Created" }
        }
      }
    },
    "/persona/{persona_id}": {
      "get": {
        "summary": "Get Agent (Persona) By ID",
        "operationId": "get_persona",
        "parameters": [
          {
            "name": "persona_id",
            "in": "path",
            "required": true,
            "schema": { "type": "integer" }
          }
        ],
        "responses": {
          "200": { "description": "OK" }
        }
      }
    }
  }
}
```
