diff --git a/packages/global/core/workflow/template/system/aiChat.ts b/packages/global/core/workflow/template/system/aiChat.ts index 45e8f3120d6..e100e39fd06 100644 --- a/packages/global/core/workflow/template/system/aiChat.ts +++ b/packages/global/core/workflow/template/system/aiChat.ts @@ -26,7 +26,7 @@ export const AiChatModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.chatNode, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', name: 'AI 对话', intro: 'AI 大模型对话', showStatus: true, diff --git a/packages/global/core/workflow/template/system/assignedAnswer.ts b/packages/global/core/workflow/template/system/assignedAnswer.ts index 5a8998eecdb..6850eb58496 100644 --- a/packages/global/core/workflow/template/system/assignedAnswer.ts +++ b/packages/global/core/workflow/template/system/assignedAnswer.ts @@ -13,7 +13,7 @@ export const AssignedAnswerModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.answerNode, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/reply.png', + avatar: 'core/workflow/template/reply', name: '指定回复', intro: '该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。', diff --git a/packages/global/core/workflow/template/system/classifyQuestion/index.ts b/packages/global/core/workflow/template/system/classifyQuestion/index.ts index 8a587fa10b5..7d378fbab51 100644 --- a/packages/global/core/workflow/template/system/classifyQuestion/index.ts +++ b/packages/global/core/workflow/template/system/classifyQuestion/index.ts @@ -25,7 +25,7 @@ export const ClassifyQuestionModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.classifyQuestion, sourceHandle: getHandleConfig(false, false, false, false), targetHandle: getHandleConfig(true, false, true, true), - avatar: '/imgs/workflow/cq.png', + avatar: 'core/workflow/template/questionClassify', name: '问题分类', intro: `根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题`, showStatus: true, diff --git a/packages/global/core/workflow/template/system/contextExtract/index.ts b/packages/global/core/workflow/template/system/contextExtract/index.ts index 146fd6740a5..4b6eb42d646 100644 --- a/packages/global/core/workflow/template/system/contextExtract/index.ts +++ b/packages/global/core/workflow/template/system/contextExtract/index.ts @@ -20,7 +20,7 @@ export const ContextExtractModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.contentExtract, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/extract.png', + avatar: 'core/workflow/template/extractJson', name: '文本内容提取', intro: '可从文本中提取指定的数据,例如:sql语句、搜索关键词、代码等', showStatus: true, diff --git a/packages/global/core/workflow/template/system/customFeedback.ts b/packages/global/core/workflow/template/system/customFeedback.ts index cd7374ef649..fb8740c2806 100644 --- a/packages/global/core/workflow/template/system/customFeedback.ts +++ b/packages/global/core/workflow/template/system/customFeedback.ts @@ -13,7 +13,7 @@ export const CustomFeedbackNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.customFeedback, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/customFeedback.svg', + avatar: 'core/workflow/template/customFeedback', name: '自定义反馈', intro: '该模块被触发时,会给当前的对话记录增加一条反馈。可用于自动记录对话效果等。', version: '486', diff --git a/packages/global/core/workflow/template/system/datasetConcat.ts b/packages/global/core/workflow/template/system/datasetConcat.ts index 7355eb48c89..2b608cad3e4 100644 --- a/packages/global/core/workflow/template/system/datasetConcat.ts +++ b/packages/global/core/workflow/template/system/datasetConcat.ts @@ -37,7 +37,7 @@ export const DatasetConcatModule: FlowNodeTemplateType = { templateType: FlowNodeTemplateTypeEnum.other, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/concat.svg', + avatar: 'core/workflow/template/datasetConcat', name: '知识库搜索引用合并', intro: '可以将多个知识库搜索结果进行合并输出。使用 RRF 的合并方式进行最终排序输出。', showStatus: false, diff --git a/packages/global/core/workflow/template/system/datasetSearch.ts b/packages/global/core/workflow/template/system/datasetSearch.ts index caacb90523f..1e4f18a60da 100644 --- a/packages/global/core/workflow/template/system/datasetSearch.ts +++ b/packages/global/core/workflow/template/system/datasetSearch.ts @@ -23,7 +23,7 @@ export const DatasetSearchModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.datasetSearchNode, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/db.png', + avatar: 'core/workflow/template/datasetSearch', name: '知识库搜索', intro: Dataset_SEARCH_DESC, showStatus: true, diff --git a/packages/global/core/workflow/template/system/http468.ts b/packages/global/core/workflow/template/system/http468.ts index 5a980fd8a1b..c7846f7868f 100644 --- a/packages/global/core/workflow/template/system/http468.ts +++ b/packages/global/core/workflow/template/system/http468.ts @@ -20,7 +20,7 @@ export const HttpNode468: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.httpRequest468, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/http.png', + avatar: 'core/workflow/template/httpRequest', name: 'HTTP 请求', intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)', showStatus: true, diff --git a/packages/global/core/workflow/template/system/ifElse/index.ts b/packages/global/core/workflow/template/system/ifElse/index.ts index 39b7b41202b..1da8dcb3268 100644 --- a/packages/global/core/workflow/template/system/ifElse/index.ts +++ b/packages/global/core/workflow/template/system/ifElse/index.ts @@ -18,7 +18,7 @@ export const IfElseNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.ifElseNode, sourceHandle: getHandleConfig(false, false, false, false), targetHandle: getHandleConfig(true, false, true, true), - avatar: '/imgs/workflow/ifElse.svg', + avatar: 'core/workflow/template/ifelse', name: '判断器', intro: '根据一定的条件,执行不同的分支。', showStatus: true, diff --git a/packages/global/core/workflow/template/system/laf.ts b/packages/global/core/workflow/template/system/laf.ts index 4e05c54bfcb..e5466bc6d2d 100644 --- a/packages/global/core/workflow/template/system/laf.ts +++ b/packages/global/core/workflow/template/system/laf.ts @@ -26,7 +26,7 @@ export const LafModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.lafModule, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/laf.png', + avatar: 'core/workflow/template/lafDispatch', name: 'Laf 函数调用(测试)', intro: '可以调用Laf账号下的云函数。', showStatus: true, diff --git a/packages/global/core/workflow/template/system/pluginInput.ts b/packages/global/core/workflow/template/system/pluginInput.ts index 2a0478ff0d1..27fce9013ea 100644 --- a/packages/global/core/workflow/template/system/pluginInput.ts +++ b/packages/global/core/workflow/template/system/pluginInput.ts @@ -11,7 +11,7 @@ export const PluginInputModule: FlowNodeTemplateType = { targetHandle: getHandleConfig(false, false, false, false), unique: true, forbidDelete: true, - avatar: '/imgs/workflow/input.png', + avatar: 'core/workflow/template/workflowStart', name: '插件输入', intro: '可以配置插件需要哪些输入,利用这些输入来运行插件', showStatus: false, diff --git a/packages/global/core/workflow/template/system/pluginOutput.ts b/packages/global/core/workflow/template/system/pluginOutput.ts index 023a0972a6e..1d2e98bc990 100644 --- a/packages/global/core/workflow/template/system/pluginOutput.ts +++ b/packages/global/core/workflow/template/system/pluginOutput.ts @@ -11,7 +11,7 @@ export const PluginOutputModule: FlowNodeTemplateType = { targetHandle: getHandleConfig(false, false, false, true), unique: true, forbidDelete: true, - avatar: '/imgs/workflow/output.png', + avatar: 'core/workflow/template/pluginOutput', name: '自定义插件输出', intro: '自定义配置外部输出,使用插件时,仅暴露自定义配置的输出', showStatus: false, diff --git a/packages/global/core/workflow/template/system/queryExtension.ts b/packages/global/core/workflow/template/system/queryExtension.ts index 356b1737f4e..6f4358fef4f 100644 --- a/packages/global/core/workflow/template/system/queryExtension.ts +++ b/packages/global/core/workflow/template/system/queryExtension.ts @@ -24,7 +24,7 @@ export const AiQueryExtension: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.queryExtension, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/cfr.svg', + avatar: 'core/workflow/template/queryExtension', name: '问题优化', intro: '使用问题优化功能,可以提高知识库连续对话时搜索的精度。使用该功能后,会先利用 AI 根据上下文构建一个或多个新的检索词,这些检索词更利于进行知识库搜索。该模块已内置在知识库搜索模块中,如果您仅进行一次知识库搜索,可直接使用知识库内置的补全功能。', diff --git a/packages/global/core/workflow/template/system/runApp/index.ts b/packages/global/core/workflow/template/system/runApp/index.ts index ccbfc5c827b..2d30a28ecb5 100644 --- a/packages/global/core/workflow/template/system/runApp/index.ts +++ b/packages/global/core/workflow/template/system/runApp/index.ts @@ -19,7 +19,7 @@ export const RunAppModule: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.runApp, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/app.png', + avatar: 'core/workflow/template/runApp', name: '应用调用', intro: '可以选择一个其他应用进行调用', showStatus: true, diff --git a/packages/global/core/workflow/template/system/sandbox/index.ts b/packages/global/core/workflow/template/system/sandbox/index.ts index 36e2f2867ea..cd8bb00fb4b 100644 --- a/packages/global/core/workflow/template/system/sandbox/index.ts +++ b/packages/global/core/workflow/template/system/sandbox/index.ts @@ -21,7 +21,7 @@ export const CodeNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.code, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/code.svg', + avatar: 'core/workflow/template/codeRun', name: '代码运行', intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。', showStatus: true, diff --git a/packages/global/core/workflow/template/system/stopTool.ts b/packages/global/core/workflow/template/system/stopTool.ts index 8499db6bdd9..c930c1419bd 100644 --- a/packages/global/core/workflow/template/system/stopTool.ts +++ b/packages/global/core/workflow/template/system/stopTool.ts @@ -9,7 +9,7 @@ export const StopToolNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.stopTool, sourceHandle: getHandleConfig(false, false, false, false), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/toolStop.svg', + avatar: 'core/workflow/template/stopTool', name: '工具调用终止', intro: '该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。', diff --git a/packages/global/core/workflow/template/system/systemConfig.ts b/packages/global/core/workflow/template/system/systemConfig.ts index 31836f3a5f3..b037b8f8b1a 100644 --- a/packages/global/core/workflow/template/system/systemConfig.ts +++ b/packages/global/core/workflow/template/system/systemConfig.ts @@ -9,7 +9,7 @@ export const SystemConfigNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.systemConfig, sourceHandle: getHandleConfig(false, false, false, false), targetHandle: getHandleConfig(false, false, false, false), - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', name: '系统配置', intro: '可以配置应用的系统参数。', unique: true, diff --git a/packages/global/core/workflow/template/system/textEditor.ts b/packages/global/core/workflow/template/system/textEditor.ts index b9f630a7a69..fa157e439b9 100644 --- a/packages/global/core/workflow/template/system/textEditor.ts +++ b/packages/global/core/workflow/template/system/textEditor.ts @@ -19,7 +19,7 @@ export const TextEditorNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.textEditor, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/textEditor.svg', + avatar: 'core/workflow/template/textConcat', name: '文本拼接', intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。', version: '486', diff --git a/packages/global/core/workflow/template/system/tools.ts b/packages/global/core/workflow/template/system/tools.ts index c3a043983b9..5ff9f6a4e76 100644 --- a/packages/global/core/workflow/template/system/tools.ts +++ b/packages/global/core/workflow/template/system/tools.ts @@ -26,7 +26,7 @@ export const ToolModule: FlowNodeTemplateType = { templateType: FlowNodeTemplateTypeEnum.ai, sourceHandle: getHandleConfig(true, true, false, true), targetHandle: getHandleConfig(true, true, false, true), - avatar: '/imgs/workflow/tool.svg', + avatar: 'core/workflow/template/toolCall', name: '工具调用', intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。', showStatus: true, diff --git a/packages/global/core/workflow/template/system/variableUpdate/index.tsx b/packages/global/core/workflow/template/system/variableUpdate/index.tsx index 1d7e4936090..1ef323cb264 100644 --- a/packages/global/core/workflow/template/system/variableUpdate/index.tsx +++ b/packages/global/core/workflow/template/system/variableUpdate/index.tsx @@ -13,7 +13,7 @@ export const VariableUpdateNode: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.variableUpdate, sourceHandle: getHandleConfig(true, true, true, true), targetHandle: getHandleConfig(true, true, true, true), - avatar: '/imgs/workflow/variable.png', + avatar: 'core/workflow/template/variableUpdate', name: '变量更新', intro: '可以更新指定节点的输出值或更新全局变量', showStatus: false, diff --git a/packages/global/core/workflow/template/system/workflowStart.ts b/packages/global/core/workflow/template/system/workflowStart.ts index 4eaae7f01f8..d07870a734f 100644 --- a/packages/global/core/workflow/template/system/workflowStart.ts +++ b/packages/global/core/workflow/template/system/workflowStart.ts @@ -14,7 +14,7 @@ export const WorkflowStart: FlowNodeTemplateType = { flowNodeType: FlowNodeTypeEnum.workflowStart, sourceHandle: getHandleConfig(false, true, false, false), targetHandle: getHandleConfig(false, false, false, false), - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', name: '流程开始', intro: '', forbidDelete: true, diff --git a/packages/plugins/src/duckduckgo/search/template.json b/packages/plugins/src/duckduckgo/search/template.json index e4321529aa8..35b283cd7d1 100644 --- a/packages/plugins/src/duckduckgo/search/template.json +++ b/packages/plugins/src/duckduckgo/search/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "DuckDuckGo 网络搜索", - "avatar": "/imgs/workflow/textEditor.svg", + "avatar": "core/workflow/template/duckduckgo", "intro": "使用 DuckDuckGo 进行网络搜索", "showStatus": true, "weight": 10, diff --git a/packages/plugins/src/duckduckgo/searchImg/template.json b/packages/plugins/src/duckduckgo/searchImg/template.json index 58beae5ab7b..28b3e0cc166 100644 --- a/packages/plugins/src/duckduckgo/searchImg/template.json +++ b/packages/plugins/src/duckduckgo/searchImg/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "DuckDuckGo 图片搜索", - "avatar": "/imgs/workflow/textEditor.svg", + "avatar": "core/workflow/template/duckduckgo", "intro": "使用 DuckDuckGo 进行图片搜索", "showStatus": true, "weight": 10, diff --git a/packages/plugins/src/duckduckgo/searchNews/template.json b/packages/plugins/src/duckduckgo/searchNews/template.json index 5e1184d8ff6..a1b85975905 100644 --- a/packages/plugins/src/duckduckgo/searchNews/template.json +++ b/packages/plugins/src/duckduckgo/searchNews/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "DuckDuckGo 新闻检索", - "avatar": "/imgs/workflow/textEditor.svg", + "avatar": "core/workflow/template/duckduckgo", "intro": "使用 DuckDuckGo 进行新闻检索", "showStatus": true, "weight": 10, diff --git a/packages/plugins/src/duckduckgo/searchVideo/template.json b/packages/plugins/src/duckduckgo/searchVideo/template.json index cc39c111f0f..9ab2181e36a 100644 --- a/packages/plugins/src/duckduckgo/searchVideo/template.json +++ b/packages/plugins/src/duckduckgo/searchVideo/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "DuckDuckGo 视频搜索", - "avatar": "/imgs/workflow/textEditor.svg", + "avatar": "core/workflow/template/duckduckgo", "intro": "使用 DuckDuckGo 进行视频搜索", "showStatus": true, "weight": 10, diff --git a/packages/plugins/src/duckduckgo/template.json b/packages/plugins/src/duckduckgo/template.json index e613168a0e3..0e70509a0d9 100644 --- a/packages/plugins/src/duckduckgo/template.json +++ b/packages/plugins/src/duckduckgo/template.json @@ -1,14 +1,14 @@ { "author": "FastGPT", "version": "486", - "name": "DuckDuckGo", - "avatar": "/imgs/workflow/textEditor.svg", + "name": "DuckDuckGo服务", + "avatar": "core/workflow/template/duckduckgo", "intro": "DuckDuckGo 服务", "showStatus": false, "weight": 10, "isTool": true, - "templateType": "search", + "templateType": "tools", "workflow": { "nodes": [], diff --git a/packages/plugins/src/fetchUrl/template.json b/packages/plugins/src/fetchUrl/template.json index b0798c1c932..5f8b359c1bf 100644 --- a/packages/plugins/src/fetchUrl/template.json +++ b/packages/plugins/src/fetchUrl/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "网页内容抓取", - "avatar": "/imgs/workflow/fetchUrl.png", + "avatar": "core/workflow/template/fetchUrl", "intro": "可获取一个网页链接内容,并以 Markdown 格式输出,仅支持获取静态网站。", "showStatus": true, "weight": 10, diff --git a/packages/plugins/src/getTime/template.json b/packages/plugins/src/getTime/template.json index f402d875939..6f87f66f9cf 100644 --- a/packages/plugins/src/getTime/template.json +++ b/packages/plugins/src/getTime/template.json @@ -3,7 +3,7 @@ "version": "481", "templateType": "tools", "name": "获取当前时间", - "avatar": "/imgs/workflow/getCurrentTime.png", + "avatar": "core/workflow/template/getTime", "intro": "获取用户当前时区的时间。", "showStatus": false, "isTool": true, diff --git a/packages/plugins/src/mathExprVal/template.json b/packages/plugins/src/mathExprVal/template.json index dbcc0bff8e5..5cc829301a4 100644 --- a/packages/plugins/src/mathExprVal/template.json +++ b/packages/plugins/src/mathExprVal/template.json @@ -2,7 +2,7 @@ "author": "FastGPT", "version": "486", "name": "数学公式执行", - "avatar": "/imgs/workflow/mathExprEval.png", + "avatar": "core/workflow/template/mathCall", "intro": "用于执行数学表达式的工具,通过 js 的 expr-eval 库运行表达式并返回结果。", "showStatus": false, "weight": 10, diff --git a/packages/web/components/common/Avatar/index.tsx b/packages/web/components/common/Avatar/index.tsx index 3c802866b1c..4546d6d6a89 100644 --- a/packages/web/components/common/Avatar/index.tsx +++ b/packages/web/components/common/Avatar/index.tsx @@ -10,7 +10,7 @@ const Avatar = ({ w = '30px', src, ...props }: ImageProps) => { const isIcon = !!iconPaths[src as any]; return isIcon ? ( - + ) : ( import('./icons/core/workflow/runSkip.svg'), 'core/workflow/runSuccess': () => import('./icons/core/workflow/runSuccess.svg'), 'core/workflow/running': () => import('./icons/core/workflow/running.svg'), + 'core/workflow/template/FileRead': () => import('./icons/core/workflow/template/FileRead.svg'), + 'core/workflow/template/aiChat': () => import('./icons/core/workflow/template/aiChat.svg'), + 'core/workflow/template/codeRun': () => import('./icons/core/workflow/template/codeRun.svg'), + 'core/workflow/template/customFeedback': () => + import('./icons/core/workflow/template/customFeedback.svg'), + 'core/workflow/template/datasetConcat': () => + import('./icons/core/workflow/template/datasetConcat.svg'), + 'core/workflow/template/datasetSearch': () => + import('./icons/core/workflow/template/datasetSearch.svg'), + 'core/workflow/template/duckduckgo': () => + import('./icons/core/workflow/template/duckduckgo.svg'), + 'core/workflow/template/extractJson': () => + import('./icons/core/workflow/template/extractJson.svg'), + 'core/workflow/template/fetchUrl': () => import('./icons/core/workflow/template/fetchUrl.svg'), + 'core/workflow/template/getTime': () => import('./icons/core/workflow/template/getTime.svg'), + 'core/workflow/template/httpRequest': () => + import('./icons/core/workflow/template/httpRequest.svg'), + 'core/workflow/template/ifelse': () => import('./icons/core/workflow/template/ifelse.svg'), + 'core/workflow/template/lafDispatch': () => + import('./icons/core/workflow/template/lafDispatch.svg'), + 'core/workflow/template/mathCall': () => import('./icons/core/workflow/template/mathCall.svg'), + 'core/workflow/template/pluginOutput': () => + import('./icons/core/workflow/template/pluginOutput.svg'), + 'core/workflow/template/queryExtension': () => + import('./icons/core/workflow/template/queryExtension.svg'), + 'core/workflow/template/questionClassify': () => + import('./icons/core/workflow/template/questionClassify.svg'), + 'core/workflow/template/reply': () => import('./icons/core/workflow/template/reply.svg'), + 'core/workflow/template/runApp': () => import('./icons/core/workflow/template/runApp.svg'), + 'core/workflow/template/stopTool': () => import('./icons/core/workflow/template/stopTool.svg'), + 'core/workflow/template/systemConfig': () => + import('./icons/core/workflow/template/systemConfig.svg'), + 'core/workflow/template/textConcat': () => + import('./icons/core/workflow/template/textConcat.svg'), + 'core/workflow/template/toolCall': () => import('./icons/core/workflow/template/toolCall.svg'), + 'core/workflow/template/variableUpdate': () => + import('./icons/core/workflow/template/variableUpdate.svg'), + 'core/workflow/template/workflowStart': () => + import('./icons/core/workflow/template/workflowStart.svg'), 'core/workflow/versionHistories': () => import('./icons/core/workflow/versionHistories.svg'), date: () => import('./icons/date.svg'), delete: () => import('./icons/delete.svg'), diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/FileRead.svg b/packages/web/components/common/Icon/icons/core/workflow/template/FileRead.svg new file mode 100644 index 00000000000..966b1aa54cb --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/FileRead.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/aiChat.svg b/packages/web/components/common/Icon/icons/core/workflow/template/aiChat.svg new file mode 100644 index 00000000000..c852f45d7fc --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/aiChat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/codeRun.svg b/packages/web/components/common/Icon/icons/core/workflow/template/codeRun.svg new file mode 100644 index 00000000000..b6e9779bc6d --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/codeRun.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/customFeedback.svg b/packages/web/components/common/Icon/icons/core/workflow/template/customFeedback.svg new file mode 100644 index 00000000000..517b88e19f9 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/customFeedback.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/datasetConcat.svg b/packages/web/components/common/Icon/icons/core/workflow/template/datasetConcat.svg new file mode 100644 index 00000000000..680d1e2cb3e --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/datasetConcat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/datasetSearch.svg b/packages/web/components/common/Icon/icons/core/workflow/template/datasetSearch.svg new file mode 100644 index 00000000000..7127308b473 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/datasetSearch.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/duckduckgo.svg b/packages/web/components/common/Icon/icons/core/workflow/template/duckduckgo.svg new file mode 100644 index 00000000000..3ab30101c21 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/duckduckgo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/extractJson.svg b/packages/web/components/common/Icon/icons/core/workflow/template/extractJson.svg new file mode 100644 index 00000000000..63426bbe8e8 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/extractJson.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/fetchUrl.svg b/packages/web/components/common/Icon/icons/core/workflow/template/fetchUrl.svg new file mode 100644 index 00000000000..d91c05df081 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/fetchUrl.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/getTime.svg b/packages/web/components/common/Icon/icons/core/workflow/template/getTime.svg new file mode 100644 index 00000000000..3a70e9f49a8 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/getTime.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/httpRequest.svg b/packages/web/components/common/Icon/icons/core/workflow/template/httpRequest.svg new file mode 100644 index 00000000000..ac7b79fd872 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/httpRequest.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/ifelse.svg b/packages/web/components/common/Icon/icons/core/workflow/template/ifelse.svg new file mode 100644 index 00000000000..f6a8dae00ca --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/ifelse.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/lafDispatch.svg b/packages/web/components/common/Icon/icons/core/workflow/template/lafDispatch.svg new file mode 100644 index 00000000000..89a94778e05 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/lafDispatch.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/mathCall.svg b/packages/web/components/common/Icon/icons/core/workflow/template/mathCall.svg new file mode 100644 index 00000000000..e389218b4c1 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/mathCall.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/pluginOutput.svg b/packages/web/components/common/Icon/icons/core/workflow/template/pluginOutput.svg new file mode 100644 index 00000000000..a5b9ca0b7b5 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/pluginOutput.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/queryExtension.svg b/packages/web/components/common/Icon/icons/core/workflow/template/queryExtension.svg new file mode 100644 index 00000000000..691161c3b12 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/queryExtension.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/questionClassify.svg b/packages/web/components/common/Icon/icons/core/workflow/template/questionClassify.svg new file mode 100644 index 00000000000..7e817735b19 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/questionClassify.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/reply.svg b/packages/web/components/common/Icon/icons/core/workflow/template/reply.svg new file mode 100644 index 00000000000..142bc9f5108 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/reply.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/runApp.svg b/packages/web/components/common/Icon/icons/core/workflow/template/runApp.svg new file mode 100644 index 00000000000..1f3b1ad5e41 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/runApp.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/stopTool.svg b/packages/web/components/common/Icon/icons/core/workflow/template/stopTool.svg new file mode 100644 index 00000000000..216381e4350 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/stopTool.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/systemConfig.svg b/packages/web/components/common/Icon/icons/core/workflow/template/systemConfig.svg new file mode 100644 index 00000000000..b1f010d9f59 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/systemConfig.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/textConcat.svg b/packages/web/components/common/Icon/icons/core/workflow/template/textConcat.svg new file mode 100644 index 00000000000..3b44b470d78 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/textConcat.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/toolCall.svg b/packages/web/components/common/Icon/icons/core/workflow/template/toolCall.svg new file mode 100644 index 00000000000..575bb2b5de9 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/toolCall.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/variableUpdate.svg b/packages/web/components/common/Icon/icons/core/workflow/template/variableUpdate.svg new file mode 100644 index 00000000000..9fed569cfe7 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/variableUpdate.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/workflowStart.svg b/packages/web/components/common/Icon/icons/core/workflow/template/workflowStart.svg new file mode 100644 index 00000000000..4cd6718fe84 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/workflowStart.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/web/components/common/MyModal/index.tsx b/packages/web/components/common/MyModal/index.tsx index 3f707575ba7..b38b440148e 100644 --- a/packages/web/components/common/MyModal/index.tsx +++ b/packages/web/components/common/MyModal/index.tsx @@ -12,6 +12,7 @@ import { import MyIcon from '../Icon'; import MyBox from '../MyBox'; import { useSystem } from '../../../hooks/useSystem'; +import Avatar from '../Avatar'; export interface MyModalProps extends ModalContentProps { iconSrc?: string; @@ -68,14 +69,18 @@ const MyModal = ({ > {iconSrc && ( <> - {iconSrc.startsWith('/') ? ( - - ) : ( - - )} + )} - {title} + + {title} + {onClose && ( diff --git a/packages/web/components/common/Tabs/LightRowTabs.tsx b/packages/web/components/common/Tabs/LightRowTabs.tsx index 110dc128e7a..069d290dc67 100644 --- a/packages/web/components/common/Tabs/LightRowTabs.tsx +++ b/packages/web/components/common/Tabs/LightRowTabs.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import { Box, Flex, Grid, Image } from '@chakra-ui/react'; import type { FlexProps, GridProps } from '@chakra-ui/react'; import { useTranslation } from 'next-i18next'; -import MyIcon from '../Icon'; +import Avatar from '../Avatar'; type Props = Omit & { list: { icon?: string; label: string | React.ReactNode; value: ValueType }[]; @@ -81,14 +81,10 @@ const LightRowTabs = ({ > {item.icon && ( <> - {item.icon.startsWith('/') ? ( - {''} - ) : ( - - )} + )} - {typeof item.label === 'string' ? t(item.label as any) : item.label} + {typeof item.label === 'string' ? t(item.label as any) : item.label} ))} diff --git a/packages/web/i18n/en/app.json b/packages/web/i18n/en/app.json index 7e6b0dfac82..b17c41ec84f 100644 --- a/packages/web/i18n/en/app.json +++ b/packages/web/i18n/en/app.json @@ -40,9 +40,9 @@ "My Apps": "My Apps", "Output Field Settings": "Output Field Settings", "Paste Config": "Paste Config", + "Plugin cost per times": "{{cost}}/per time", "Plugin dispatch": "Plugins", "Plugin dispatch tip": "It is up to the model to decide which plug-ins to add additional capabilities to. If the plug-in is selected, the knowledge base call is also treated as a special plug-in.", - "Plugin cost per times": "{{cost}}/per time", "Publish channel": "Publish channel", "Publish success": "Publish success", "Run": "Run", @@ -61,6 +61,9 @@ "has new version": "has new version" } }, + "common": { + "Plugin cost per times": "{{cost}} points/times" + }, "module": { "Combine Modules": "Combine Modules", "Confirm Sync": "The template will be updated to the latest template configuration. Fields that do not exist in the template will be deleted (including all custom fields). You are advised to make a copy of the node and then update the original node version.", diff --git a/packages/web/i18n/zh/app.json b/packages/web/i18n/zh/app.json index 1684701d14b..09f00921990 100644 --- a/packages/web/i18n/zh/app.json +++ b/packages/web/i18n/zh/app.json @@ -39,9 +39,9 @@ "My Apps": "我的应用", "Output Field Settings": "输出字段编辑", "Paste Config": "粘贴配置", + "Plugin cost per times": "{{cost}}/次", "Plugin dispatch": "插件调用", "Plugin dispatch tip": "给模型附加额外的能力,具体调用哪些插件,将由模型自主决定。\n若选择了插件,知识库调用将自动作为一个特殊的插件。", - "Plugin cost per times": "{{cost}}/次", "Publish channel": "发布渠道", "Publish success": "发布成功", "Run": "运行", @@ -60,6 +60,9 @@ "has new version": "有新版本" } }, + "common": { + "Plugin cost per times": "{{cost}}积分/次" + }, "module": { "Combine Modules": "组合模块", "Confirm Sync": "将会更新至最新的模板配置,不存在模板中的字段将会被删除(包括所有自定义字段),建议您先复制一份节点,再更新原来节点的版本。", diff --git a/projects/app/public/imgs/app/inputGuide-icon.svg b/projects/app/public/imgs/app/inputGuide-icon.svg index beeb3727699..d9929dcac94 100644 --- a/projects/app/public/imgs/app/inputGuide-icon.svg +++ b/projects/app/public/imgs/app/inputGuide-icon.svg @@ -1,4 +1,4 @@ - + diff --git a/projects/app/public/imgs/app/nextQuestion-icon.svg b/projects/app/public/imgs/app/nextQuestion-icon.svg index 846196f9fe7..8a921eafe14 100644 --- a/projects/app/public/imgs/app/nextQuestion-icon.svg +++ b/projects/app/public/imgs/app/nextQuestion-icon.svg @@ -1,4 +1,4 @@ - + diff --git a/projects/app/public/imgs/app/welcome-icon.svg b/projects/app/public/imgs/app/welcome-icon.svg index b8fbf3f031d..cfc1a0838b3 100644 --- a/projects/app/public/imgs/app/welcome-icon.svg +++ b/projects/app/public/imgs/app/welcome-icon.svg @@ -1,4 +1,4 @@ - + diff --git a/projects/app/public/imgs/workflow/fetchUrl.png b/projects/app/public/imgs/workflow/fetchUrl.png deleted file mode 100644 index 43a6c3519e5..00000000000 Binary files a/projects/app/public/imgs/workflow/fetchUrl.png and /dev/null differ diff --git a/projects/app/public/imgs/workflow/fetchUrl.svg b/projects/app/public/imgs/workflow/fetchUrl.svg index 5136500ec34..d75c79a38c6 100644 --- a/projects/app/public/imgs/workflow/fetchUrl.svg +++ b/projects/app/public/imgs/workflow/fetchUrl.svg @@ -1,4 +1,4 @@ - + 🌐 diff --git a/projects/app/public/imgs/workflow/getCurrentTime.png b/projects/app/public/imgs/workflow/getCurrentTime.png deleted file mode 100644 index 5bd2970cda0..00000000000 Binary files a/projects/app/public/imgs/workflow/getCurrentTime.png and /dev/null differ diff --git a/projects/app/public/imgs/workflow/getCurrentTime.svg b/projects/app/public/imgs/workflow/getCurrentTime.svg index f5f5cc225a8..5eb4f81b568 100644 --- a/projects/app/public/imgs/workflow/getCurrentTime.svg +++ b/projects/app/public/imgs/workflow/getCurrentTime.svg @@ -1,4 +1,4 @@ - + diff --git a/projects/app/public/imgs/workflow/mathExprEval.png b/projects/app/public/imgs/workflow/mathExprEval.png deleted file mode 100644 index bde2b1b477b..00000000000 Binary files a/projects/app/public/imgs/workflow/mathExprEval.png and /dev/null differ diff --git a/projects/app/public/imgs/workflow/mathExprEval.svg b/projects/app/public/imgs/workflow/mathExprEval.svg index 269ee1a8a2c..866b6ed6de7 100644 --- a/projects/app/public/imgs/workflow/mathExprEval.svg +++ b/projects/app/public/imgs/workflow/mathExprEval.svg @@ -1,4 +1,4 @@ - + diff --git a/projects/app/src/components/core/chat/components/AIResponseBox.tsx b/projects/app/src/components/core/chat/components/AIResponseBox.tsx index cc5bbb9ec60..770f202545d 100644 --- a/projects/app/src/components/core/chat/components/AIResponseBox.tsx +++ b/projects/app/src/components/core/chat/components/AIResponseBox.tsx @@ -81,12 +81,14 @@ ${JSON.stringify(questionGuides)}`; borderWidth={'1px'} borderColor={'myGray.200'} boxShadow={'1'} + pl={3} + pr={2.5} _hover={{ bg: 'auto' }} > - - + + {tool.toolName} {isChatting && !tool.response && } diff --git a/projects/app/src/components/core/chat/components/WholeResponseModal.tsx b/projects/app/src/components/core/chat/components/WholeResponseModal.tsx index dfdac7e665e..62e8ba00a53 100644 --- a/projects/app/src/components/core/chat/components/WholeResponseModal.tsx +++ b/projects/app/src/components/core/chat/components/WholeResponseModal.tsx @@ -12,6 +12,7 @@ import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constants'; import { formatNumber } from '@fastgpt/global/common/math/tools'; import { useI18n } from '@/web/context/I18n'; import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip'; +import Avatar from '@fastgpt/web/components/common/Avatar'; function RowRender({ children, @@ -125,18 +126,18 @@ export const ResponseBox = React.memo(function ResponseBox({ () => response.map((item, i) => ({ label: ( - - + item.moduleType === template.flowNodeType) ?.avatar } alt={''} - w={['14px', '16px']} + w={'1.25rem'} + borderRadius={'sm'} /> - {t(item.moduleName as any)} + {t(item.moduleName as any)} ), value: `${i}` @@ -334,7 +335,9 @@ export const ResponseBox = React.memo(function ResponseBox({ + + + } /> )} @@ -350,7 +353,11 @@ export const ResponseBox = React.memo(function ResponseBox({ {activeModule?.toolDetail && activeModule?.toolDetail.length > 0 && ( } + rawDom={ + + + + } /> )} diff --git a/projects/app/src/pages/app/detail/components/SimpleApp/EditForm.tsx b/projects/app/src/pages/app/detail/components/SimpleApp/EditForm.tsx index 6dc1905ce26..fd2205e64b3 100644 --- a/projects/app/src/pages/app/detail/components/SimpleApp/EditForm.tsx +++ b/projects/app/src/pages/app/detail/components/SimpleApp/EditForm.tsx @@ -242,8 +242,15 @@ const EditForm = ({ }) } > - - + + {item.name} @@ -292,8 +299,15 @@ const EditForm = ({ borderColor: 'primary.300' }} > - - + + {item.name} - {item.avatar?.startsWith('/') ? ( - - ) : ( - - )} - + + {t(item.name as any)} - {t(item.intro as any) || t('core.workflow.Not intro')} + {t(item.intro as any) || t('common:core.workflow.Not intro')} {showCost && ( <> - {t('core.plugin.cost')} + {t('common:core.plugin.cost')} {item.currentCost && item.currentCost > 0 - ? appT('Plugin cost per times', { cost: item.currentCost }) - : t('core.plugin.Free')} + ? t('app:Plugin cost per times', { cost: item.currentCost }) + : t('common:core.plugin.Free')} @@ -262,17 +263,9 @@ const RenderList = React.memo(function RenderList({ bg: 'myGray.50' }} > - {item.avatar?.startsWith('/') ? ( - - ) : ( - - )} - + + + {t(item.name as any)} {showCost && ( @@ -287,11 +280,11 @@ const RenderList = React.memo(function RenderList({ leftIcon={} onClick={() => onRemoveTool(item)} > - {t('common.Remove')} + {t('common:common.Remove')} ) : item.isFolder ? ( ) : ( )} diff --git a/projects/app/src/pages/app/detail/components/Workflow/Header.tsx b/projects/app/src/pages/app/detail/components/Workflow/Header.tsx index e1d9b6ff989..af3e1db6381 100644 --- a/projects/app/src/pages/app/detail/components/Workflow/Header.tsx +++ b/projects/app/src/pages/app/detail/components/Workflow/Header.tsx @@ -10,7 +10,6 @@ import { WorkflowContext, getWorkflowStore } from '../WorkflowComponents/context import { useInterval } from 'ahooks'; import { AppContext, TabEnum } from '../context'; import RouteTab from '../RouteTab'; -import { useSystemStore } from '@/web/common/system/useSystemStore'; import PopoverConfirm from '@fastgpt/web/components/common/MyPopover/PopoverConfirm'; import { useRouter } from 'next/router'; diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/NodeTemplatesModal.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/NodeTemplatesModal.tsx index 7761eb4ed66..3e08934d1d3 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/NodeTemplatesModal.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/NodeTemplatesModal.tsx @@ -300,7 +300,6 @@ const RenderList = React.memo(function RenderList({ const { isPc } = useSystem(); const isSystemPlugin = type === TemplateTypeEnum.systemPlugin; - const avatarSize = type === TemplateTypeEnum.teamPlugin ? '1.75rem' : '2.25rem'; const { x, y, zoom } = useViewport(); const { setLoading } = useSystemStore(); @@ -405,7 +404,7 @@ const RenderList = React.memo(function RenderList({ > {item.label && formatTemplates.length > 1 && ( - + {t(item.label as any)} @@ -419,17 +418,13 @@ const RenderList = React.memo(function RenderList({ label={ - {template.avatar?.startsWith('/') ? ( - - ) : ( - - )} - + + {t(template.name as any)} @@ -440,11 +435,13 @@ const RenderList = React.memo(function RenderList({ <> - {t('core.plugin.cost')} + {t('common:core.plugin.cost')} {template.currentCost && template.currentCost > 0 - ? appT('Plugin cost per times', { cost: template.currentCost }) - : t('core.plugin.Free')} + ? t('app:Plugin cost per times', { + cost: template.currentCost + }) + : t('common:core.plugin.Free')} @@ -484,17 +481,19 @@ const RenderList = React.memo(function RenderList({ onClose(); }} > - {template.avatar?.startsWith('/') ? ( - - ) : ( - - )} - + + {t(template.name as any)} {template.author && ( @@ -513,7 +512,6 @@ const RenderList = React.memo(function RenderList({ ); }, [ appT, - avatarSize, formatTemplates, isPc, isSystemPlugin, diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx index 55f15029ea0..4ab4853db0e 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx @@ -137,7 +137,7 @@ const NodeCard = (props: Props) => { {/* avatar and name */} - + {t(name as any)} diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx index 7d06d938f00..5ae2f304454 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx @@ -120,8 +120,8 @@ export const useReference = ({ return { label: ( - - {t(node.name as any)} + + {t(node.name as any)} ), value: node.nodeId, diff --git a/projects/app/src/pages/app/list/components/CreateModal.tsx b/projects/app/src/pages/app/list/components/CreateModal.tsx index ee18e0db65c..eb74fb5a587 100644 --- a/projects/app/src/pages/app/list/components/CreateModal.tsx +++ b/projects/app/src/pages/app/list/components/CreateModal.tsx @@ -195,7 +195,7 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo }} > - + {t(item.name as any)} diff --git a/projects/app/src/web/core/app/templates.ts b/projects/app/src/web/core/app/templates.ts index a8d58af78d5..cfec8b621d3 100644 --- a/projects/app/src/web/core/app/templates.ts +++ b/projects/app/src/web/core/app/templates.ts @@ -22,7 +22,7 @@ type TemplateType = (AppItemType & { export const simpleBotTemplates: TemplateType = [ { id: 'simpleChat', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', name: '简易机器人', intro: '一个极其简单的 AI 应用,你可以绑定知识库或工具。', type: AppTypeEnum.simple, @@ -31,7 +31,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: FlowNodeTypeEnum.systemConfig, position: { x: 531.2422736065552, @@ -94,7 +94,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: '448745', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.workflowStart, position: { x: 558.4082376415505, @@ -125,7 +125,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'loOvhld2ZTKa', name: 'AI 对话', intro: 'AI 大模型对话', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', flowNodeType: FlowNodeTypeEnum.chatNode, showStatus: true, position: { @@ -252,7 +252,7 @@ export const simpleBotTemplates: TemplateType = [ }, { id: 'chatGuide', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', name: '对话引导 + 变量', intro: '可以在对话开始发送一段提示,或者让用户填写一些内容,作为本次对话的变量', type: AppTypeEnum.simple, @@ -261,7 +261,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: FlowNodeTypeEnum.systemConfig, position: { x: 496.57560693988853, @@ -341,7 +341,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: '448745', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.workflowStart, position: { x: 558.4082376415505, @@ -372,7 +372,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'loOvhld2ZTKa', name: 'AI 对话', intro: 'AI 大模型对话', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', flowNodeType: FlowNodeTypeEnum.chatNode, showStatus: true, position: { @@ -499,7 +499,7 @@ export const simpleBotTemplates: TemplateType = [ }, { id: 'simpleDatasetChat', - avatar: '/imgs/workflow/db.png', + avatar: 'core/workflow/template/datasetSearch', name: '知识库+对话引导', intro: '每次提问时进行一次知识库搜索,将搜索结果注入 LLM 模型进行参考回答', type: AppTypeEnum.simple, @@ -508,7 +508,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: FlowNodeTypeEnum.systemConfig, position: { x: 531.2422736065552, @@ -571,7 +571,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'workflowStartNodeId', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.workflowStart, position: { x: 558.4082376415505, @@ -602,7 +602,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: '7BdojPlukIQw', name: 'AI 对话', intro: 'AI 大模型对话', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', flowNodeType: FlowNodeTypeEnum.chatNode, showStatus: true, position: { @@ -722,7 +722,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'iKBoX2vIzETU', name: '知识库搜索', intro: '调用“语义检索”和“全文检索”能力,从“知识库”中查找可能与问题相关的参考内容', - avatar: '/imgs/workflow/db.png', + avatar: 'core/workflow/template/datasetSearch', flowNodeType: FlowNodeTypeEnum.datasetSearchNode, showStatus: true, position: { @@ -827,7 +827,7 @@ export const simpleBotTemplates: TemplateType = [ }, { id: 'toolChat', - avatar: '/imgs/workflow/history.png', + avatar: 'core/workflow/template/getTime', name: '知道时间的机器人', intro: '通过挂载时间插件,让模型获取当前最新时间', type: AppTypeEnum.simple, @@ -836,7 +836,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: FlowNodeTypeEnum.systemConfig, position: { x: 531.2422736065552, @@ -850,7 +850,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'workflowStartNodeId', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.workflowStart, position: { x: 558.4082376415505, @@ -881,7 +881,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'jrWPV9', name: '工具调用', intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。', - avatar: '/imgs/workflow/tool.svg', + avatar: 'core/workflow/template/toolCall', flowNodeType: FlowNodeTypeEnum.tools, showStatus: true, position: { @@ -963,7 +963,7 @@ export const simpleBotTemplates: TemplateType = [ nodeId: 'zBxjo5', name: '获取当前时间', intro: '获取用户当前时区的时间。', - avatar: '/imgs/workflow/getCurrentTime.svg', + avatar: 'core/workflow/template/getTime', flowNodeType: 'pluginModule', showStatus: false, position: { @@ -1021,7 +1021,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: 'userGuide', position: { x: 531.2422736065552, @@ -1084,7 +1084,7 @@ export const workflowTemplates: TemplateType = [ nodeId: '448745', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: 'workflowStart', position: { x: 558.4082376415505, @@ -1115,7 +1115,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'loOvhld2ZTKa', name: '第一轮翻译', intro: 'AI 大模型对话', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', flowNodeType: 'chatNode', showStatus: true, position: { @@ -1235,7 +1235,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'w0oBbQ3YJHye', name: '代码运行', intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。', - avatar: '/imgs/workflow/code.svg', + avatar: 'core/workflow/template/codeRun', flowNodeType: 'code', showStatus: true, position: { @@ -1348,7 +1348,7 @@ export const workflowTemplates: TemplateType = [ name: '指定回复', intro: '该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。', - avatar: '/imgs/workflow/reply.png', + avatar: 'core/workflow/template/reply', flowNodeType: 'answerNode', position: { x: 3798.4479531204515, @@ -1374,7 +1374,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'gBDvemE4FBhp', name: '文本拼接', intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。', - avatar: '/imgs/workflow/textEditor.svg', + avatar: 'core/workflow/template/textConcat', flowNodeType: 'textEditor', position: { x: 1031.371061396644, @@ -1463,7 +1463,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'bcqtxqxE2R6o', name: '合并输出结果', intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。', - avatar: '/imgs/workflow/textEditor.svg', + avatar: 'core/workflow/template/textConcat', flowNodeType: 'textEditor', position: { x: 3113.6227559936665, @@ -1593,7 +1593,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: 'userGuide', position: { x: 262.2732338817093, @@ -1656,7 +1656,7 @@ export const workflowTemplates: TemplateType = [ nodeId: '448745', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: 'workflowStart', position: { x: 295.8944548701009, @@ -1687,7 +1687,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'NOgbnBzUwDgT', name: '工具调用', intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。', - avatar: '/imgs/workflow/tool.svg', + avatar: 'core/workflow/template/toolCall', flowNodeType: 'tools', showStatus: true, position: { @@ -1769,7 +1769,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'GMELVPxHfpg5', name: 'HTTP 请求', intro: '调用谷歌搜索,查询相关内容', - avatar: '/imgs/workflow/http.png', + avatar: 'core/workflow/template/httpRequest', flowNodeType: 'httpRequest468', showStatus: true, position: { @@ -1914,7 +1914,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'poIbrrA8aiR0', name: '代码运行', intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。', - avatar: '/imgs/workflow/code.svg', + avatar: 'core/workflow/template/codeRun', flowNodeType: 'code', showStatus: true, position: { @@ -2032,7 +2032,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: 'userGuide', position: { x: 531.2422736065552, @@ -2095,7 +2095,7 @@ export const workflowTemplates: TemplateType = [ nodeId: '448745', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: 'workflowStart', position: { x: 532.1275542407774, @@ -2126,7 +2126,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'tMyUnRL5jIrC', name: 'HTTP 请求', intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)', - avatar: '/imgs/workflow/http.png', + avatar: 'core/workflow/template/httpRequest', flowNodeType: 'httpRequest468', showStatus: true, position: { @@ -2291,7 +2291,7 @@ export const workflowTemplates: TemplateType = [ name: '指定回复', intro: '该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。', - avatar: '/imgs/workflow/reply.png', + avatar: 'core/workflow/template/reply', flowNodeType: 'answerNode', position: { x: 2204.4609372615846, @@ -2317,7 +2317,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'vEXJF8pQ8eOv', name: '文本拼接', intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。', - avatar: '/imgs/workflow/textEditor.svg', + avatar: 'core/workflow/template/textConcat', flowNodeType: 'textEditor', position: { x: 1544.8821308368042, @@ -2426,7 +2426,7 @@ export const workflowTemplates: TemplateType = [ }, { id: 'CQ', - avatar: '/imgs/workflow/cq.png', + avatar: 'core/workflow/template/questionClassify', name: '问题分类 + 知识库', intro: '先对用户的问题进行分类,再根据不同类型问题,执行不同的操作', type: AppTypeEnum.workflow, @@ -2435,7 +2435,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'userGuide', name: '系统配置', intro: '可以配置应用的系统参数', - avatar: '/imgs/workflow/userGuide.png', + avatar: 'core/workflow/template/systemConfig', flowNodeType: FlowNodeTypeEnum.systemConfig, position: { x: 531.2422736065552, @@ -2498,7 +2498,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'workflowStartNodeId', name: '流程开始', intro: '', - avatar: '/imgs/workflow/userChatInput.svg', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.workflowStart, position: { x: 558.4082376415505, @@ -2529,7 +2529,7 @@ export const workflowTemplates: TemplateType = [ nodeId: '7BdojPlukIQw', name: 'AI 对话', intro: 'AI 大模型对话', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', flowNodeType: FlowNodeTypeEnum.chatNode, showStatus: true, position: { @@ -2650,7 +2650,7 @@ export const workflowTemplates: TemplateType = [ name: '问题分类', intro: '根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题', - avatar: '/imgs/workflow/cq.png', + avatar: 'core/workflow/template/questionClassify', flowNodeType: FlowNodeTypeEnum.classifyQuestion, showStatus: true, position: { @@ -2732,7 +2732,7 @@ export const workflowTemplates: TemplateType = [ name: '指定回复', intro: '该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。', - avatar: '/imgs/workflow/reply.png', + avatar: 'core/workflow/template/reply', flowNodeType: FlowNodeTypeEnum.answerNode, position: { x: 1874.9167551056487, @@ -2757,7 +2757,7 @@ export const workflowTemplates: TemplateType = [ nodeId: 'MNMMMIjjWyMU', name: '知识库搜索', intro: '调用“语义检索”和“全文检索”能力,从“知识库”中查找可能与问题相关的参考内容', - avatar: '/imgs/workflow/db.png', + avatar: 'core/workflow/template/datasetSearch', flowNodeType: FlowNodeTypeEnum.datasetSearchNode, showStatus: true, position: { @@ -2883,7 +2883,7 @@ export const workflowTemplates: TemplateType = [ export const pluginTemplates: TemplateType = [ { id: 'plugin-simple', - avatar: '/imgs/workflow/AI.png', + avatar: 'core/workflow/template/aiChat', name: '默认模板', intro: '标准的插件初始模板', type: AppTypeEnum.plugin, @@ -2891,7 +2891,7 @@ export const pluginTemplates: TemplateType = [ { nodeId: 'pluginInput', name: '自定义插件输入', - avatar: '/imgs/workflow/input.png', + avatar: 'core/workflow/template/workflowStart', flowNodeType: FlowNodeTypeEnum.pluginInput, showStatus: false, position: { @@ -2930,7 +2930,7 @@ export const pluginTemplates: TemplateType = [ nodeId: 'pluginInput', name: '自定义插件输入', intro: '自定义配置外部输入,使用插件时,仅暴露自定义配置的输入', - avatar: '/imgs/workflow/input.png', + avatar: 'core/workflow/template/workflowStart', flowNodeType: 'pluginInput', showStatus: false, position: { @@ -3015,7 +3015,7 @@ export const pluginTemplates: TemplateType = [ nodeId: 'rKBYGQuYefae', name: 'HTTP 请求', intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)', - avatar: '/imgs/workflow/http.png', + avatar: 'core/workflow/template/httpRequest', flowNodeType: 'httpRequest468', showStatus: true, position: { diff --git a/projects/app/src/web/core/workflow/utils.ts b/projects/app/src/web/core/workflow/utils.ts index cdca446b642..0a54c6b93d3 100644 --- a/projects/app/src/web/core/workflow/utils.ts +++ b/projects/app/src/web/core/workflow/utils.ts @@ -84,6 +84,7 @@ export const storeNode2FlowNode = ({ const nodeItem: FlowNodeItemType = { ...template, ...storeNode, + avatar: template.avatar ?? storeNode.avatar, version: storeNode.version ?? template.version ?? defaultNodeVersion, /*