Skip to content

Commit 10d8c56

Browse files
c121914yuI-InfoFinleyGenewfish-cmykJiangween
authored
V4.8.18 feature (labring#3565)
* feat: org CRUD (labring#3380) * feat: add org schema * feat: org manage UI * feat: OrgInfoModal * feat: org tree view * feat: org management * fix: init root org * feat: org permission for app * feat: org support for dataset * fix: disable org role control * styles: opt type signatures * fix: remove unused permission * feat: delete org collaborator * perf: Team org ui (labring#3499) * perf: org ui * perf: org ui * feat: org auth for app & dataset (labring#3498) * feat: auth org resource permission * feat: org auth support for app & dataset * perf: org permission check (labring#3500) * i18n (labring#3501) * name * i18n * feat: support dataset changeOwner (labring#3483) * feat: support dataset changeOwner * chore: update dataset change owner api * feat: permission manage UI for org (labring#3503) * perf: password check;perf: image upload check;perf: sso login check (labring#3509) * perf: password check * perf: image upload check * perf: sso login check * force show update notification modal & fix login page text (labring#3512) * fix login page English text * update notification modal * perf: notify account (labring#3515) * perf(plugin): improve searXNG empty result handling and documentation (labring#3507) * perf(plugin): improve searXNG empty result handling and documentation * 修改了文档和代码部分无搜索的结果的反馈 * refactor: org pathId (labring#3516) * optimize payment process (labring#3517) * feat: support wecom sso (labring#3518) * feat: support wecom sso * chore: remove unused wecom js-sdk dependency * fix qrcode script (labring#3520) * fix qrcode script * i18n * perf: full text collection and search code;perf: rename function (labring#3519) * perf: full text collection and search code * perf: rename function * perf: notify modal * remove invalid code * perf: sso login * perf: pay process * 4.8.18 test (labring#3524) * perf: remove local token * perf: index * perf: file encoding;perf: leave team code;@c121914yu perf: full text search code (labring#3528) * perf: text encoding * perf: leave team code * perf: full text search code * fix: http status * perf: embedding search and vector avatar * perf: async read file (labring#3531) * refactor: team permission manager (labring#3535) * perf: classify org, group and member * refactor: team per manager * fix: missing functions * 4.8.18 test (labring#3543) * perf: login check * doc * perf: llm model config * perf: team clb config * fix: MemberModal UI (labring#3553) * fix: adapt MemberModal title and icon * fix: adapt member modal * fix: search input placeholder * fix: add button text * perf: org permission (labring#3556) * docs:用户答疑的官方文档补充 (labring#3540) * docs:用户答疑的官方文档补充 * 问题回答的内容修补 * share link random avatar (labring#3541) * share link random avatar * fix * delete unused code * share page avatar (labring#3558) * feat: init 4818 * share page avatar * feat: tmp upgrade code (labring#3559) * feat: tmp upgrade code * fulltext search test * update action * full text tmp code (labring#3561) * full text tmp code * fix: init * fix: init * remove tmp code * remove tmp code * 4818-alpha * 4.8.18 test (labring#3562) * full text tmp code * fix: init * upgrade code * account log * account log * perf: dockerfile * upgrade code * chore: update docs app template submission (labring#3564) --------- Co-authored-by: a.e. <[email protected]> Co-authored-by: Finley Ge <[email protected]> Co-authored-by: heheer <[email protected]> Co-authored-by: Jiangween <[email protected]>
1 parent bb669ca commit 10d8c56

File tree

205 files changed

+5299
-2422
lines changed

Some content is hidden

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

205 files changed

+5299
-2422
lines changed

.github/workflows/preview-fastgpt-image.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ jobs:
3636
password: ${{ secrets.GH_PAT }}
3737
- name: Set DOCKER_REPO_TAGGED based on branch or tag
3838
run: |
39-
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.number }}" >> $GITHUB_ENV
39+
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
4040
- name: Build image for PR
4141
env:
4242
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
4343
run: |
4444
docker buildx build \
4545
-f projects/app/Dockerfile \
4646
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
47-
--label "org.opencontainers.image.description=fastgpt-pr imae" \
47+
--label "org.opencontainers.image.description=fastgpt-pr image" \
4848
--label "org.opencontainers.image.licenses=Apache" \
4949
--push \
5050
--cache-from=type=local,src=/tmp/.buildx-cache \

