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

# استخدام وثائق CometAPI مع LLMs

> استخدم CometAPI llms.txt و llms-full.txt مع مساعدين البرمجة، وأنظمة الاسترجاع، وطلبات model.

استخدم `llms.txt` عندما تحتاج إلى فهرس موجز لصفحات وثائق CometAPI. واستخدم `llms-full.txt` عندما تتمكن أداتك من استيعاب النص الكامل للوثائق لأغراض الاسترجاع، أو الإجابة عن الأسئلة، أو المساعدة البرمجية.

## جلب الفهرس الموجز

يقوم الطلب التالي بتنزيل فهرس CometAPI `llms.txt`:

```bash theme={null}
curl https://apidoc.cometapi.com/llms.txt
```

تبدأ الاستجابة بعنوان الوثائق وقائمة الصفحات المرتبطة:

```text theme={null}
# CometAPI Documentation

> CometAPI developer documentation for unified API access...

## Docs

- [Create a new API key](https://apidoc.cometapi.com/api/api-keys/create-api-key.md)
```

## جلب النص الكامل

يقوم الطلب التالي بتنزيل تصدير النص الكامل:

```bash theme={null}
curl https://apidoc.cometapi.com/llms-full.txt
```

تحتوي الاستجابة على محتوى الصفحات مجمّعًا حسب URL المصدر:

```text theme={null}
# Create a new API key
Source: https://apidoc.cometapi.com/api/api-keys/create-api-key

Create a new CometAPI API key for the authenticated account.
```

## إضافة الوثائق إلى مهمة استرجاع

يقوم مثال Python التالي بتنزيل النص الكامل وكتابته إلى ملف محلي من أجل الفهرسة:

```python theme={null}
from pathlib import Path

import requests

url = "https://apidoc.cometapi.com/llms-full.txt"
response = requests.get(url, timeout=60)
response.raise_for_status()

Path("cometapi-docs.txt").write_text(response.text, encoding="utf-8")
print(len(response.text))
```

النتيجة هي عدد الأحرف المحفوظة. هذا مجرد ناتج مثال؛ وستختلف قيمتك كلما تغيّرت الوثائق:

```text theme={null}
449946
```

## الأخطاء الشائعة

| الخطأ                          | الحل                                                                  |
| ------------------------------ | --------------------------------------------------------------------- |
| سياق الأداة صغير جدًا          | استخدم `llms.txt` أولاً، ثم اجلب فقط الصفحات المرتبطة ذات الصلة.      |
| النص الكامل كبير جدًا          | قسّم `llms-full.txt` إلى أجزاء حسب العنوان أو URL المصدر قبل الفهرسة. |
| ذاكرة تخزين محلية مؤقتة معطوبة | حدّث الملف أثناء مهمة مزامنة الوثائق الخاصة بك.                       |
| صفحة مفقودة في نتائج AI        | تأكد من أن الصفحة تظهر في التنقل وفي `llms.txt`.                      |

## روابط ذات صلة

* [الصفحة الرئيسية لوثائق CometAPI](/)
* [صفحة النماذج](/ar/overview/models)
* [دليل النماذج](https://www.cometapi.com/models/)
* [الأسعار](https://www.cometapi.com/pricing/)
* [البدء السريع لـ CometAPI](/ar/overview/quick-start)

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "TechArticle",
        "@id": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms",
        "headline": "كيف أستخدم وثائق CometAPI مع LLMs؟",
        "description": "استخدم CometAPI llms.txt و llms-full.txt مع مساعدين البرمجة، وأنظمة الاسترجاع، وطلبات model.",
        "url": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms",
        "author": {
          "@type": "Organization",
          "name": "CometAPI"
        },
        "publisher": {
          "@type": "Organization",
          "name": "CometAPI",
          "url": "https://www.cometapi.com"
        }
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "وثائق CometAPI",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "الأدلة",
            "item": "https://apidoc.cometapi.com/guides/use-cometapi-with-openai-sdk"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "كيف أستخدم وثائق CometAPI مع LLMs؟",
            "item": "https://apidoc.cometapi.com/guides/how-to-use-cometapi-docs-with-llms"
          }
        ]
      }
    ]
    }
    `}
</script>
