llms.txt。当你的工具可以摄取完整文档文本以用于检索、问答或编码辅助时,请使用 llms-full.txt。
获取紧凑索引
以下请求会下载 CometAPI 的llms.txt 索引:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
将 CometAPI llms.txt 和 llms-full.txt 用于编码助手、检索系统和模型 Prompt。
llms.txt。当你的工具可以摄取完整文档文本以用于检索、问答或编码辅助时,请使用 llms-full.txt。
llms.txt 索引:
curl https://apidoc.cometapi.com/llms.txt
# 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)
curl https://apidoc.cometapi.com/llms-full.txt
# 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.
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))
449946
| Error | Fix |
|---|---|
| 工具上下文太小 | 先使用 llms.txt,然后仅获取相关的链接页面。 |
| 完整文本过大 | 在建立索引之前,按标题或源 URL 对 llms-full.txt 进行分块。 |
| 本地缓存损坏 | 在你的文档同步任务期间刷新该文件。 |
| AI 结果中缺少页面 | 确认该页面出现在导航中,并且也在 llms.txt 中。 |