feat: add compact toolbox and public wiki vector search
This commit is contained in:
1 parent
9f29ecae9e
commit
d35d075669
29 files changed
+757
-128
No files matched your search
@@ -1132,6 +1132,35 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
#### 13.4.1 免鉴权浏览器向量搜索
|
||||
|
||||
本部署另行提供一个与上述 API-Key 命名空间隔离的新接口:
|
||||
|
||||
```http
|
||||
POST /api/knowledge/vector-search
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
最小请求只需检索词:
|
||||
|
||||
```json
|
||||
{"query": "任正非早期创业经历"}
|
||||
```
|
||||
|
||||
可选参数只有 `top_k`(默认 `10`,最大 `100`)和
|
||||
`include_page_content`(默认 `false`)。接口不需要登录 Token 或
|
||||
`X-API-Key`,不做应用内限流,并针对这一条路由返回
|
||||
`Access-Control-Allow-Origin: *`。检索范围是全部 `published` 知识库,
|
||||
不检查 `external_search_enabled`,但在检索前后都排除系统“对话沉淀”库。
|
||||
|
||||
响应按向量分段展开:同一 Wiki 页命中多个分段时会返回多条结果。每条结果
|
||||
包含命中文本和分数、DeerFlow/WeKnora 知识库与 Wiki 页 ID、页面元数据、
|
||||
原始 `source_refs`/`chunk_refs`、可提取到的文档/分块 ID,以及可直接打开的
|
||||
`wiki_url`。当 `include_page_content=true` 时额外返回完整 `page_content`。
|
||||
`wiki_url` 的前缀配置为
|
||||
`llmwiki.local_wiki_index.frontend_base_url`,开发默认值是
|
||||
`http://127.0.0.1:5174`。
|
||||
|
||||
### 13.5 外部页面详情
|
||||
|
||||
```http
|
||||
@@ -1156,6 +1185,9 @@ X-API-Key: <external key>
|
||||
|
||||
如果为了少改 AuthMiddleware 而把接口挂到 `/api/public/`,路由自身也必须强制校验 API Key;但长期推荐独立 `/api/external/` 语义。
|
||||
|
||||
上面的原则仍适用于通用服务间接口;13.4.1 是经过明确产品确认的例外,并通过
|
||||
精确路径白名单和路由级 CORS 隔离,不能据此放宽其他 API。
|
||||
|
||||
### 13.7 状态码约定
|
||||
|
||||
| 状态码 | 场景 |
|
||||
|
||||
Reference in new issue
Block a user