dev.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Premise
22

3-
Since FastGPT is managed in the same way as monorepo, it is recommended to install 'make' first during development.
3+
Since FastGPT is managed in the same way as monorepo, it is recommended to install make first during development.
44

55
monorepo Project Name:
66

docSite/assets/imgs/dataset1.png

80.7 KB
Loading

docSite/assets/imgs/dataset2.png

129 KB
Loading
22.2 KB
Loading

docSite/content/zh-cn/docs/development/faq.md

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ images: []
1919

2020
## 二、通用问题
2121

22+
### 本地部署的限制
23+
24+
具体内容参考https://fael3z0zfze.feishu.cn/wiki/OFpAw8XzAi36Guk8dfucrCKUnjg。
25+
2226
### 能否纯本地运行
2327

2428
可以。需要准备好向量模型和LLM模型。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: 'V4.8.18(进行中)'
3+
description: 'FastGPT V4.8.18 更新说明'
4+
icon: 'upgrade'
5+
draft: false
6+
toc: true
7+
weight: 806
8+
---
9+
10+
## 更新指南
11+
12+
### 2. 运行升级脚本
13+
14+
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**
15+
16+
```bash
17+
curl --location --request POST 'https://{{host}}/api/admin/initv4818' \
18+
--header 'rootkey: {{rootkey}}' \
19+
--header 'Content-Type: application/json'
20+
```
21+
22+
会迁移全文检索表,时间较长,迁移期间全文检索会失效,日志中会打印已经迁移的数据长度。
23+
24+
25+
## 完整更新内容
26+
27+
1. 新增 - 支持部门架构权限模式。
28+
2. 新增 - 支持配置自定跨域安全策略,默认全开。
29+
3. 优化 - 分享链接随机生成用户头像。
30+
4. 优化 - 图片上传安全校验。并增加头像图片唯一存储,确保不会累计存储。
31+
5. 优化 - Mongo 全文索引表分离。
32+
6. 优化 - 知识库检索查询语句合并,同时减少查库数量。
33+
7. 优化 - 文件编码检测,减少 CSV 文件乱码概率。
34+
8. 优化 - 异步读取文件内容,减少进程阻塞。
35+
9. 优化 - 文件阅读,HTML 直接下载,不允许在线阅读。
36+
10. 修复 - HTML 文件上传,base64 图片无法自动转图片链接。
37+
11. 修复 - 插件计费错误。

docSite/content/zh-cn/docs/faq/app.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ weight: 908
1313

1414
但是,当连续问题之间的关联性较小,模型判断的准确度可能会受到限制。在这种情况下,我们可以引入全局变量的概念来记录分类结果。在后续的问题分类阶段,首先检查全局变量是否存有分类结果。如果有,那么直接沿用该结果;若没有,则让模型自行判断。
1515

16-
建议:构建批量运行脚本进行测试,评估问题分类的准确性。
16+
建议:构建批量运行脚本进行测试,评估问题分类的准确性。
17+
18+
## 系统编排配置中的定时执行,如果用户打开分享的连接,停留在那个页面,定时执行触发问题
19+
20+
发布后,后台生效。
21+
22+
## AI对话回答要求中的Markdown语法取消
23+
24+
在针对知识库的回答要求里有, 要给它配置提示词,不然他就是默认的,默认的里面就有该语法。

docSite/content/zh-cn/docs/faq/dataset.md

+48-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,51 @@ weight: 910
1414
## 知识库配置里的文件处理模型是什么?与索引模型有什么区别?
1515

