Skip to content

Commit c30f069

Browse files
c121914yuctrlz526dreamer6680dreamer6680
authored
V4.9.11 feature (#4969)
* Feat: Images dataset collection (#4941) * New pic (#4858) * 更新数据集相关类型,添加图像文件ID和预览URL支持;优化数据集导入功能,新增图像数据集处理组件;修复部分国际化文本;更新文件上传逻辑以支持新功能。 * 与原先代码的差别 * 新增 V4.9.10 更新说明,支持 PG 设置`systemEnv.hnswMaxScanTuples`参数,优化 LLM stream 调用超时,修复全文检索多知识库排序问题。同时更新数据集索引,移除 datasetId 字段以简化查询。 * 更换成fileId_image逻辑,并增加训练队列匹配的逻辑 * 新增图片集合判断逻辑,优化预览URL生成流程,确保仅在数据集为图片集合时生成预览URL,并添加相关日志输出以便调试。 * Refactor Docker Compose configuration to comment out exposed ports for production environments, update image versions for pgvector, fastgpt, and mcp_server, and enhance Redis service with a health check. Additionally, standardize dataset collection labels in constants and improve internationalization strings across multiple languages. * Enhance TrainingStates component by adding internationalization support for the imageParse training mode and update defaultCounts to include imageParse mode in trainingDetail API. * Enhance dataset import context by adding additional steps for image dataset import process and improve internationalization strings for modal buttons in the useEditTitle hook. * Update DatasetImportContext to conditionally render MyStep component based on data source type, improving the import process for non-image datasets. * Refactor image dataset handling by improving internationalization strings, enhancing error messages, and streamlining the preview URL generation process. * 图片上传到新建的 dataset_collection_images 表,逻辑跟随更改 * 修改了除了controller的其他部分问题 * 把图片数据集的逻辑整合到controller里面 * 补充i18n * 补充i18n * resolve评论:主要是上传逻辑的更改和组件复用 * 图片名称的图标显示 * 修改编译报错的命名问题 * 删除不需要的collectionid部分 * 多余文件的处理和改动一个删除按钮 * 除了loading和统一的imageId,其他都resolve掉的 * 处理图标报错 * 复用了MyPhotoView并采用全部替换的方式将imageFileId变成imageId * 去除不必要文件修改 * 报错和字段修改 * 增加上传成功后删除临时文件的逻辑以及回退一些修改 * 删除path字段,将图片保存到gridfs内,并修改增删等操作的代码 * 修正编译错误 --------- Co-authored-by: archer <[email protected]> * perf: image dataset * feat: insert image * perf: image icon * fix: training state --------- Co-authored-by: Zhuangzai fa <[email protected]> * fix: ts (#4948) * Thirddatasetmd (#4942) * add thirddataset.md * fix thirddataset.md * fix * delete wrong png --------- Co-authored-by: dreamer6680 <[email protected]> * perf: api dataset code * perf: log * add secondary.tsx (#4946) * add secondary.tsx * fix --------- Co-authored-by: dreamer6680 <[email protected]> * perf: multiple menu * perf: i18n * feat: parse queue (#4960) * feat: parse queue * feat: sync parse queue * fix thirddataset.md (#4962) * fix thirddataset-4.png (#4963) * feat: Dataset template import (#4934) * 模版导入部分除了文档还没写 * 修复模版导入的 build 错误 * Document production * compress pictures * Change some constants to variables --------- Co-authored-by: Archer <[email protected]> * perf: template import * doc * llm pargraph * bocha tool * fix: del collection --------- Co-authored-by: Zhuangzai fa <[email protected]> Co-authored-by: dreamer6680 <[email protected]> Co-authored-by: dreamer6680 <[email protected]>
1 parent bb810a4 commit c30f069

File tree

198 files changed

+4927
-2283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+4927
-2283
lines changed
44.7 KB
Loading
Loading

docSite/assets/imgs/template/box.png

18.8 KB
Loading
72.4 KB
Loading
14 KB
Loading
73.7 KB
Loading
113 KB
Loading
162 KB
Loading
228 KB
Loading
63.6 KB
Loading
48.9 KB
Loading
38.5 KB
Loading
73.2 KB
Loading
61.9 KB
Loading
26.5 KB
Loading
29.4 KB
Loading
33.2 KB
Loading
206 KB
Loading
207 KB
Loading
188 KB
Loading
197 KB
Loading
159 KB
Loading
173 KB
Loading
103 KB
Loading
144 KB
Loading
6.03 KB
Loading
110 KB
Loading
140 KB
Loading

docSite/content/zh-cn/docs/development/openapi/dataset.md

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,15 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?
295295
| --- | --- | --- |
296296
| datasetId | 知识库ID ||
297297
| parentId: | 父级ID,不填则默认为根目录 | |
298-
| trainingType | 数据处理方式。chunk: 按文本长度进行分割;qa: 问答对提取 ||
299298
| customPdfParse | PDF增强解析。true: 开启PDF增强解析;不填则默认为false | |
299+
| trainingType | 数据处理方式。chunk: 按文本长度进行分割;qa: 问答对提取 ||
300+
| chunkTriggerType | 分块条件逻辑。minSize(默认): 大于 n 时分块;maxSize: 小于文件处理模型最大上下文时分块;forceChunk: 强制分块 | |
301+
| chunkTriggerMinSize | chunkTriggerType=minSize 时候填写,原文长度大于该值时候分块(默认 1000) | |
300302
| autoIndexes | 是否自动生成索引(仅商业版支持) | |
301303
| imageIndex | 是否自动生成图片索引(仅商业版支持) | |
302304
| chunkSettingMode | 分块参数模式。auto: 系统默认参数; custom: 手动指定参数 | |
303-
| chunkSplitMode | 分块拆分模式。size: 按长度拆分; char: 按字符拆分。chunkSettingMode=auto时不生效。 | |
305+
| chunkSplitMode | 分块拆分模式。paragraph:段落优先,再按长度分;size: 按长度拆分; char: 按字符拆分。chunkSettingMode=auto时不生效。 | |
306+
| paragraphChunkDeep | 最大段落深度(默认 5) | |
304307
| chunkSize | 分块大小,默认 1500。chunkSettingMode=auto时不生效。 | |
305308
| indexSize | 索引大小,默认 512,必须小于索引模型最大token。chunkSettingMode=auto时不生效。 | |
306309
| chunkSplitter | 自定义最高优先分割符号,除非超出文件处理最大上下文,否则不会进行进一步拆分。chunkSettingMode=auto时不生效。 | |
@@ -428,10 +431,7 @@ data 为集合的 ID。
428431
"data": {
429432
"collectionId": "65abcfab9d1448617cba5f0d",
430433
"results": {
431-
"insertLen": 5, // 分割成多少段
432-
"overToken": [],
433-
"repeat": [],
434-
"error": []
434+
"insertLen": 5 // 分割成多少段
435435
}
436436
}
437437
}
@@ -497,10 +497,7 @@ data 为集合的 ID。
497497
"data": {
498498
"collectionId": "65abd0ad9d1448617cba6031",
499499
"results": {
500-
"insertLen": 1,
501-
"overToken": [],
502-
"repeat": [],
503-
"error": []
500+
"insertLen": 1
504501
}
505502
}
506503
}
@@ -546,7 +543,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
546543
{{< tab tabName="响应示例" >}}
547544
{{< markdownify >}}
548545

