feat: 新增 QMDSearch Agent Skill 包与下载入口

- 新增 skills/qmdsearch-agent(SKILL.md + references/api-examples.md),文档化
  AI Agent 鉴权、文本/文件上传入库(异步轮询)与分层检索调用方式
- 打包 QMDSearch-Agent-Skill.zip 至 app/static/agent-skill/
- 后端新增 GET /agent-skill 免登录下载路由(随 ./app 卷挂载,restart 即生效)
- 前端 API 说明页新增「AI Agent Skill 下载」卡片,链接至 /agent-skill
This commit is contained in:
2026-08-01 00:11:05 +08:00
parent 6ae91679e2
commit 83eb8d0dd0
5 changed files with 360 additions and 1 deletions
+18
View File
@@ -144,3 +144,21 @@ async def admin_spa(rest: str):
return FileResponse(file_path)
# SPA 客户端路由兜底
return FileResponse(spa_dir / "index.html", media_type="text/html")
# AI Agent Skill 压缩包(用于 Agent 上传文档与检索),随 ./app 卷挂载,restart 即生效
_AGENT_SKILL_ZIP = _STATIC_DIR / "agent-skill" / "QMDSearch-Agent-Skill.zip"
@app.get("/agent-skill", include_in_schema=False)
async def agent_skill_download() -> FileResponse | JSONResponse:
"""下载 AI Agent Skill 压缩包(qmdsearch-agent skill,含 SKILL.md 与示例)"""
if not _AGENT_SKILL_ZIP.is_file():
return JSONResponse(
status_code=404, content={"code": 1002, "message": "Skill 包不存在"}
)
return FileResponse(
_AGENT_SKILL_ZIP,
media_type="application/zip",
filename="QMDSearch-Agent-Skill.zip",
)
Binary file not shown.