# 📚 API 文档中心 > 本目录把各平台**官方 API 文档抓到本地**,供看板「📚 API 文档中心」页浏览, > 与 `config/capabilities.yaml` 的能力条目**互相跳转** —— 不用每次现抓。 --- ## 目录结构 ``` docs/api/ ├── README.md ← 本文件 ├── index.json ← 自动生成的索引(页面清单 + 原文 URL + 本地文件 + sha256) └── raw/ ├── qwen/ ← 千问AI平台(阿里 DashScope)官方文档(.md) └── kling/ ← 可灵 AI 官方文档 ``` ## 怎么更新 ```bash cd 05_tools/09_ave # 增量更新(已存在的跳过) ~/.workbuddy/binaries/python/envs/agent-os/bin/python3 scripts/tools/fetch_api_docs.py # 全量重抓 ... fetch_api_docs.py --force # 只看会抓哪些(不下载) ... fetch_api_docs.py --list # 只抓某个平台 ... fetch_api_docs.py --source qwen ... fetch_api_docs.py --source kling ``` 脚本位置:`scripts/tools/fetch_api_docs.py` ## 怎么加新平台 编辑脚本里的 `SOURCES` 列表,加一项即可: ```python { "id": "volcano", # 目录名 "name": "火山引擎(即梦 / Seedream)", "kind": "llms-txt", # 或 "explicit" "index": "https://.../llms.txt", # llms-txt 模式:索引地址 "base": "https://.../", # 相对链接的 base "include_paths": ["image", "video"], # 只抓这些路径 "exclude_paths": ["text-generation"], # 排除这些 } ``` `kind="explicit"` 时改为 `"pages": [("slug", "标题"), ...]` 显式登记。 ## 各平台文档入口(原始地址,便于人工核对) | 平台 | 文档入口 | 抓取方式 | |:--|:--|:--| | 千问AI平台(阿里) | https://platform.qianwenai.com/docs/ | `llms.txt` 自动发现 | | 可灵 AI | https://app.klingai.com/cn/dev/document-api/ | 显式登记(单页应用) | | 火山引擎(待加) | — | — | > 💡 千问AI平台提供 `llms.txt`(专给 AI 读的索引)与 `llms-full.txt`(全量), > 是目前最好抓的源。其它平台若也有类似索引,优先用它。 ## 与能力清单的关联 `config/capabilities.yaml` 里每个能力可加一个字段指向本文档: ```yaml - id: text_to_image ... docs: - qwen: api-reference/image-generation/wan27-image-gen-edit/create-task - kling: imageGeneration ``` 看板「⚙️ 能力配置」页据此显示「📖 查看官方文档 →」链接,跳到本文档中心对应页。