549-
data 为集合的 ID
546+
由于解析文档是异步操作,此处不会返回插入的数量
550547

551548
```json
552549
{
@@ -556,10 +553,7 @@ data 为集合的 ID。
556553
"data": {
557554
"collectionId": "65abc044e4704bac793fbd81",
558555
"results": {
559-
"insertLen": 1,
560-
"overToken": [],
561-
"repeat": [],
562-
"error": []
556+
"insertLen": 0
563557
}
564558
}
565559
}
@@ -632,10 +626,7 @@ data 为集合的 ID。
632626
"data": {
633627
"collectionId": "65abc044e4704bac793fbd81",
634628
"results": {
635-
"insertLen": 1,
636-
"overToken": [],
637-
"repeat": [],
638-
"error": []
629+
"insertLen": 1
639630
}
640631
}
641632
}
@@ -702,10 +693,7 @@ data 为集合的 ID。
702693
"data": {
703694
"collectionId": "6646fcedfabd823cdc6de746",
704695
"results": {
705-
"insertLen": 1,
706-
"overToken": [],
707-
"repeat": [],
708-
"error": []
696+
"insertLen": 1
709697
}
710698
}
711699
}

docSite/content/zh-cn/docs/development/upgrading/491.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'V4.9.1'
2+
title: 'V4.9.1(包含升级脚本)'
33
description: 'FastGPT V4.9.1 更新说明'
44
icon: 'upgrade'
55
draft: false

docSite/content/zh-cn/docs/development/upgrading/4911.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,29 @@ toc: true
77
weight: 789
88
---
99

10+
## 执行升级脚本
11+
12+
该脚本仅需商业版用户执行。
13+
14+
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**
15+
16+
```bash
17+
curl --location --request POST 'https://{{host}}/api/admin/initv4911' \
18+
--header 'rootkey: {{rootkey}}' \
19+
--header 'Content-Type: application/json'
20+
```
21+
22+
**脚本功能**
23+
24+
1. 移动第三方知识库 API 配置。
1025

1126
## 🚀 新增内容
1227

13-
1. 工作流中增加节点搜索功能。
14-
2. 工作流中,子流程版本控制,可选择“保持最新版本”,无需手动更新。
28+
1. 商业版支持图片知识库。
29+
2. 工作流中增加节点搜索功能。
30+
3. 工作流中,子流程版本控制,可选择“保持最新版本”,无需手动更新。
31+
4. 增加更多审计操作日志。
32+
5. 知识库增加文档解析异步队列,导入文档时,无需等待文档解析完毕才进行导入。
1533

1634
## ⚙️ 优化
1735

@@ -22,4 +40,6 @@ weight: 789
2240
1. 工作流中,管理员声明的全局系统工具,无法进行版本管理。
2341
2. 工具调用节点前,有交互节点时,上下文异常。
2442
3. 修复备份导入,小于 1000 字时,无法分块问题。
25-
4. 自定义 PDF 解析,无法保存 base64 图片。
43+
4. 自定义 PDF 解析,无法保存 base64 图片。
44+
5. 非流请求,未进行 CITE 标记替换。
45+
6. Python 沙盒存在隐藏风险。

docSite/content/zh-cn/docs/development/upgrading/494.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'V4.9.4'
2+
title: 'V4.9.4(包含升级脚本)'
33
description: 'FastGPT V4.9.4 更新说明'
44
icon: 'upgrade'
55
draft: false
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: '模板导入'
3+
description: 'FastGPT 模板导入功能介绍和使用方式'
4+
icon: 'language'
5+
draft: false
6+
toc: true
7+
weight: 420
8+
---
9+
10+
11+
## 背景
12+
13+
FastGPT 提供了模板导入功能,让用户可以通过预设的 CSV 模板格式批量导入问答对数据。这种方式特别适合已经有结构化问答数据的用户,可以快速将数据导入到知识库中。
14+
15+
## 模板结构说明
16+
17+
模板采用 CSV 格式,包含以下列:
18+
19+
- q: 问题列,存放用户可能提出的问题
20+
- a: 答案列,存放对应问题的标准答案
21+
- indexes: 索引列,用于存放与该问题相关的索引
22+
23+
### 示例数据
24+
25+
```csv
26+
q,a,indexes
27+
"你是谁呀?","我呀,是 AI 小助手哟,专门在这儿随时准备着,陪你交流、为你答疑解惑,不管是学习上的知识探讨,生活里的小疑问,还是创意灵感的碰撞,我都能尽力参与,用我的 "知识大脑" 给你提供帮助和陪伴呢,就盼着能成为你互动交流、探索世界的好伙伴呀 。","1. 你是什么?\n2. 你能做什么?\n3. 你可以解答哪些方面的疑问?\n4. 你希望成为什么样的伙伴?\n5. 你如何提供帮助?"
28+
"你是什么?","我是 AI 小助手,专门随时准备陪用户交流、为用户答疑解惑,能参与学习上的知识探讨、生活里的小疑问以及创意灵感的碰撞,用 "知识大脑" 提供帮助和陪伴,希望成为用户互动交流、探索世界的好伙伴。","你是什么?"
29+
"你能做什么?","能陪用户交流、为用户答疑解惑,参与学习上的知识探讨、生活里的小疑问以及创意灵感的碰撞,用 "知识大脑" 提供帮助和陪伴。","你能做什么?"
30+
```
31+
32+
## 使用说明
33+
34+
### 1. 打开知识库,点击导入,选择模版导入
35+
36+
![](/imgs/template/import.png)
37+
38+
![](/imgs/template/box.png)
39+
40+
### 2. 下载模板
41+
42+
点击下载 CSV 模版,其中存在两个模式的内容
43+
44+
#### 常规模式的数据模版
45+
46+
![](/imgs/template/nomal.png)
47+
48+
对应 CSV 格式为
49+
50+
![](/imgs/template/nomal_data.png)
51+
52+
常规模式下,q为内容,a为空,indexes可多个
53+
54+
#### 问答对的数据模版
55+
56+
![](/imgs/template/Question-answer.png)
57+
58+
对应CSV格式为
59+
60+
![](/imgs/template/Question-answer_data.png)
61+
62+
问答对模式下,q为问题,a为答案,indexes即为索引部分
63+
64+
### 3. 填写数据
65+
66+
按照模板格式填写你的问答数据:
67+
- 每一行代表一个内容或者一个问答对
68+
- 问题(q)始终不为空
69+
- 在一行内,索引部分可往后继续添加
70+
71+
### 4. 导入限制
72+
73+
- 仅支持 CSV 格式文件
74+
- 单个文件大小限制为 100MB
75+
- 必须严格按照模板格式填写,否则可能导入失败
76+
- 每次只能导入一个文件
77+
78+
成功导入后如下:
79+
80+
![](/imgs/template/import_csv.png)
81+
82+
### 4. 注意事项
83+
84+
- 确保 CSV 文件使用 UTF-8 编码
85+
- 如果内容中包含逗号,请用双引号包裹整个内容
86+
- indexes 列的内容会被用作相关问题的索引,有助于提高检索准确性
87+
- 建议在导入大量数据前先测试少量数据
88+
89+
## 最佳实践
90+
91+
1. **数据准备**
92+
- 确保内容或者问答对的质量,答案应该清晰、准确
93+
- 为每个导入的添加合适的索引关键词
94+
- 避免重复的内容或者问答对
95+
96+
2. **格式检查**
97+
- 导入前检查 CSV 文件格式是否正确
98+
- 确保没有多余的空行或空格
99+
- 验证特殊字符是否正确转义
100+
101+
3. **分批导入**
102+
- 如果数据量较大,建议分批导入
103+
- 每批导入后验证数据的正确性
104+
105+
## 常见问题
106+
107+
Q: 为什么我的文件导入失败了?
108+
A: 请检查以下几点:
109+
- 文件格式是否为 CSV
110+
- 编码是否为 UTF-8
111+
- 是否严格按照模板格式填写
112+
- 文件大小是否超过限制
113+
114+
Q: 如何验证导入是否成功?
115+
A: 导入成功后,你可以:
116+
- 在知识库中搜索导入的问题
117+
- 通过对话测试回答的准确性
118+
- 查看知识库的数据统计

0 commit comments

Comments
 (0)