Skip to content

Commit e18c79c

Browse files
authored
v4.6.4-Outlink (labring#589)
1 parent d2d7eac commit e18c79c

File tree

79 files changed

+1094
-762
lines changed

Some content is hidden

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

79 files changed

+1094
-762
lines changed

docSite/content/docs/development/upgrading/464.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ curl --location --request POST 'https://{{host}}/api/admin/initv464' \
2828

2929
1. 重写 - 分享链接身份逻辑,采用 localID 记录用户的ID。
3030
2. 商业版新增 - 分享链接 SSO 方案,通过`身份鉴权`地址,仅需`3个接口`即可完全接入已有用户系统。具体参考[分享链接身份鉴权](/docs/development/openapi/share/)
31-
3. 调整 - 知识库搜索模块 topk 逻辑,采用 MaxToken 计算,兼容不同长度的文本块
32-
4. 调整鉴权顺序,提高 apikey 的优先级,避免cookie抢占 apikey 的鉴权。
33-
5. 链接读取支持多选择器。参考[Web 站点同步用法](/docs/course/webSync)
34-
6. 修复 - 分享链接图片上传鉴权问题
35-
7. 修复 - Mongo 连接池未释放问题。
36-
8. 修复 - Dataset Intro 无法更新
37-
9. 修复 - md 代码块问题
38-
10. 修复 - root 权限问题
39-
11. 优化 docker file
31+
3. 新增 - 分享链接更多嵌入方式提示,更多DIY方式。
32+
4. 优化 - 历史记录模块。弃用旧的历史记录模块,直接在对应地方填写数值即可。
33+
5. 调整 - 知识库搜索模块 topk 逻辑,采用 MaxToken 计算,兼容不同长度的文本块
34+
6. 调整鉴权顺序,提高 apikey 的优先级,避免cookie抢占 apikey 的鉴权。
35+
7. 链接读取支持多选择器。参考[Web 站点同步用法](/docs/course/webSync)
36+
8. 修复 - 分享链接图片上传鉴权问题
37+
9. 修复 - Mongo 连接池未释放问题。
38+
10. 修复 - Dataset Intro 无法更新
39+
11. 修复 - md 代码块问题
40+
12. 修复 - root 权限问题
41+
13. 优化 docker file
4042

4143

packages/global/core/chat/api.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type UpdateChatFeedbackProps = {
2+
appId: string;
23
chatId: string;
34
chatItemId: string;
45
shareId?: string;

packages/global/core/module/node/constant.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export enum FlowNodeInputTypeEnum {
1212
selectApp = 'selectApp',
1313
// chat special input
1414
aiSettings = 'aiSettings',
15-
// maxToken = 'maxToken',
15+
16+
// model select
1617
selectChatModel = 'selectChatModel',
18+
selectCQModel = 'selectCQModel',
19+
1720
// dataset special input
1821
selectDataset = 'selectDataset',
1922
selectDatasetParamsModal = 'selectDatasetParamsModal',

packages/global/core/module/template/input.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ export const Input_Template_TFSwitch: FlowNodeInputItemType = {
1414

1515
export const Input_Template_History: FlowNodeInputItemType = {
1616
key: ModuleInputKeyEnum.history,
17-
type: FlowNodeInputTypeEnum.target,
17+
type: FlowNodeInputTypeEnum.numberInput,
1818
label: 'core.module.input.label.chat history',
19+
required: true,
20+
min: 0,
21+
max: 30,
1922
valueType: ModuleDataTypeEnum.chatHistory,
23+
value: 6,
2024
showTargetInApp: true,
2125
showTargetInPlugin: true
2226
};

packages/global/core/module/template/system/aiChat.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export const AiChatModule: FlowModuleTemplateType = {
8787
type: FlowNodeInputTypeEnum.hidden,
8888
label: '引用内容模板',
8989
valueType: ModuleDataTypeEnum.string,
90-
value: '',
9190
showTargetInApp: false,
9291
showTargetInPlugin: false
9392
},
@@ -96,15 +95,13 @@ export const AiChatModule: FlowModuleTemplateType = {
9695
type: FlowNodeInputTypeEnum.hidden,
9796
label: '引用内容提示词',
9897
valueType: ModuleDataTypeEnum.string,
99-
value: '',
10098
showTargetInApp: false,
10199
showTargetInPlugin: false
102100
},
103101
{
104102
key: ModuleInputKeyEnum.aiChatSettingModal,
105103
type: FlowNodeInputTypeEnum.aiSettings,
106104
label: '',
107-
connected: false,
108105
valueType: ModuleDataTypeEnum.any,
109106
showTargetInApp: false,
110107
showTargetInPlugin: false
@@ -118,21 +115,19 @@ export const AiChatModule: FlowModuleTemplateType = {
118115
valueType: ModuleDataTypeEnum.string,
119116
description: chatNodeSystemPromptTip,
120117
placeholder: chatNodeSystemPromptTip,
121-
value: '',
122118
showTargetInApp: true,
123119
showTargetInPlugin: true
124120
},
121+
Input_Template_History,
125122
{
126123
key: ModuleInputKeyEnum.aiChatDatasetQuote,
127124
type: FlowNodeInputTypeEnum.target,
128125
label: '引用内容',
129126
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
130127
valueType: ModuleDataTypeEnum.datasetQuote,
131-
connected: false,
132128
showTargetInApp: true,
133129
showTargetInPlugin: true
134130
},
135-
Input_Template_History,
136131
Input_Template_UserChatInput
137132
],
138133
outputs: [

packages/global/core/module/template/system/assignedAnswer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const AssignedAnswerModule: FlowModuleTemplateType = {
1717
key: ModuleInputKeyEnum.answerText,
1818
type: FlowNodeInputTypeEnum.textarea,
1919
valueType: ModuleDataTypeEnum.any,
20-
value: '',
2120
label: '回复的内容',
2221
description:
2322
'可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',

packages/global/core/module/template/system/classifyQuestion.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const ClassifyQuestionModule: FlowModuleTemplateType = {
2727
Input_Template_TFSwitch,
2828
{
2929
key: ModuleInputKeyEnum.aiModel,
30-
type: FlowNodeInputTypeEnum.selectChatModel,
30+
type: FlowNodeInputTypeEnum.selectCQModel,
3131
valueType: ModuleDataTypeEnum.string,
3232
label: '分类模型',
3333
required: true,
@@ -38,7 +38,6 @@ export const ClassifyQuestionModule: FlowModuleTemplateType = {
3838
key: ModuleInputKeyEnum.aiSystemPrompt,
3939
type: FlowNodeInputTypeEnum.textarea,
4040
valueType: ModuleDataTypeEnum.string,
41-
value: '',
4241
label: '背景知识',
4342
description:
4443
'你可以添加一些特定内容的介绍,从而更好的识别用户的问题类型。这个内容通常是给模型介绍一个它不知道的内容。',
@@ -57,15 +56,15 @@ export const ClassifyQuestionModule: FlowModuleTemplateType = {
5756
value: [
5857
{
5958
value: '打招呼',
60-
key: 'fasw'
59+
key: 'wqre'
6160
},
6261
{
6362
value: '关于 xxx 的问题',
64-
key: 'fqsw'
63+
key: 'sdfa'
6564
},
6665
{
6766
value: '其他问题',
68-
key: 'fesw'
67+
key: 'agex'
6968
}
7069
],
7170
showTargetInApp: false,
@@ -75,19 +74,19 @@ export const ClassifyQuestionModule: FlowModuleTemplateType = {
7574
outputs: [
7675
// custom output
7776
{
78-
key: 'fasw',
77+
key: 'wqre',
7978
label: '',
8079
type: FlowNodeOutputTypeEnum.hidden,
8180
targets: []
8281
},
8382
{
84-
key: 'fqsw',
83+
key: 'sdfa',
8584
label: '',
8685
type: FlowNodeOutputTypeEnum.hidden,
8786
targets: []
8887
},
8988
{
90-
key: 'fesw',
89+
key: 'agex',
9190
label: '',
9291
type: FlowNodeOutputTypeEnum.hidden,
9392
targets: []

packages/global/core/module/template/system/contextExtract.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ export const ContextExtractModule: FlowModuleTemplateType = {
2626
key: ModuleInputKeyEnum.description,
2727
type: FlowNodeInputTypeEnum.textarea,
2828
valueType: ModuleDataTypeEnum.string,
29-
value: '',
3029
label: '提取要求描述',
31-
description: '写一段提取要求,告诉 AI 需要提取哪些内容',
30+
description: '给AI一些对应的背景知识或要求描述,引导AI更好的完成任务',
3231
required: true,
3332
placeholder:
34-
'例如: \n1. 你是一个实验室预约助手。根据用户问题,提取出姓名、实验室号和预约时间',
33+
'例如: \n1. 你是一个实验室预约助手,你的任务是帮助用户预约实验室。\n2. 你是谷歌搜索助手,需要从文本中提取出合适的搜索词。',
3534
showTargetInApp: true,
3635
showTargetInPlugin: true
3736
},

packages/global/core/module/template/system/datasetSearch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export const DatasetSearchModule: FlowModuleTemplateType = {
7474
key: ModuleInputKeyEnum.datasetParamsModal,
7575
type: FlowNodeInputTypeEnum.selectDatasetParamsModal,
7676
label: '',
77-
connected: false,
7877
valueType: ModuleDataTypeEnum.any,
7978
showTargetInApp: false,
8079
showTargetInPlugin: false

packages/global/core/module/template/system/history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const HistoryModule: FlowModuleTemplateType = {
1111
templateType: ModuleTemplateTypeEnum.systemInput,
1212
flowType: FlowNodeTypeEnum.historyNode,
1313
avatar: '/imgs/module/history.png',
14-
name: '聊天记录',
14+
name: '聊天记录(弃用)',
1515
intro: '用户输入的内容。该模块通常作为应用的入口,用户在发送消息后会首先执行该模块。',
1616
inputs: [
1717
{

packages/global/core/module/template/system/http.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const HttpModule: FlowModuleTemplateType = {
1616
Input_Template_TFSwitch,
1717
{
1818
key: ModuleInputKeyEnum.httpUrl,
19-
value: '',
2019
type: FlowNodeInputTypeEnum.input,
2120
valueType: ModuleDataTypeEnum.string,
2221
label: '请求地址',

packages/global/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"encoding": "^0.1.13",
99
"js-tiktoken": "^1.0.7",
1010
"node-html-markdown": "^1.3.0",
11-
"openai": "^4.16.1",
11+
"openai": "^4.20.1",
1212
"timezones-list": "^3.0.2"
1313
},
1414
"devDependencies": {

packages/service/common/api/plusRequest.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ instance.interceptors.request.use(requestStart, (err) => Promise.reject(err));
7070
instance.interceptors.response.use(responseSuccess, (err) => Promise.reject(err));
7171

7272
export function request(url: string, data: any, config: ConfigType, method: Method): any {
73-
if (global.systemEnv && !global.systemEnv?.pluginBaseUrl) {
74-
return Promise.reject('该功能为商业版特有...');
73+
if (!global.systemEnv || !global.systemEnv?.pluginBaseUrl) {
74+
console.log('未部署商业版接口');
75+
return Promise.reject('The The request was denied...');
7576
}
7677

7778
/* 去空 */

packages/service/core/chat/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function getChatItems({
1414
return { history: [] };
1515
}
1616

17-
const history = await MongoChatItem.find({ chatId }, field).sort({ _id: -1 }).limit(limit);
17+
const history = await MongoChatItem.find({ chatId }, field).sort({ _id: -1 }).limit(limit).lean();
1818

1919
history.reverse();
2020

packages/service/support/outLink/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const pushResult2Remote = async ({
3030
shareId?: string;
3131
responseData?: any[];
3232
}) => {
33-
if (!shareId || !outLinkUid || !global.systemEnv.pluginBaseUrl) return;
33+
if (!shareId || !outLinkUid || !global.systemEnv?.pluginBaseUrl) return;
3434
try {
3535
const outLink = await MongoOutLink.findOne({
3636
shareId

pnpm-lock.yaml

Lines changed: 24 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/app/data/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
],
6767
"CQModels": [
6868
{
69-
"model": "gpt-3.5-turbo-1106",
70-
"name": "GPT35-1106",
71-
"maxContext": 16000,
69+
"model": "gpt-3.5-turbo",
70+
"name": "GPT35",
71+
"maxContext": 4000,
7272
"maxResponse": 4000,
7373
"price": 0,
7474
"functionCall": true,

projects/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "app",
3-
"version": "4.6.3",
3+
"version": "4.6.4",
44
"private": false,
55
"scripts": {
66
"dev": "next dev",

projects/app/public/docs/versionIntro.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22

33
1. 重写 - 分享链接身份逻辑,采用 localID 记录用户的ID。
44
2. 商业版新增 - 分享链接 SSO 方案,通过`身份鉴权`地址,仅需`3个接口`即可完全接入已有用户系统。具体参考[分享链接身份鉴权](https://doc.fastgpt.in/docs/development/openapi/share/)
5-
3. 调整 - 知识库搜索模块 topk 逻辑,采用 MaxToken 计算,兼容不同长度的文本块
6-
4. 调整鉴权顺序,提高 apikey 的优先级,避免cookie抢占 apikey 的鉴权。
7-
5. 链接读取支持多选择器。参考[Web 站点同步用法](https://doc.fastgpt.in/docs/course/webSync)
8-
6. 修复 - 分享链接图片上传鉴权问题
9-
7. 修复 - Mongo 连接池未释放问题。
10-
8. 修复 - Dataset Intro 无法更新
11-
9. 修复 - md 代码块问题
12-
10. 修复 - root 权限问题
13-
11. 优化 docker file
14-
12. [知识库结构详解](https://doc.fastgpt.in/docs/use-cases/datasetengine/)
15-
13. [知识库提示词详解](https://doc.fastgpt.in/docs/use-cases/ai_settings/#引用模板--引用提示词)
16-
14. [使用文档](https://doc.fastgpt.in/docs/intro/)
17-
15. [点击查看高级编排介绍文档](https://doc.fastgpt.in/docs/workflow)
18-
16. [点击查看商业版](https://doc.fastgpt.in/docs/commercial/)
5+
3. 新增 - 分享链接更多嵌入方式提示,更多DIY方式。
6+
4. 优化 - 历史记录模块。弃用旧的历史记录模块,直接在对应地方填写数值即可。
7+
5. 调整 - 知识库搜索模块 topk 逻辑,采用 MaxToken 计算,兼容不同长度的文本块
8+
6. 链接读取支持多选择器。参考[Web 站点同步用法](https://doc.fastgpt.in/docs/course/webSync)
9+
7. [知识库结构详解](https://doc.fastgpt.in/docs/use-cases/datasetengine/)
10+
8. [知识库提示词详解](https://doc.fastgpt.in/docs/use-cases/ai_settings/#引用模板--引用提示词)
11+
9. [使用文档](https://doc.fastgpt.in/docs/intro/)
12+
10. [点击查看高级编排介绍文档](https://doc.fastgpt.in/docs/workflow)
13+
11. [点击查看商业版](https://doc.fastgpt.in/docs/commercial/)
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)