1616
* **文件处理模型**:用于数据处理的【增强处理】和【问答拆分】。在【增强处理】中,生成相关问题和摘要,在【问答拆分】中执行问答对生成。
17-
* **索引模型**:用于向量化,即通过对文本数据进行处理和组织,构建出一个能够快速查询的数据结构。
17+
* **索引模型**:用于向量化,即通过对文本数据进行处理和组织,构建出一个能够快速查询的数据结构。
18+
19+
## 基于知识库的查询,但是问题相关的答案过多。ai回答到一半就不继续回答。
20+
21+
FastGPT回复长度计算公式:
22+
23+
最大回复=min(配置的最大回复(内置的限制),最大上下文(输入和输出的总和)-历史记录)
24+
25+
18K模型->输入与输出的和
26+
27+
输出增多->输入减小
28+
29+
所以可以:
30+
31+
1. 检查配置的最大回复(回复上限)
32+
2. 减小输入来增大输出,即减小历史记录,在工作流其实也就是“聊天记录”
33+
34+
配置的最大回复:
35+
36+
![](/imgs/dataset1.png)
37+
38+
![](/imgs/dataset2.png)
39+
40+
1. 私有化部署的时候,后台配模型参数,可以在配置最大上文时候,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出
41+
42+
43+
## 受到模型上下文的限制,有时候达不到聊天记录的轮次,连续对话字数过多就会报上下文不够的错误。
44+
45+
FastGPT回复长度计算公式:
46+
47+
最大回复=min(配置的最大回复(内置的限制),最大上下文(输入和输出的总和)-历史记录)
48+
49+
18K模型->输入与输出的和
50+
51+
输出增多->输入减小
52+
53+
所以可以:
54+
55+
1. 检查配置的最大回复(回复上限)
56+
2. 减小输入来增大输出,即减小历史记录,在工作流其实也就是“聊天记录”
57+
58+
配置的最大回复:
59+
60+
![](/imgs/dataset1.png)
61+
62+
![](/imgs/dataset2.png)
63+
64+
1. 私有化部署的时候,后台配模型参数,可以在配置最大上文时候,预留一些空间,比如 128000 的模型,可以只配置 120000, 剩余的空间后续会被安排给输出

docSite/content/zh-cn/docs/guide/plugins/searxng_plugin_guide.md

+12
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ default_doi_resolver: 'oadoi.org'
160160
}
161161
```
162162

163+
* 搜索结果为空时会返回友好提示:
164+
165+
```Bash
166+
{
167+
"result": "[]",
168+
"error": {
169+
"message": "No search results",
170+
"code": 500
171+
}
172+
}
173+
```
174+
163175
* 失败时通过 Promise.reject 可能返回错误信息:
164176

165177
```Bash

docSite/content/zh-cn/docs/use-cases/app-cases/submit_application_template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ weight: 602
3232

3333
1. ### 创建应用模板
3434

35-
应用模板配置以及相关资源,都会在 **projects/app/public/appMarketTemplates** 目录下。
35+
应用模板配置以及相关资源,都会在 **packages/templates/src** 目录下。
3636

3737
![](/imgs/template_submission2.png)
3838

39-
1. **projects/app/public/appMarketTemplates** 目录下,创建一个文件夹,名称为模板对应的 id。
39+
1.**packages/templates/src** 目录下,创建一个文件夹,名称为模板对应的 id。
4040
2. 在刚刚创建的文件夹中,再创建一个 **template.json** 文件,复制粘贴并填写如下配置:
4141

