feat: 优化 Knowledge 前端和需求文档

- 增强知识库前端交互
- 更新知识库 API 需求文档
- 添加 TODO 待办事项

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 23:02:21 +08:00
parent 4017c0e1df
commit 00eb23cf54
5 changed files with 161 additions and 40 deletions

View File

@@ -29,9 +29,16 @@ Content-Type: application/json
| - docling_url | String | 条件必填 | Docling 服务 URLengine=docling 时必填) |
| - enable_pdf | Boolean | 否 | 是否启用 PDF 解析(默认 true |
| - pandoc | Boolean | 否 | 是否启用 Pandoc默认 true |
| storage_config | Object | 否 | 存储配置(默认 local |
| - type | String | 是 | 存储类型local / minio / s3 |
| - endpoint | String | 否 | MinIO Endpoint如 minio:9000 |
| - access_key_id | String | 否 | MinIO Access Key ID |
| - secret_access_key | String | 否 | MinIO Secret Access Key |
| - bucket | String | 否 | MinIO Bucket 名称 |
**请求示例**
本地存储:
```json
{
"name": "产品文档知识库",
@@ -42,12 +49,14 @@ Content-Type: application/json
"engine": "markitdown",
"enable_pdf": true,
"pandoc": true
},
"storage_config": {
"type": "local"
}
}
```
使用 Docling
使用 Docling + MinIO
```json
{
"name": "产品文档知识库",
@@ -59,6 +68,13 @@ Content-Type: application/json
"docling_url": "http://localhost:8501",
"enable_pdf": true,
"pandoc": true
},
"storage_config": {
"type": "minio",
"endpoint": "localhost:9000",
"access_key_id": "minioadmin",
"secret_access_key": "minioadmin",
"bucket": "x-agents"
}
}
```
@@ -204,7 +220,10 @@ GET /api/knowledge/:id/documents
"data": [
{
"id": "doc_001",
"knowledge_base_id": "kb_001",
"name": "产品手册_v2.0.pdf",
"file_key": "abc123.pdf",
"file_url": "http://localhost:8082/files/abc123.pdf",
"file_size": 2516582,
"status": "parsed",
"chunk_count": 156,
@@ -334,6 +353,7 @@ GET /api/knowledge/:id/documents/:doc_id/preview
| llm_model_id | String | LLM 模型 ID |
| embedding_model_id | String | Embedding 模型 ID |
| parsing_config | JSON | 解析配置 |
| storage_config | JSON | 存储配置(包含 type, endpoint, access_key_id, secret_access_key, bucket |
| status | String | 状态active / inactive |
| document_count | Integer | 文档数量 |
| chunk_count | Integer | 切片数量 |
@@ -348,6 +368,7 @@ GET /api/knowledge/:id/documents/:doc_id/preview
| knowledge_base_id | String | 知识库 ID |
| name | String | 文档名称 |
| file_key | String | 文件存储 key |
| file_url | String | 文件访问 URL本地路径或 MinIO 预签名 URL |
| file_size | BigInteger | 文件大小 |
| status | String | 状态parsing / parsed / failed |
| chunk_count | Integer | 切片数量 |