Skip to content

Commit b520988

Browse files
V4.8.17 feature (#3485)
* feat: add third party account config (#3443) * temp * editor workflow variable style * add team to dispatch * i18n * delete console * change openai account position * fix * fix * fix * fix * fix * 4.8.17 test (#3461) * perf: external provider config * perf: ui * feat: add template config (#3434) * change template position * template config * delete console * delete * fix * fix * perf: Mongo visutal field (#3464) * remve invalid code * perf: team member visutal code * perf: virtual search; perf: search test data * fix: ts * fix: image response headers * perf: template code * perf: auth layout;perf: auto save (#3472) * perf: auth layout * perf: auto save * perf: auto save * fix: template guide display & http input support external variables (#3475) * fix: template guide display * http editor support external workflow variables * perf: auto save;fix: ifelse checker line break; (#3478) * perf: auto save * perf: auto save * fix: ifelse checker line break * perf: doc * perf: doc * fix: update var type error * 4.8.17 test (#3479) * perf: auto save * perf: auto save * perf: template code * 4.8.17 test (#3480) * perf: auto save * perf: auto save * perf: model price model * feat: add react memo * perf: model provider filter * fix: ts (#3481) * perf: auto save * perf: auto save * fix: ts * simple app tool select (#3473) * workflow plugin userguide & simple tool ui * simple tool filter * reuse component * change component to hook * fix * perf: too selector modal (#3484) * perf: auto save * perf: auto save * perf: markdown render * perf: too selector * fix: app version require tmbId * perf: templates refresh * perf: templates refresh * hide auto save error tip * perf: toolkit guide --------- Co-authored-by: heheer <[email protected]>
1 parent a209856 commit b520988

File tree

207 files changed

+2941
-1376
lines changed

Some content is hidden

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

207 files changed

+2941
-1376
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
5858
- [x] 多库复用,混用
5959
- [x] chunk 记录修改和删除
6060
- [x] 支持手动输入,直接分段,QA 拆分导入
61-
- [x] 支持 txt,md,html,pdf,docx,pptx,csv,xlsx (有需要更多可 PR file loader)
62-
- [x] 支持 url 读取、CSV 批量导入
61+
- [x] 支持 txt,md,html,pdf,docx,pptx,csv,xlsx (有需要更多可 PR file loader),支持 url 读取、CSV 批量导入
6362
- [x] 混合检索 & 重排
63+
- [x] API 知识库
6464
- [ ] 自定义文件读取服务
6565
- [ ] 自定义分块服务
6666

@@ -69,7 +69,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
6969
- [x] 对话时反馈引用并可修改与删除
7070
- [x] 完整上下文呈现
7171
- [x] 完整模块中间值呈现
72-
- [x] 高级编排 DeBug 模式
72+
- [ ] 高级编排 DeBug 模式
7373

7474
`4` OpenAPI 接口
7575
- [x] completions 接口 (chat 模式对齐 GPT 接口)

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,11 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTe
14241424
"limit": 5000,
14251425
"similarity": 0,
14261426
"searchMode": "embedding",
1427-
"usingReRank": false
1427+
"usingReRank": false,
1428+
1429+
"datasetSearchUsingExtensionQuery": true,
1430+
"datasetSearchExtensionModel": "gpt-4o-mini",
1431+
"datasetSearchExtensionBg": ""
14281432
}'
14291433
```
14301434

@@ -1441,6 +1445,9 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTe
14411445
- similarity - 最低相关度(0~1,可选)
14421446
- searchMode - 搜索模式:embedding | fullTextRecall | mixedRecall
14431447
- usingReRank - 使用重排
1448+
- datasetSearchUsingExtensionQuery - 使用问题优化
1449+
- datasetSearchExtensionModel - 问题优化模型
1450+
- datasetSearchExtensionBg - 问题优化背景描述
14441451
{{% /alert %}}
14451452

14461453
{{< /markdownify >}}

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,30 @@ toc: true
77
weight: 807
88
---
99

10+
## 运行升级脚本
11+
12+
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**
13+
14+
```bash
15+
curl --location --request POST 'https://{{host}}/api/admin/initv4817' \
16+
--header 'rootkey: {{rootkey}}' \
17+
--header 'Content-Type: application/json'
18+
```
19+
20+
会将用户绑定的 OpenAI 账号移动到团队中。
1021

1122
## 完整更新内容
1223

13-
1.
14-
2. 新增 - LLM 模型参数支持关闭 max_tokens 和 temperature。
15-
3. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。
16-
4. 优化 - 可用模型展示
24+
1. 新增 - 简易模式工具调用支持数组类型插件。
25+
2. 新增 - 工作流增加异常离开自动保存,避免工作流丢失。
26+
3. 新增 - LLM 模型参数支持关闭 max_tokens 和 temperature。
27+
4. 新增 - 商业版支持后台配置模板市场。
28+
5. 新增 - 商业版支持后台配置自定义工作流变量,用于与业务系统鉴权打通。
29+
6. 新增 - 搜索测试接口支持问题优化。
30+
7. 优化 - Markdown 大小测试,超出 20 万字符不使用 Markdown 组件,避免崩溃。
31+
8. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。
32+
9. 优化 - 可用模型展示
33+
10. 优化 - Mongo 查询语句,增加 virtual 字段。
34+
11. 修复 - 文件返回接口缺少 Content-Length 头,导致通过非同源文件上传时,阿里 vision 模型无法识别图片。
35+
12. 修复 - 去除判断器两端字符串隐藏换行符,避免判断器失效。
36+
13. 修复 - 变量更新节点,手动输入更新内容时候,非字符串类型数据类型无法自动转化。

packages/global/common/system/types/index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ export type NavbarItemType = {
1818
isActive: boolean;
1919
};
2020

21+
export type ExternalProviderWorkflowVarType = {
22+
name: string;
23+
key: string;
24+
intro: string;
25+
isOpen: boolean;
26+
url?: string;
27+
};
28+
2129
/* fastgpt main */
2230
export type FastGPTConfigFileType = {
2331
feConfigs: FastGPTFeConfigsType;
@@ -84,6 +92,7 @@ export type FastGPTFeConfigsType = {
8492
uploadFileMaxSize?: number;
8593
lafEnv?: string;
8694
navbarItems?: NavbarItemType[];
95+
externalProviderWorkflowVariables?: ExternalProviderWorkflowVarType[];
8796
};
8897

8998
export type SystemEnvType = {

packages/global/core/app/type.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { StoreEdgeItemType } from '../workflow/type/edge';
1313
import { AppPermission } from '../../support/permission/app/controller';
1414
import { ParentIdType } from '../../common/parentFolder/type';
1515
import { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
16+
import { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
1617

1718
export type AppSchema = {
1819
_id: string;
@@ -184,3 +185,28 @@ export type SystemPluginListItemType = {
184185
name: string;
185186
avatar: string;
186187
};
188+
189+
export type AppTemplateSchemaType = {
190+
templateId: string;
191+
name: string;
192+
intro: string;
193+
avatar: string;
194+
tags: string[];
195+
type: string;
196+
author?: string;
197+
isActive?: boolean;
198+
userGuide?: {
199+
type: 'markdown' | 'link';
200+
content?: string;
201+
link?: string;
202+
};
203+
isQuickTemplate?: boolean;
204+
order?: number;
205+
workflow: WorkflowTemplateBasicType;
206+
};
207+
208+
export type TemplateTypeSchemaType = {
209+
typeName: string;
210+
typeId: string;
211+
typeOrder: number;
212+
};

packages/global/core/dataset/collection/utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { DatasetCollectionTypeEnum, TrainingModeEnum, TrainingTypeMap } from '../constants';
2-
import { CollectionWithDatasetType, DatasetCollectionSchemaType } from '../type';
2+
import { DatasetCollectionSchemaType } from '../type';
33

4-
export const getCollectionSourceData = (
5-
collection?: CollectionWithDatasetType | DatasetCollectionSchemaType
6-
) => {
4+
export const getCollectionSourceData = (collection?: DatasetCollectionSchemaType) => {
75
return {
86
sourceId:
97
collection?.fileId ||

packages/global/core/dataset/type.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,8 @@ export type DatasetTrainingSchemaType = {
133133
indexes: Omit<DatasetDataIndexItemType, 'dataId'>[];
134134
};
135135

136-
export type CollectionWithDatasetType = Omit<DatasetCollectionSchemaType, 'datasetId'> & {
137-
datasetId: DatasetSchemaType;
138-
};
139-
export type DatasetDataWithCollectionType = Omit<DatasetDataSchemaType, 'collectionId'> & {
140-
collectionId: DatasetCollectionSchemaType;
136+
export type CollectionWithDatasetType = DatasetCollectionSchemaType & {
137+
dataset: DatasetSchemaType;
141138
};
142139

143140
/* ================= dataset ===================== */

packages/global/core/workflow/runtime/type.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ import { ReadFileNodeResponse } from '../template/system/readFiles/type';
2121
import { UserSelectOptionType } from '../template/system/userSelect/type';
2222
import { WorkflowResponseType } from '../../../../service/core/workflow/dispatch/type';
2323
import { AiChatQuoteRoleType } from '../template/system/aiChat/type';
24+
import { LafAccountType, OpenaiAccountType } from '../../../support/user/team/type';
25+
26+
export type ExternalProviderType = {
27+
openaiAccount?: OpenaiAccountType;
28+
externalWorkflowVariables?: Record<string, string>;
29+
};
2430

2531
/* workflow props */
2632
export type ChatDispatchProps = {
2733
res?: NextApiResponse;
2834
requestOrigin?: string;
2935
mode: 'test' | 'chat' | 'debug';
30-
user: UserModelSchema;
36+
timezone: string;
37+
externalProvider: ExternalProviderType;
3138

3239
runningAppInfo: {
3340
id: string; // May be the id of the system plug-in (cannot be used directly to look up the table)

packages/global/core/workflow/runtime/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { isValidReferenceValueFormat } from '../utils';
99
import { FlowNodeOutputItemType, ReferenceValueType } from '../type/io';
1010
import { ChatItemType, NodeOutputItemType } from '../../../core/chat/type';
1111
import { ChatItemValueTypeEnum, ChatRoleEnum } from '../../../core/chat/constants';
12+
import { replaceVariable } from '../../../common/string/tools';
1213

1314
export const getMaxHistoryLimitFromNodes = (nodes: StoreNodeItemType[]): number => {
1415
let limit = 10;
@@ -317,6 +318,8 @@ export function replaceEditorVariable({
317318
}) {
318319
if (typeof text !== 'string') return text;
319320

321+
text = replaceVariable(text, variables);
322+
320323
const variablePattern = /\{\{\$([^.]+)\.([^$]+)\$\}\}/g;
321324
const matches = [...text.matchAll(variablePattern)];
322325
if (matches.length === 0) return text;

packages/global/core/workflow/template/system/workflowStart.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const WorkflowStart: FlowNodeTemplateType = {
3030
intro: '',
3131
forbidDelete: true,
3232
unique: true,
33-
courseUrl: '/docs/guide/workbench/workflow/input/',
3433
version: '481',
3534
inputs: [{ ...Input_Template_UserChatInput, toolDescription: i18nT('workflow:user_question') }],
3635
outputs: [

0 commit comments

Comments
 (0)