4242
```JSON
@@ -83,4 +83,4 @@ weight: 602
8383

8484
- 写清楚模板的介绍和功能
8585
- 配上模板运行的效果图
86-
- 模板参数填写说明,需要在 PR 中写清楚。例如,有些模板需要去某个提供商申请 key,需要附上对应的地址和教程,后续我们会加入到文档中。
86+
- 模板参数填写说明,需要在 PR 中写清楚。例如,有些模板需要去某个提供商申请 key,需要附上对应的地址和教程,后续我们会加入到文档中。

packages/global/common/error/code/common.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
import { i18nT } from '../../../../web/i18n/utils';
12
import { ErrType } from '../errorCode';
23

34
/* dataset: 507000 */
45
const startCode = 507000;
56
export enum CommonErrEnum {
7+
invalidParams = 'invalidParams',
68
fileNotFound = 'fileNotFound',
79
unAuthFile = 'unAuthFile',
810
missingParams = 'missingParams',
911
inheritPermissionError = 'inheritPermissionError'
1012
}
1113
const datasetErr = [
14+
{
15+
statusText: CommonErrEnum.fileNotFound,
16+
message: i18nT('common:error.invalid_params')
17+
},
1218
{
1319
statusText: CommonErrEnum.fileNotFound,
1420
message: 'error.fileNotFound'

packages/global/common/error/code/team.ts

+42-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { ErrType } from '../errorCode';
21
import { i18nT } from '../../../../web/i18n/utils';
2+
import type { ErrType } from '../errorCode';
33
/* team: 500000 */
44
export enum TeamErrEnum {
5+
notUser = 'notUser',
56
teamOverSize = 'teamOverSize',
67
unAuthTeam = 'unAuthTeam',
8+
teamMemberOverSize = 'teamMemberOverSize',
79
aiPointsNotEnough = 'aiPointsNotEnough',
810
datasetSizeNotEnough = 'datasetSizeNotEnough',
911
datasetAmountNotEnough = 'datasetAmountNotEnough',
@@ -14,11 +16,22 @@ export enum TeamErrEnum {
1416
groupNameEmpty = 'groupNameEmpty',
1517
groupNameDuplicate = 'groupNameDuplicate',
1618
groupNotExist = 'groupNotExist',
19+
orgMemberNotExist = 'orgMemberNotExist',
20+
orgMemberDuplicated = 'orgMemberDuplicated',
21+
orgNotExist = 'orgNotExist',
22+
orgParentNotExist = 'orgParentNotExist',
23+
cannotMoveToSubPath = 'cannotMoveToSubPath',
24+
cannotModifyRootOrg = 'cannotModifyRootOrg',
25+
cannotDeleteNonEmptyOrg = 'cannotDeleteNonEmptyOrg',
1726
cannotDeleteDefaultGroup = 'cannotDeleteDefaultGroup',
1827
userNotActive = 'userNotActive'
1928
}
2029

2130
const teamErr = [
31+
{
32+
statusText: TeamErrEnum.notUser,
33+
message: i18nT('common:code_error.team_error.not_user')
34+
},
2235
{
2336
statusText: TeamErrEnum.teamOverSize,
2437
message: i18nT('common:code_error.team_error.over_size')
@@ -71,6 +84,34 @@ const teamErr = [
7184
{
7285
statusText: TeamErrEnum.userNotActive,
7386
message: i18nT('common:code_error.team_error.user_not_active')
87+
},
88+
{
89+
statusText: TeamErrEnum.orgMemberNotExist,
90+
message: i18nT('common:code_error.team_error.org_member_not_exist')
91+
},
92+
{
93+
statusText: TeamErrEnum.orgMemberDuplicated,
94+
message: i18nT('common:code_error.team_error.org_member_duplicated')
95+
},
96+
{
97+
statusText: TeamErrEnum.orgNotExist,
98+
message: i18nT('common:code_error.team_error.org_not_exist')
99+
},
100+
{
101+
statusText: TeamErrEnum.orgParentNotExist,
102+
message: i18nT('common:code_error.team_error.org_parent_not_exist')
103+
},
104+
{
105+
statusText: TeamErrEnum.cannotMoveToSubPath,
106+
message: i18nT('common:code_error.team_error.cannot_move_to_sub_path')
107+
},
108+
{
109+
statusText: TeamErrEnum.cannotModifyRootOrg,
110+
message: i18nT('common:code_error.team_error.cannot_modify_root_org')
111+
},
112+
{
113+
statusText: TeamErrEnum.cannotDeleteNonEmptyOrg,
114+
message: i18nT('common:code_error.team_error.cannot_delete_non_empty_org')
74115
}
75116
];
76117

packages/global/common/error/code/user.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@ import { ErrType } from '../errorCode';
22
import { i18nT } from '../../../../web/i18n/utils';
33
/* team: 503000 */
44
export enum UserErrEnum {
5-
unAuthUser = 'unAuthUser',
65
unAuthRole = 'unAuthRole',
7-
binVisitor = 'binVisitor',
6+
account_psw_error = 'account_psw_error',
87
balanceNotEnough = 'balanceNotEnough',
98
unAuthSso = 'unAuthSso'
109
}
1110
const errList = [
1211
{
13-
statusText: UserErrEnum.unAuthUser,
14-
message: i18nT('common:code_error.user_error.un_auth_user')
12+
statusText: UserErrEnum.account_psw_error,
13+
message: i18nT('common:code_error.account_error')
1514
},
16-
{
17-
statusText: UserErrEnum.binVisitor,
18-
message: i18nT('common:code_error.user_error.bin_visitor')
19-
}, // 身份校验未通过
20-
{
21-
statusText: UserErrEnum.binVisitor,
22-
message: i18nT('common:code_error.user_error.bin_visitor_guest')
23-
}, // 游客身份
2415
{
2516
statusText: UserErrEnum.balanceNotEnough,
2617
message: i18nT('common:code_error.user_error.balance_not_enough')

packages/global/common/file/api.d.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { MongoImageTypeEnum } from './image/constants';
21
import { OutLinkChatAuthProps } from '../../support/permission/chat.d';
32

43
export type preUploadImgProps = OutLinkChatAuthProps & {
5-
type: `${MongoImageTypeEnum}`;
6-
7-
expiredTime?: Date;
4+
// expiredTime?: Date;
85
metadata?: Record<string, any>;
96
};
107
export type UploadImgProps = preUploadImgProps & {

packages/global/common/file/image/constants.ts

-56
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,5 @@
11
export const imageBaseUrl = '/api/system/img/';
22

3-
export enum MongoImageTypeEnum {
4-
systemAvatar = 'systemAvatar',
5-
appAvatar = 'appAvatar',
6-
pluginAvatar = 'pluginAvatar',
7-
datasetAvatar = 'datasetAvatar',
8-
userAvatar = 'userAvatar',
9-
teamAvatar = 'teamAvatar',
10-
groupAvatar = 'groupAvatar',
11-
12-
chatImage = 'chatImage',
13-
collectionImage = 'collectionImage'
14-
}
15-
export const mongoImageTypeMap = {
16-
[MongoImageTypeEnum.systemAvatar]: {
17-
label: 'appAvatar',
18-
unique: true
19-
},
20-
[MongoImageTypeEnum.appAvatar]: {
21-
label: 'appAvatar',
22-
unique: true
23-
},
24-
[MongoImageTypeEnum.pluginAvatar]: {
25-
label: 'pluginAvatar',
26-
unique: true
27-
},
28-
[MongoImageTypeEnum.datasetAvatar]: {
29-
label: 'datasetAvatar',
30-
unique: true
31-
},
32-
[MongoImageTypeEnum.userAvatar]: {
33-
label: 'userAvatar',
34-
unique: true
35-
},
36-
[MongoImageTypeEnum.teamAvatar]: {
37-
label: 'teamAvatar',
38-
unique: true
39-
},
40-
[MongoImageTypeEnum.groupAvatar]: {
41-
label: 'groupAvatar',
42-
unique: true
43-
},
44-
45-
[MongoImageTypeEnum.chatImage]: {
46-
label: 'chatImage',
47-
unique: false
48-
},
49-
[MongoImageTypeEnum.collectionImage]: {
50-
label: 'collectionImage',
51-
unique: false
52-
}
53-
};
54-
55-
export const uniqueImageTypeList = Object.entries(mongoImageTypeMap)
56-
.filter(([key, value]) => value.unique)
57-
.map(([key]) => key as `${MongoImageTypeEnum}`);
58-
593
export const FolderIcon = 'file/fill/folder';
604
export const FolderImgUrl = '/imgs/files/folder.svg';
615
export const HttpPluginImgUrl = '/imgs/app/httpPluginFill.svg';

packages/global/common/file/image/type.d.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { MongoImageTypeEnum } from './constants';
2-
31
export type MongoImageSchemaType = {
42
_id: string;
53
teamId: string;
64
binary: Buffer;
7-
createTime: Date;
85
expiredTime?: Date;
9-
type: `${MongoImageTypeEnum}`;
106

117
metadata?: {
128
mime?: string; // image mime type.

0 commit comments

Comments
 (0)