diff --git a/.vscode/settings.json b/.vscode/settings.json index b60a6c967..003a9b700 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,10 +6,10 @@ "i18n-ally.localesPaths": [ "projects/app/i18n", ], - "i18n-ally.enabledParsers": ["json"], + "i18n-ally.enabledParsers": ["json", "yaml", "js", "ts"], "i18n-ally.keystyle": "nested", "i18n-ally.sortKeys": true, - "i18n-ally.keepFulfilled": true, + "i18n-ally.keepFulfilled": false, "i18n-ally.sourceLanguage": "zh", // 根据此语言文件翻译其他语言文件的变量和内容 - "i18n-ally.displayLanguage": "zh", // 显示语言 + "i18n-ally.displayLanguage": "zh" // 显示语言 } \ No newline at end of file diff --git a/packages/global/core/workflow/template/system/globalVariable.ts b/packages/global/core/workflow/template/system/globalVariable.ts index 4dad1a14c..27f7de779 100644 --- a/packages/global/core/workflow/template/system/globalVariable.ts +++ b/packages/global/core/workflow/template/system/globalVariable.ts @@ -1,6 +1,6 @@ import { FlowNodeTemplateTypeEnum, WorkflowIOValueTypeEnum } from '../../constants'; import { getHandleConfig } from '../utils'; -import { FlowNodeTypeEnum } from '../../node/constant'; +import { FlowNodeOutputTypeEnum, FlowNodeTypeEnum } from '../../node/constant'; import { VariableItemType } from '../../../app/type'; import { FlowNodeTemplateType } from '../../type'; @@ -25,6 +25,7 @@ export const getGlobalVariableNode = ({ id: item.key, key: item.key, valueType: WorkflowIOValueTypeEnum.string, + type: FlowNodeOutputTypeEnum.static, label: item.label })) }; diff --git a/packages/global/core/workflow/template/system/tools.ts b/packages/global/core/workflow/template/system/tools.ts index 430855466..8c0050df3 100644 --- a/packages/global/core/workflow/template/system/tools.ts +++ b/packages/global/core/workflow/template/system/tools.ts @@ -27,7 +27,7 @@ export const ToolModule: FlowNodeTemplateType = { sourceHandle: getHandleConfig(true, true, false, true), targetHandle: getHandleConfig(true, true, false, true), avatar: '/imgs/workflow/tool.svg', - name: '工具调用(实验)', + name: '工具调用(实验)', intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。', showStatus: true, inputs: [ diff --git a/packages/service/core/workflow/dispatch/utils.ts b/packages/service/core/workflow/dispatch/utils.ts index e85727787..9bcc9ffd6 100644 --- a/packages/service/core/workflow/dispatch/utils.ts +++ b/packages/service/core/workflow/dispatch/utils.ts @@ -47,7 +47,7 @@ export const filterToolNodeIdByEdges = ({ export const getHistories = (history?: ChatItemType[] | number, histories: ChatItemType[] = []) => { if (!history) return []; - if (typeof history === 'number') return histories.slice(-history); + if (typeof history === 'number') return histories.slice(-(history * 2)); if (Array.isArray(history)) return history; return []; diff --git a/packages/web/hooks/useBeforeunload.ts b/packages/web/hooks/useBeforeunload.ts index 7edea603b..1a7adc2e9 100644 --- a/packages/web/hooks/useBeforeunload.ts +++ b/packages/web/hooks/useBeforeunload.ts @@ -8,7 +8,7 @@ export const useBeforeunload = (props?: { callback?: () => any; tip?: string }) useEffect(() => { const listen = - process.env.NODE_ENV !== 'production' + process.env.NODE_ENV === 'production' ? (e: any) => { e.preventDefault(); e.returnValue = tip; diff --git a/packages/web/hooks/useEditTextarea.tsx b/packages/web/hooks/useEditTextarea.tsx index 1cb0253e3..8d8adb503 100644 --- a/packages/web/hooks/useEditTextarea.tsx +++ b/packages/web/hooks/useEditTextarea.tsx @@ -92,9 +92,9 @@ export const useEditTextarea = ({ closeBtnText?: string; }) => ( - + {!!tip && ( - + {tip} )} diff --git a/projects/app/i18n/en/common.json b/projects/app/i18n/en/common.json index 010b9ba03..50c62a0b3 100644 --- a/projects/app/i18n/en/common.json +++ b/projects/app/i18n/en/common.json @@ -1,13 +1,11 @@ { "App": "App", - "Create New": "Create New", "Export": "Export", "Folder": "Folder", "Move": "Move", "Name": "Name", "Rename": "Rename", "Running": "Running", - "Select value is empty": "Selected value is empty", "UnKnow": "Unknown", "Warning": "Warning", "app": { @@ -646,7 +644,8 @@ "success": "Sync started" } }, - "training": {} + "training": { + } }, "data": { "Auxiliary Data": "Auxiliary Data", @@ -1167,7 +1166,7 @@ }, "publish": { "OnRevert version": "Click back to that version", - "OnRevert version confirm": "Are you sure to roll back the version?", + "OnRevert version confirm": "Sure you want to roll back to this version? The configuration for the version in editing is saved for you and a new release is created for the rollback version.", "histories": "Publiish histories" }, "tool": { @@ -1204,7 +1203,6 @@ "Select Dataset": "Select this knowledge base", "Select Dataset Tips": "Only knowledge bases of the same index model can be selected", "Select Folder": "Enter folder", - "System Data Queue": "Queue Length", "Training Name": "Data Training", "Upload Time": "Upload Time", "collections": { diff --git a/projects/app/i18n/zh/common.json b/projects/app/i18n/zh/common.json index ebdafb241..9a18c2418 100644 --- a/projects/app/i18n/zh/common.json +++ b/projects/app/i18n/zh/common.json @@ -1,13 +1,11 @@ { "App": "应用", - "Create New": "", "Export": "导出", "Folder": "文件夹", "Move": "移动", "Name": "名称", "Rename": "重命名", "Running": "运行中", - "Select value is empty": "选择的内容为空", "UnKnow": "未知", "Warning": "提示", "app": { @@ -646,7 +644,8 @@ "success": "开始同步" } }, - "training": {} + "training": { + } }, "data": { "Auxiliary Data": "辅助数据", @@ -1167,7 +1166,7 @@ }, "publish": { "OnRevert version": "点击回退到该版本", - "OnRevert version confirm": "确认回退该版本?", + "OnRevert version confirm": "确认回退至该版本?会为您保存编辑中版本的配置,并为回退版本创建一个新的发布版本。", "histories": "发布记录" }, "tool": { @@ -1204,7 +1203,6 @@ "Select Dataset": "选择该知识库", "Select Dataset Tips": "仅能选择同一个索引模型的知识库", "Select Folder": "进入文件夹", - "System Data Queue": "排队长度", "Training Name": "数据训练", "Upload Time": "上传时间", "collections": { diff --git a/projects/app/src/components/core/workflow/Flow/ChatTest.tsx b/projects/app/src/components/core/workflow/Flow/ChatTest.tsx index 9fd976953..a9cb91cbb 100644 --- a/projects/app/src/components/core/workflow/Flow/ChatTest.tsx +++ b/projects/app/src/components/core/workflow/Flow/ChatTest.tsx @@ -99,7 +99,7 @@ const ChatTest = ( return ( <> ) => {