Skip to content

Commit

Permalink
4.8.8 test fix (#2149)
Browse files Browse the repository at this point in the history
* perf: code comment

* feat: system plugin input guide

* perf: variable avatar

* feat: feishu webhook

* perf: select tool config tip

* perf: rename variable

* fix: per inherit error

* perf: docker-compose oneapi version and i18n

* perf: ui tip bug

* fix: ts

* perf: pg log

* perf: editor color

* perf: update init
  • Loading branch information
c121914yu authored Jul 26, 2024
1 parent 2d016b7 commit cd554f5
Show file tree
Hide file tree
Showing 59 changed files with 1,654 additions and 512 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/preview-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build-fastgpt-images:
preview-fastgpt-images:
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down
36 changes: 26 additions & 10 deletions docSite/content/zh-cn/docs/development/upgrading/488.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,35 @@ weight: 816
- fastgpt 镜像 tag 修改成 v4.8.8-alpha
- 商业版镜像 tag 修改成 v4.8.8-alpha

### 3. 执行初始化

从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**

```bash
curl --location --request POST 'https://{{host}}/api/admin/initv48 8' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```

会初始化知识库的继承权限

-------

## V4.8.8 更新说明

1. 新增 - 重构系统插件的结构。允许向开源社区 PR 系统插件,具体可见: [如何向 FastGPT 社区提交系统插件](https://fael3z0zfze.feishu.cn/wiki/ERZnw9R26iRRG0kXZRec6WL9nwh)
2. 新增 - DuckDuckGo 系统插件。
3. 新增 - 修改变量填写方式。提示词输入框以以及工作流中所有 Textarea 输入框,支持输入 / 唤起变量选择,可直接选择所有上游输出值,无需动态引入。
4. 优化 - 移动端快速切换应用交互。
5. 优化 - 节点图标。
6. 优化 - 对话框引用增加额外复制案件,便于复制。增加引用内容折叠。
7. 优化 - 对话框底部增加复制,简便复制交互,无需滚动到消息开头。
8. 优化 - OpenAI sdk 升级,并自定义了 whisper 模型接口(未仔细查看 sdk 实现,但 sdk 中 whisper 接口,似乎无法适配一般 fastapi 接口)
9. 修复 - Permission 表声明问题。
10. 修复 - 并行执行节点,运行时间未正确记录。
11. 修复 - 简易模式,首次进入,无法正确获取知识库配置。
12. 修复 - Log debug level 配置无效。
3. 新增 - 飞书 webhook 系统插件。
4. 新增 - 修改变量填写方式。提示词输入框以以及工作流中所有 Textarea 输入框,支持输入 / 唤起变量选择,可直接选择所有上游输出值,无需动态引入。
5. 商业版新增 - 知识库权限继承。
6. 优化 - 移动端快速切换应用交互。
7. 优化 - 节点图标。
8. 优化 - 对话框引用增加额外复制案件,便于复制。增加引用内容折叠。
9. 优化 - 对话框底部增加复制,简便复制交互,无需滚动到消息开头。
10. 优化 - OpenAI sdk 升级,并自定义了 whisper 模型接口(未仔细查看 sdk 实现,但 sdk 中 whisper 接口,似乎无法适配一般 fastapi 接口)
11. 修复 - Permission 表声明问题。
12. 修复 - 并行执行节点,运行时间未正确记录。
13. 修复 - 运行详情未正确展示嵌套节点信息。
14. 修复 - 简易模式,首次进入,无法正确获取知识库配置。
15. 修复 - Log debug level 配置无效。
16. 修复 - 插件独立运行时,会将插件输入的值进行变量替换,可能导致后续节点变量异常。
2 changes: 1 addition & 1 deletion files/docker/docker-compose-milvus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ services:
- ./mysql:/var/lib/mysql
oneapi:
container_name: oneapi
image: ghcr.io/songquanpeng/one-api:latest
image: ghcr.io/songquanpeng/one-api:0.6.7
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
ports:
- 3001:3000
Expand Down
2 changes: 1 addition & 1 deletion files/docker/docker-compose-pgvector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ services:
- ./mysql:/var/lib/mysql
oneapi:
container_name: oneapi
image: ghcr.io/songquanpeng/one-api:latest
image: ghcr.io/songquanpeng/one-api:0.6.7
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
ports:
- 3001:3000
Expand Down
2 changes: 1 addition & 1 deletion files/docker/docker-compose-zilliz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ services:
- ./mysql:/var/lib/mysql
oneapi:
container_name: oneapi
image: ghcr.io/songquanpeng/one-api:latest
image: ghcr.io/songquanpeng/one-api:0.6.7
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
ports:
- 3001:3000
Expand Down
44 changes: 23 additions & 21 deletions packages/global/core/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ import { getAppChatConfig } from '../workflow/utils';
import { StoreNodeItemType } from '../workflow/type/node';
import { DatasetSearchModeEnum } from '../dataset/constants';

export const getDefaultAppForm = (): AppSimpleEditFormType => ({
aiSettings: {
model: 'gpt-4o-mini',
systemPrompt: '',
temperature: 0,
isResponseAnswerText: true,
maxHistories: 6,
maxToken: 4000
},
dataset: {
datasets: [],
similarity: 0.4,
limit: 1500,
searchMode: DatasetSearchModeEnum.embedding,
usingReRank: false,
datasetSearchUsingExtensionQuery: false,
datasetSearchExtensionBg: ''
},
selectedTools: [],
chatConfig: {}
});
export const getDefaultAppForm = (): AppSimpleEditFormType => {
return {
aiSettings: {
model: 'gpt-4o-mini',
systemPrompt: '',
temperature: 0,
isResponseAnswerText: true,
maxHistories: 6,
maxToken: 4000
},
dataset: {
datasets: [],
similarity: 0.4,
limit: 1500,
searchMode: DatasetSearchModeEnum.embedding,
usingReRank: false,
datasetSearchUsingExtensionQuery: true,
datasetSearchExtensionBg: ''
},
selectedTools: [],
chatConfig: {}
};
};

/* format app nodes to edit form */
export const appWorkflow2Form = ({
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum FlowNodeTemplateTypeEnum {

search = 'search',
multimodal = 'multimodal',
communication = 'communication',

other = 'other',
teamApp = 'teamApp'
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/type/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type WorkflowTemplateType = {
avatar: string;
intro?: string;
author?: string;
inputExplanationUrl?: string;
version: string;

showStatus?: boolean;
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/type/node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type FlowNodeCommonType = {
avatar?: string;
name: string;
intro?: string; // template list intro
inputExplanationUrl?: string;
showStatus?: boolean; // chatting response step status
version: string;

Expand Down
5 changes: 4 additions & 1 deletion packages/global/core/workflow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const updatePluginInputByVariables = (
);
};

export const filterPluginInputVariables = (
export const removePluginInputVariables = (
variables: Record<string, any>,
nodes: RuntimeNodeItemType[]
) => {
Expand Down Expand Up @@ -268,6 +268,7 @@ export function replaceVariableLabel({
};
});

// Upstream node outputs
const nodeVariables = nodes
.map((node) => {
return node.outputs.map((output) => {
Expand All @@ -280,6 +281,7 @@ export function replaceVariableLabel({
})
.flat();

// Get runningNode inputs(Will be replaced with reference)
const customInputs = runningNode.inputs.flatMap((item) => {
if (Array.isArray(item.value)) {
return [
Expand All @@ -299,6 +301,7 @@ export function replaceVariableLabel({

const allVariables = [...globalVariables, ...nodeVariables, ...customInputs];

// Replace {{$xxx.xxx$}} to value
for (const key in allVariables) {
const val = allVariables[key];
const regex = new RegExp(`\\{\\{\\$(${val.nodeId}\\.${val.id})\\$\\}\\}`, 'g');
Expand Down
9 changes: 8 additions & 1 deletion packages/plugins/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import { cloneDeep } from 'lodash';
import { WorkerNameEnum, runWorker } from '@fastgpt/service/worker/utils';

// Run in main thread
const staticPluginList = ['getTime', 'fetchUrl', 'Doc2X', 'Doc2X/URLPDF2text', 'Doc2X/URLImg2text'];
const staticPluginList = [
'getTime',
'fetchUrl',
'Doc2X',
'Doc2X/URLPDF2text',
'Doc2X/URLImg2text',
'feishu'
];
// Run in worker thread (Have npm packages)
const packagePluginList = [
'mathExprVal',
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/src/Doc2X/URLImg2text/template.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"author": "",
"author": "Menghuan1918",
"version": "488",
"name": "Doc2X 图像(URL)识别",
"avatar": "plugins/doc2x",
"intro": "将传入的图片(URL)发送至Doc2X进行解析,返回带LaTeX公式的markdown格式的文本",
"inputExplanationUrl": "https://fael3z0zfze.feishu.cn/wiki/Rkc5witXWiJoi5kORd2cofh6nDg?fromScene=spaceOverview",
"showStatus": true,
"weight": 10,

Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/src/Doc2X/URLPDF2text/template.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"author": "",
"author": "Menghuan1918",
"version": "488",
"name": "Doc2X PDF文件(URL)识别",
"avatar": "plugins/doc2x",
"intro": "将传入的PDF文件(URL)发送至Doc2X进行解析,返回带LaTeX公式的markdown格式的文本",
"inputExplanationUrl": "https://fael3z0zfze.feishu.cn/wiki/Rkc5witXWiJoi5kORd2cofh6nDg?fromScene=spaceOverview",
"showStatus": true,
"weight": 10,

Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/src/Doc2X/template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"author": "",
"author": "Menghuan1918",
"version": "488",
"name": "Doc2X服务",
"avatar": "plugins/doc2x",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/src/duckduckgo/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"avatar": "core/workflow/template/duckduckgo",
"intro": "DuckDuckGo 服务,包含网络搜索、图片搜索、新闻搜索等。",
"showStatus": false,
"weight": 10,
"weight": 100,

"isTool": true,
"templateType": "tools",
Expand Down
Loading

0 comments on commit cd554f5

Please sign in to comment.