diff --git a/projects/app/public/appMarketTemplates/Chinese/avatar.svg b/projects/app/public/appMarketTemplates/Chinese/avatar.svg
new file mode 100644
index 000000000000..a3b2783c583d
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/Chinese/avatar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/projects/app/public/appMarketTemplates/Chinese/template.json b/projects/app/public/appMarketTemplates/Chinese/template.json
new file mode 100644
index 000000000000..bc6d8728828e
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/Chinese/template.json
@@ -0,0 +1,501 @@
+{
+ "name": "汉语新解",
+ "intro": "生成汉语释义图",
+ "author": "",
+ "avatar": "/appMarketTemplates/Chinese/avatar.svg",
+ "tags": ["roleplay"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "common:core.module.template.system_config",
+ "intro": "common:core.module.template.system_config_info",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": 262.2732338817093,
+ "y": -476.00241136598146
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "common:core.module.template.work_start",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": 632.368838596004,
+ "y": -347.7446492944009
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "common:core.module.input.label.user question",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "bg853CwHAw4a",
+ "name": "AI 对话",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 1318.728987052518,
+ "y": -612.0024113659815
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "AI 模型",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "claude-3-5-sonnet-20240620"
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 0,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 2000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": false,
+ "valueType": "boolean",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "提示词",
+ "description": "core.app.tip.chatNodeSystemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "{提示词 START:\n;; 作者: 李继刚\n;; 版本: 0.3\n;; 模型: Claude Sonnet\n;; 用途: 将一个汉语词汇进行全新角度的解释\n\n;; 设定如下内容为你的 *System Prompt*\n(defun 新汉语老师 ()\n \"你是年轻人,批判现实,思考深刻,语言风趣\"\n (风格 . (\"Oscar Wilde\" \"鲁迅\" \"罗永浩\"))\n (擅长 . 一针见血)\n (表达 . 隐喻)\n (批判 . 讽刺幽默))\n\n(defun 汉语新解 (用户输入)\n \"你会用一个特殊视角来解释一个词汇\"\n (let (解释 (精练表达\n (隐喻 (一针见血 (辛辣讽刺 (抓住本质 用户输入))))))\n (few-shots (委婉 . \"刺向他人时, 决定在剑刃上撒上止痛药。\"))\n (SVG-Card 解释)))\n\n(defun SVG-Card (解释)\n \"输出SVG 卡片\"\n (setq design-rule \"合理使用负空间,整体排版要有呼吸感\"\n design-principles '(干净 简洁 典雅))\n\n (设置画布 '(宽度 400 高度 600 边距 20))\n (标题字体 '毛笔楷体)\n (自动缩放 '(最小字号 16))\n\n (配色风格 '((背景色 (蒙德里安风格 设计感)))\n (主要文字 (汇文明朝体 粉笔灰))\n (装饰图案 随机几何图))\n\n (卡片元素 ((居中标题 \"汉语新解\")\n 分隔线\n (排版输出 用户输入 英文 日语)\n 解释\n (线条图 (批判内核 解释))\n (极简总结 线条图))))\n\n(defun start ()\n \"启动时运行\"\n (let (system-role 新汉语老师)\n (print \"说吧, 他们又用哪个词来忽悠你了?\")))\n\n;; 运行规则\n;; 1. 启动时必须运行 (start) 函数\n;; 2. 之后调用主函数 (汉语新解 用户输入)\n提示词 END}\n\n(直接生成 svg 完整代码,我会复制,需要你用代码块)\n(除此之外不要有多余的解释,不要在开头加上任何说明)\n解释的内容自动加入换行标签,例如:\n文字1,\n 文字12,"
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "聊天记录",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 0,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "文档引用",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "value": ["448745", "userChatInput"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "sbVUb0efY6Fm",
+ "name": "代码运行",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 2210.2574140398733,
+ "y": -621.0024113659815
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({svg_str}){\n\n // 使用正则表达式匹配代码块中的内容\n const match = svg_str.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n\n if (!match) {\n // 如果没有匹配到代码块,返回一个错误信息或空结果\n return {\n result: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 提取代码块中的 SVG 内容\n const extractedSvg = match[1].trim();\n \n const base64 = strToBase64(extractedSvg,'data:image/svg+xml;base64,')\n\n return {\n result: base64\n }\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "svg_str",
+ "label": "svg_str",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["bg853CwHAw4a", "answerText"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "cPh2VZnVxjQ8",
+ "name": "指定回复",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 2911.2230784647795,
+ "y": -411.6915940628763
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "SVG:\n\n{{$bg853CwHAw4a.answerText$}}\n\n卡片:\n\n![]({{$sbVUb0efY6Fm.qLUQfhG0ILRX$}})"
+ }
+ ],
+ "outputs": []
+ }
+ ],
+ "edges": [
+ {
+ "source": "bg853CwHAw4a",
+ "target": "sbVUb0efY6Fm",
+ "sourceHandle": "bg853CwHAw4a-source-right",
+ "targetHandle": "sbVUb0efY6Fm-target-left"
+ },
+ {
+ "source": "448745",
+ "target": "bg853CwHAw4a",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "bg853CwHAw4a-target-left"
+ },
+ {
+ "source": "sbVUb0efY6Fm",
+ "target": "cPh2VZnVxjQ8",
+ "sourceHandle": "sbVUb0efY6Fm-source-right",
+ "targetHandle": "cPh2VZnVxjQ8-target-left"
+ }
+ ],
+ "chatConfig": {
+ "variables": [],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "_id": "66f0f7540a40cd1f97da9dd6"
+ }
+ }
+}
diff --git a/projects/app/public/appMarketTemplates/animalLife/avatar.svg b/projects/app/public/appMarketTemplates/animalLife/avatar.svg
new file mode 100644
index 000000000000..685bf407efd1
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/animalLife/avatar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/projects/app/public/appMarketTemplates/animalLife/template.json b/projects/app/public/appMarketTemplates/animalLife/template.json
new file mode 100644
index 000000000000..896ae0245078
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/animalLife/template.json
@@ -0,0 +1,501 @@
+{
+ "name": "动物的一生",
+ "intro": "使用AI生成任何事物的 “人生图”",
+ "author": "",
+ "avatar": "/appMarketTemplates/animalLife/avatar.svg",
+ "tags": ["roleplay"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "common:core.module.template.system_config",
+ "intro": "common:core.module.template.system_config_info",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": 262.2732338817093,
+ "y": -476.00241136598146
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "common:core.module.template.work_start",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": 632.368838596004,
+ "y": -347.7446492944009
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "common:core.module.input.label.user question",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "bg853CwHAw4a",
+ "name": "AI 对话",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 1318.728987052518,
+ "y": -612.0024113659815
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "AI 模型",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "claude-3-5-sonnet-20240620"
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 0,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 4000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": false,
+ "valueType": "boolean",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "提示词",
+ "description": "core.app.tip.systemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "{提示词 START:\n;; 提示词:动物的一生\n;; 作者:空格 zephyr\n\n(defun 动物生命周期 ()\n \"生成动物的生命周期SVG图表和描述\"\n (lambda (主题)\n (let* ((生命阶段 (获取生命阶段 主题))\n (科普数据 (获取科普数据 主题))\n (背景样式 (设计背景 主题))\n (时间轴 (创建时间轴 主题))\n (阶段emoji (选择阶段emoji 主题))\n (装饰emoji (选择装饰emoji 主题))\n (副标题 (生成副标题 主题 科普数据)))\n (创建优化SVG图表 主题 生命阶段 科普数据 背景样式 时间轴 阶段emoji 装饰emoji 副标题))))\n\n(defun 获取生命阶段 (主题)\n \"获取主题的主要生命阶段\"\n (case 主题\n (蝉 '(\"卵\" \"若虫期(地下)\" \"成虫期\"))\n (鲸鱼 '(\"胎儿期\" \"幼年期\" \"青年期\" \"成年期\" \"老年期\"))\n (长颈鹿 '(\"新生期\" \"幼年期\" \"青年期\" \"成年期\" \"老年期\"))\n (t '(\"初期\" \"成长期\" \"成熟期\" \"衰老期\"))))\n\n(defun 获取科普数据 (主题)\n \"获取主题的科普数据列表\"\n (case 主题\n (蝉 '((\"卵在树枝中孵化6-10周,每窝可产200-600颗卵。\"\n \"若虫在地下生活多年,吸食树根汁液生存。\"\n \"若虫经历5次蜕皮,体型可增大20倍。\"\n \"最后一次蜕皮后钻出地面,变为成虫。\"\n \"成虫期仅4-6周,专注于繁衍后代和鸣叫。\")\n \"蝉的地下潜伏期长达17年,成虫仅存活4-6周,鸣叫声可达120分贝,相当于飞机起飞的噪音。\"))\n (鲸鱼 '((\"蓝鲸胎儿每天增重90公斤,出生时重达2.5吨,长7米。\"\n \"幼鲸每天喝380升奶,7个月增重30吨。\"\n \"青年蓝鲸可潜水200米深,屏息长达40分钟。\"\n \"成年蓝鲸长30米,重190吨,一天吃4吨磷虾。\"\n \"最长寿蓝鲸年龄可达110岁,终生可游13次地球赤道距离。\")\n \"蓝鲸是地球上最大的动物,心脏重达600公斤,舌头重如一头大象,叫声可传播1600公里。\"))\n (t '((\"阶段1的数据描述\"\n \"阶段2的数据描述\"\n \"阶段3的数据描述\"\n \"阶段4的数据描述\"\n \"阶段5的数据描述\")\n \"通用主题的有趣数据描述\"))))\n\n(defun 设计背景 (主题)\n \"根据主题设计适合的背景\"\n (case 主题\n (蝉 '(渐变 \"E6F3FF\" \"B3E5FC\" 土地))\n (鲸鱼 '(渐变 \"E3F2FD\" \"90CAF9\" 海洋))\n (长颈鹿 '(渐变 \"FFF8E1\" \"FFE0B2\" 草原))\n (t '(渐变 \"F5F5F5\" \"E0E0E0\" 通用))))\n\n(defun 创建时间轴 (主题)\n \"创建主题生命周期的时间轴\"\n (case 主题\n (蝉 '(\"0年\" \"4年\" \"8年\" \"12年\" \"16年\" \"17年\"))\n (鲸鱼 '(\"0年\" \"10年\" \"25年\" \"50年\" \"75年\" \"100年\"))\n (长颈鹿 '(\"0月\" \"6月\" \"2年\" \"4年\" \"15年\" \"25年\"))\n (t '(\"初期\" \"成长期\" \"成熟期\" \"后期\" \"衰老期\"))))\n\n(defun 选择阶段emoji (主题)\n \"选择与生命阶段相关的emoji\"\n (case 主题\n (蝉 '(\"🥚\" \"🐛\" \"🦟\" \"🎵\"))\n (鲸鱼 '(\"🤰\" \"🍼\" \"🏊\" \"🐋\" \"👵\"))\n (长颈鹿 '(\"👶\" \"🐕\" \"🏃\" \"🦒\" \"👵\"))\n (t '(\"🌱\" \"🌿\" \"🌳\" \"🍂\"))))\n\n(defun 选择装饰emoji (主题)\n \"选择与主题相关的装饰emoji\"\n (case 主题\n (蝉 '(\"🌳\" \"🍃\" \"🌿\" \"🍂\"))\n (鲸鱼 '(\"🌊\" \"🐠\" \"🦈\" \"🐙\"))\n (长颈鹿 '(\"🌴\" \"🌿\" \"🦓\" \"🦁\"))\n (t '(\"🌱\" \"🌳\" \"🍃\" \"🌞\"))))\n\n(defun 生成副标题 (主题 科普数据)\n \"根据科普数据生成副标题\"\n (format \"你知道吗?%s\" (第二个元素 科普数据)))\n\n(defun 创建优化SVG图表 (主题 生命阶段 科普数据 背景样式 时间轴 阶段emoji 装饰emoji 副标题)\n \"创建优化的生命周期SVG图表\"\n (let ((svg-template\n \"\"))\n (填充优化SVG模板 svg-template 主题 生命阶段 科普数据 背景样式 时间轴 阶段emoji 装饰emoji 副标题)))\n(defun start ()\n (print \"请输入您想了解的生命主题(如:蝉、鲸鱼、长颈鹿等):\")\n (let ((用户输入 (read)))\n (优化生命周期生成器 用户输入)))\n;; 运行规则\n;; 1. 启动时运行 (start) 函数\n;; 2. 根据用户输入的主题,生成对应的生命周期SVG图表和描述\n;; 3. 输出应包括优化后的SVG图表和相关的文字说明,重点突出科学数据和有趣事实\n提示词 END}\n\n(直接生成 svg 完整代码,我会复制,需要你用代码块)\n(除此之外不要有多余的解释,不要在开头加上任何说明)"
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "聊天记录",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 0,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "文档引用",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "value": ["448745", "userChatInput"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "sbVUb0efY6Fm",
+ "name": "代码运行",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 2210.2574140398733,
+ "y": -621.0024113659815
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({svg_str}){\n\n // 使用正则表达式匹配代码块中的内容\n const match = svg_str.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n\n if (!match) {\n // 如果没有匹配到代码块,返回一个错误信息或空结果\n return {\n result: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 提取代码块中的 SVG 内容\n const extractedSvg = match[1].trim();\n \n const base64 = strToBase64(extractedSvg,'data:image/svg+xml;base64,')\n\n return {\n result: base64\n }\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "svg_str",
+ "label": "svg_str",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["bg853CwHAw4a", "answerText"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "cPh2VZnVxjQ8",
+ "name": "指定回复",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 2911.2230784647795,
+ "y": -411.6915940628763
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "SVG:\n\n{{$bg853CwHAw4a.answerText$}}\n\n卡片:\n\n![]({{$sbVUb0efY6Fm.qLUQfhG0ILRX$}})"
+ }
+ ],
+ "outputs": []
+ }
+ ],
+ "edges": [
+ {
+ "source": "bg853CwHAw4a",
+ "target": "sbVUb0efY6Fm",
+ "sourceHandle": "bg853CwHAw4a-source-right",
+ "targetHandle": "sbVUb0efY6Fm-target-left"
+ },
+ {
+ "source": "448745",
+ "target": "bg853CwHAw4a",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "bg853CwHAw4a-target-left"
+ },
+ {
+ "source": "sbVUb0efY6Fm",
+ "target": "cPh2VZnVxjQ8",
+ "sourceHandle": "sbVUb0efY6Fm-source-right",
+ "targetHandle": "cPh2VZnVxjQ8-target-left"
+ }
+ ],
+ "chatConfig": {
+ "variables": [],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "_id": "66f0f7540a40cd1f97da9dd6"
+ }
+ }
+}
diff --git a/projects/app/public/appMarketTemplates/divination/avatar.svg b/projects/app/public/appMarketTemplates/divination/avatar.svg
new file mode 100644
index 000000000000..9c6de9f04252
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/divination/avatar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/projects/app/public/appMarketTemplates/divination/template.json b/projects/app/public/appMarketTemplates/divination/template.json
new file mode 100644
index 000000000000..62f2a63401d2
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/divination/template.json
@@ -0,0 +1,516 @@
+{
+ "name": "周易占卜",
+ "intro": "AI占卜,快来算算你的运势~",
+ "author": "",
+ "avatar": "/appMarketTemplates/divination/avatar.svg",
+ "tags": ["roleplay"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "common:core.module.template.system_config",
+ "intro": "common:core.module.template.system_config_info",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": 262.2732338817093,
+ "y": -476.00241136598146
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "common:core.module.template.work_start",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": 632.368838596004,
+ "y": -347.7446492944009
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "common:core.module.input.label.user question",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "bg853CwHAw4a",
+ "name": "AI 对话",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 1318.728987052518,
+ "y": -612.0024113659815
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "AI 模型",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "claude-3-5-sonnet-20240620"
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 0,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 4000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": false,
+ "valueType": "boolean",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "提示词",
+ "description": "core.app.tip.chatNodeSystemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "你是精通中国传统周易八卦理论的卜算大师,能够对用户所求的问题进行占卜, 要列出正确的卦名,并用如下模版展示答案,注意模版中各部分内容字数,确保展示完全\n\n你应该先确认卦名,然后根据下表确认卦象对应的二进制,一步一步从上到下输出该二进制对应的阴阳爻,绝对不能出错, 在绘制svg的时候确保阴阳爻正确,最后根据阴阳爻得到svg卡片,最后输出对卦象的解读\n把思考过程输出到中\n把 svg 卡片的内容输出到 svg 代码块中\n\n二进制转阴阳爻的示例: \n小畜卦的二进制是110111,从上到下对应的阴阳爻依次为: 阳阳阴阳阳阳\n损卦的二进制是100011,从上到下对应的阴阳爻依次为: 阳阴阴阴阳阳\n需卦的二进制是010111,从上到下对应的阴阳爻依次为: 阴阳阴阳阳阳\n\n\nsvg中的阳爻示例:\n\n\nsvg中的阴爻示例:\n\nline x1=\"66\" y1=\"33\" x2=\"110\" y2=\"33\" stroke=\"#8A4419\" stroke-width=\"8\"/>\n\n\n64卦对应的二进制 (注意二进制中的1表示阳,0表示阴):\n`\n| 卦名 | 二进制值 |\n|------|----------|\n| 乾 | 111111 |\n| 坤 | 000000 |\n| 屯 | 010001 |\n| 蒙 | 100010 |\n| 需 | 010111 |\n| 讼 | 111010 |\n| 师 | 000010 |\n| 比 | 010000 |\n| 小畜 | 110111 |\n| 履 | 111011 |\n| 泰 | 000111 |\n| 否 | 111000 |\n| 同人 | 111101 |\n| 大有 | 101111 |\n| 谦 | 000100 |\n| 豫 | 001000 |\n| 随 | 011001 |\n| 蛊 | 100110 |\n| 临 | 000011 |\n| 观 | 110000 |\n| 噬嗑 | 101001 |\n| 贲 | 100101 |\n| 剥 | 100000 |\n| 复 | 000001 |\n| 无妄 | 111001 |\n| 大畜 | 100111 |\n| 颐 | 100001 |\n| 大过 | 011110 |\n| 坎 | 010010 |\n| 离 | 101101 |\n| 咸 | 011100 |\n| 恒 | 001110 |\n| 遁 | 111100 |\n| 大壮 | 001111 |\n| 晋 | 101000 |\n| 明夷 | 000101 |\n| 家人 | 110101 |\n| 睽 | 101011 |\n| 蹇 | 010100 |\n| 解 | 001010 |\n| 损 | 100011 |\n| 益 | 110001 |\n| 夬 | 011111 |\n| 姤 | 111110 |\n| 萃 | 011000 |\n| 升 | 000110 |\n| 困 | 011010 |\n| 井 | 010110 |\n| 革 | 011101 |\n| 鼎 | 101110 |\n| 震 | 001001 |\n| 艮 | 100100 |\n| 渐 | 110100 |\n| 归妹 | 001011 |\n| 丰 | 001101 |\n| 旅 | 101100 |\n| 巽 | 110110 |\n| 兑 | 011011 |\n| 涣 | 110010 |\n| 节 | 010011 |\n| 中孚 | 110011 |\n| 小过 | 001100 |\n| 既济 | 010101 |\n| 未济 | 101010 |\n`\n\n\n模板\n`\n\n`"
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "聊天记录",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 6,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "文档引用",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "value": ["448745", "userChatInput"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "sbVUb0efY6Fm",
+ "name": "代码运行",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 2210.2574140398733,
+ "y": -621.0024113659815
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({svg_str}){\n\n // 正则表达式匹配代码块中的内容\n const codeBlockRegex = /```[\\w]*\\n([\\s\\S]*?)```/;\n const codeMatch = svg_str.match(codeBlockRegex);\n\n // 正则表达式匹配 标签中的内容\n const thinkingRegex = /([\\s\\S]*?)<\\/thinking>/;\n const thinkingMatch = svg_str.match(thinkingRegex);\n\n // 提取代码块之后的所有内容\n let contentAfterCodeBlock = null;\n if (codeMatch) {\n const endIndex = codeMatch.index + codeMatch[0].length;\n contentAfterCodeBlock = svg_str.slice(endIndex).trim();\n }\n\n // 处理代码块内容\n let base64 = null;\n if (codeMatch) {\n const extractedSvg = codeMatch[1].trim();\n base64 = strToBase64(extractedSvg, 'data:image/svg+xml;base64,');\n } else {\n // 如果没有找到代码块,返回错误信息\n return {\n result: null,\n thinking: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 处理 标签内容\n let thinkingContent = null;\n if (thinkingMatch) {\n thinkingContent = thinkingMatch[1].trim();\n }\n\n return {\n result: base64,\n thinking: thinkingContent,\n contentAfter: contentAfterCodeBlock\n }\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "svg_str",
+ "label": "svg_str",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["bg853CwHAw4a", "answerText"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result",
+ "valueDesc": "",
+ "description": ""
+ },
+ {
+ "id": "faWiQXDtBUKj",
+ "valueType": "string",
+ "type": "dynamic",
+ "key": "thinking",
+ "label": "thinking"
+ },
+ {
+ "id": "mS7yAR8REIhZ",
+ "valueType": "string",
+ "type": "dynamic",
+ "key": "contentAfter",
+ "label": "contentAfter"
+ }
+ ]
+ },
+ {
+ "nodeId": "cPh2VZnVxjQ8",
+ "name": "指定回复",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 2911.2230784647795,
+ "y": -411.6915940628763
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "{{$sbVUb0efY6Fm.faWiQXDtBUKj$}}\n\n![]({{$sbVUb0efY6Fm.qLUQfhG0ILRX$}})\n\n{{$sbVUb0efY6Fm.mS7yAR8REIhZ$}}"
+ }
+ ],
+ "outputs": []
+ }
+ ],
+ "edges": [
+ {
+ "source": "bg853CwHAw4a",
+ "target": "sbVUb0efY6Fm",
+ "sourceHandle": "bg853CwHAw4a-source-right",
+ "targetHandle": "sbVUb0efY6Fm-target-left"
+ },
+ {
+ "source": "448745",
+ "target": "bg853CwHAw4a",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "bg853CwHAw4a-target-left"
+ },
+ {
+ "source": "sbVUb0efY6Fm",
+ "target": "cPh2VZnVxjQ8",
+ "sourceHandle": "sbVUb0efY6Fm-source-right",
+ "targetHandle": "cPh2VZnVxjQ8-target-left"
+ }
+ ],
+ "chatConfig": {
+ "welcomeText": "请输入您的问题,老朽将为您算上一卦~",
+ "variables": [],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "_id": "66f3c581e7fbb61a42775716"
+ }
+ }
+}
diff --git a/projects/app/public/appMarketTemplates/githubIssue/avatar.svg b/projects/app/public/appMarketTemplates/githubIssue/avatar.svg
new file mode 100644
index 000000000000..582895ca4677
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/githubIssue/avatar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/projects/app/public/appMarketTemplates/githubIssue/template.json b/projects/app/public/appMarketTemplates/githubIssue/template.json
new file mode 100644
index 000000000000..3471f37d1942
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/githubIssue/template.json
@@ -0,0 +1,920 @@
+{
+ "name": "GitHub Issue 总结机器人",
+ "intro": "定时获取GitHub Issue信息,使用AI进行总结,并推送到飞书群中",
+ "author": "",
+ "avatar": "/appMarketTemplates/githubIssue/avatar.svg",
+ "tags": ["office-services"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "common:core.module.template.system_config",
+ "intro": "common:core.module.template.system_config_info",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": 262.2732338817093,
+ "y": -476.00241136598146
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "common:core.module.template.work_start",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": 632.368838596004,
+ "y": -347.7446492944009
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "common:core.module.input.label.user question",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "jVGuKrDfFTU6",
+ "name": "获取 24 小时前的日期",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 1045.4174257570808,
+ "y": -94.5419824521446
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main() {\n const date = new Date();\n date.setDate(date.getDate() - 3);\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n\n return {\n date: `${year}-${month}-${day}T${hours}:${minutes}:000Z`,\n }\n }",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "gR0mkQpJ4Og8",
+ "type": "dynamic",
+ "key": "date",
+ "valueType": "string",
+ "label": "date",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "jyftFRrd4RQf",
+ "name": "指定回复",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 1758.8251385440858,
+ "y": 80.55020745654087
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "拉取从 {{$jVGuKrDfFTU6.gR0mkQpJ4Og8$}} 以来所有的 open issue \\n"
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "mCaalLpFoZFk",
+ "name": "获取 Issues",
+ "intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
+ "avatar": "core/workflow/template/httpRequest",
+ "flowNodeType": "httpRequest468",
+ "showStatus": true,
+ "position": {
+ "x": 2602.5615507147536,
+ "y": -67.18952984768578
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "common:core.module.input.description.HTTP Dynamic Input",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpMethod",
+ "renderTypeList": ["custom"],
+ "valueType": "string",
+ "label": "",
+ "value": "GET",
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpTimeout",
+ "renderTypeList": ["custom"],
+ "valueType": "number",
+ "label": "",
+ "value": 30,
+ "min": 5,
+ "max": 600,
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpReqUrl",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "",
+ "description": "common:core.module.input.description.Http Request Url",
+ "placeholder": "https://api.ai.com/getInventory",
+ "required": false,
+ "value": "https://api.github.com/repos/labring/FastGPT/issues",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpHeader",
+ "renderTypeList": ["custom"],
+ "valueType": "any",
+ "value": [],
+ "label": "",
+ "description": "common:core.module.input.description.Http Request Header",
+ "placeholder": "common:core.module.input.description.Http Request Header",
+ "required": false,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpParams",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "value": [
+ {
+ "key": "state",
+ "type": "string",
+ "value": "open"
+ },
+ {
+ "key": "since",
+ "type": "string",
+ "value": "{{$jVGuKrDfFTU6.gR0mkQpJ4Og8$}}"
+ }
+ ],
+ "label": "",
+ "required": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpJsonBody",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "value": "",
+ "label": "",
+ "required": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpFormBody",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "value": [],
+ "label": "",
+ "required": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "system_httpContentType",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "value": "json",
+ "label": "",
+ "required": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:request_error",
+ "description": "HTTP请求错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "httpRawResponse",
+ "key": "httpRawResponse",
+ "required": true,
+ "label": "workflow:raw_response",
+ "description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
+ "valueType": "any",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "gALvyJcXPoep",
+ "name": "处理 API 响应数据",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 3396.722564475613,
+ "y": -80.79235153344955
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({res}) {\n const issues = JSON.parse(res);\n const ret = [];\n for(const issue of issues) {\n if (issue.pull_request) continue;\n ret.push({\n title: issue.title,\n body: issue.body,\n url: issue.html_url\n })\n }\n\n return {\n ret: JSON.stringify(ret)\n }\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "res",
+ "label": "res",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["mCaalLpFoZFk", "httpRawResponse"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "ret",
+ "valueType": "string",
+ "label": "ret",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "aLrp6IjV8zAf",
+ "name": "AI 对话",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 3907.7186093895143,
+ "y": -148.24856757598377
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "AI 模型",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "qwen-plus"
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 0,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 8000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": true,
+ "valueType": "boolean",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "提示词",
+ "description": "core.app.tip.systemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "你是一个简洁高效的 GitHub Issue 概述助手,专长于提炼核心问题并以清晰简洁的方式呈现。\n\n## 任务\n分析输入的多条 issue 信息,为每个 issue 创建一个简明扼要的概述。使用中文输出。\n\n## 输入格式\nJSON 数组,每项包含 title(标题)、body(内容)和 url(链接)。\n\n## 输出格式\n对每个 issue 使用 Markdown 语法创建简洁的概述块。每个概述应包含:\n\n1. 使用加粗呈现 issue 的原标题\n2. 一段简短的问题概述(不超过 2-3 句话)\n3. 原 issue 的链接(使用 Markdown 链接语法)\n\n在概述中适当使用 emoji 来增加可读性,但不要过度使用。保持整体风格简洁明了。\n\n示例输出:\n\n---\n\n**🔍 数据可视化组件性能优化**\n\n这个 issue 反映了在处理大量数据时图表加载缓慢的问题。用户在数据点超过一定数量时experiencing明显的性能下降,影响了用户体验。\n\n📎 [查看原 issue](url1)\n\n---\n\n**🐞 移动端界面适配问题**\n\n该 issue 指出在某些特定型号的移动设备上出现了界面布局错乱的情况。这个问题影响了应用在不同尺寸屏幕上的一致性展现。\n\n📎 [查看原 issue](url2)\n\n---\n\n请确保每个 issue 概述都简洁明了,突出核心问题,避免过多细节。保持整体风格统一,让读者能快速理解每个 issue 的要点。"
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "聊天记录",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 0,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "文档引用",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "toolDescription": "用户问题",
+ "required": true,
+ "value": ["gALvyJcXPoep", "qLUQfhG0ILRX"],
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "jmSiT6OXA3Fe",
+ "name": "飞书机器人 webhook",
+ "intro": "向飞书机器人发起 webhook 请求。",
+ "avatar": "/appMarketTemplates/plugin-feishu/avatar.svg",
+ "flowNodeType": "pluginModule",
+ "showStatus": false,
+ "position": {
+ "x": 4682.428295424065,
+ "y": 120.04658236877646
+ },
+ "version": "488",
+ "inputs": [
+ {
+ "key": "system_forbid_stream",
+ "renderTypeList": ["switch"],
+ "valueType": "boolean",
+ "label": "禁用流输出",
+ "description": "强制设置嵌套运行的应用,均以非流模式运行",
+ "value": true,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "selectedTypeIndex": 0,
+ "valueType": "string",
+ "canEdit": false,
+ "key": "content",
+ "label": "content",
+ "description": "需要发送的消息",
+ "required": true,
+ "toolDescription": "需要发送的消息",
+ "value": ["aLrp6IjV8zAf", "answerText"],
+ "valueDesc": "",
+ "debugLabel": ""
+ },
+ {
+ "renderTypeList": ["input"],
+ "selectedTypeIndex": 0,
+ "valueType": "string",
+ "canEdit": false,
+ "key": "hook_url",
+ "label": "hook_url",
+ "description": "飞书机器人地址",
+ "required": true,
+ "defaultValue": "",
+ "value": "https://www.feishu.cn/flow/api/trigger-webhook/5a1657d6f024c639e1e9af4d9d611292",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "result",
+ "type": "static",
+ "key": "result",
+ "valueType": "object",
+ "label": "result",
+ "description": "",
+ "valueDesc": ""
+ }
+ ],
+ "pluginId": "community-feishu"
+ }
+ ],
+ "edges": [
+ {
+ "source": "448745",
+ "target": "jVGuKrDfFTU6",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "jVGuKrDfFTU6-target-left"
+ },
+ {
+ "source": "jVGuKrDfFTU6",
+ "target": "jyftFRrd4RQf",
+ "sourceHandle": "jVGuKrDfFTU6-source-right",
+ "targetHandle": "jyftFRrd4RQf-target-left"
+ },
+ {
+ "source": "jyftFRrd4RQf",
+ "target": "mCaalLpFoZFk",
+ "sourceHandle": "jyftFRrd4RQf-source-right",
+ "targetHandle": "mCaalLpFoZFk-target-left"
+ },
+ {
+ "source": "mCaalLpFoZFk",
+ "target": "gALvyJcXPoep",
+ "sourceHandle": "mCaalLpFoZFk-source-right",
+ "targetHandle": "gALvyJcXPoep-target-left"
+ },
+ {
+ "source": "gALvyJcXPoep",
+ "target": "aLrp6IjV8zAf",
+ "sourceHandle": "gALvyJcXPoep-source-right",
+ "targetHandle": "aLrp6IjV8zAf-target-left"
+ },
+ {
+ "source": "aLrp6IjV8zAf",
+ "target": "jmSiT6OXA3Fe",
+ "sourceHandle": "aLrp6IjV8zAf-source-right",
+ "targetHandle": "jmSiT6OXA3Fe-target-left"
+ }
+ ],
+ "chatConfig": {
+ "variables": [],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "_id": "67152011bb78889107c3a4ec"
+ }
+ }
+}
diff --git a/projects/app/public/appMarketTemplates/longTranslate/template.json b/projects/app/public/appMarketTemplates/longTranslate/template.json
new file mode 100644
index 000000000000..9cb6c98ac1b2
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/longTranslate/template.json
@@ -0,0 +1,2155 @@
+{
+ "name": "长文翻译专家",
+ "intro": "使用专有名称知识库协助翻译,更适合长文本的翻译机器人",
+ "author": "",
+ "avatar": "/appMarketTemplates/TranslateRobot/avatar.svg",
+ "tags": ["office-services"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "系统配置",
+ "intro": "可以配置应用的系统参数",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": -3580.557768149762,
+ "y": -789.3781335716197
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "流程开始",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": -4423.869761318094,
+ "y": 270.52507717746244
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ },
+ {
+ "id": "userFiles",
+ "key": "userFiles",
+ "label": "app:workflow.user_file_input",
+ "description": "app:workflow.user_file_input_desc",
+ "type": "static",
+ "valueType": "arrayString"
+ }
+ ]
+ },
+ {
+ "nodeId": "yjFO3YcM7KG2",
+ "name": "多文本块翻译",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 889.049018199629,
+ "y": -146.47492282253756
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "core.module.input.label.aiModel",
+ "valueType": "string",
+ "selectedTypeIndex": 0,
+ "value": "claude-3-5-sonnet-20240620",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 3,
+ "valueType": "number",
+ "min": 0,
+ "max": 10,
+ "step": 1,
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 4000,
+ "valueType": "number",
+ "min": 100,
+ "max": 4000,
+ "step": 50,
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": false,
+ "valueType": "boolean",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "{{q}}\n{{a}}",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "使用 标记中的内容作为你的翻译词库:\n\n\n{{quote}}\n\n\n原文: \"\"\"{{question}}\"\"\"",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "core.ai.Prompt",
+ "description": "core.app.tip.systemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "value": "# Role: 资深翻译专家\n\n## Background:\n你是一位经验丰富的翻译专家,精通{{source_lang}}和{{target_lang}}互译,尤其擅长将{{source_lang}}文章译成流畅易懂的{{target_lang}}。你曾多次带领团队完成大型翻译项目,译文广受好评。\n\n## Attention:\n- 翻译过程中要始终坚持\"信、达、雅\"的原则,但\"达\"尤为重要\n- 翻译的译文要符合{{target_lang}}的表达习惯,通俗易懂,连贯流畅\n- 避免使用过于文绉绉的表达和晦涩难懂的典故引用 \n- 诗词歌词等内容需按原文换行和节奏分行,不破坏原排列格式 \n- 对于专有的名词或术语,按照给出的术语表进行合理替换 \n- 在翻译过程中,注意保留文档原有的列表项和格式标识\n- 不要翻译代码块中的内容,保持原样输出\n\n## Constraints:\n- 必须严格遵循四轮翻译流程:直译、意译、反思、提升\n- 译文要忠实原文,准确无误,不能遗漏或曲解原意\n- 注意判断上下文,避免重复翻译\n- 最终译文使用Markdown的代码块呈现,但是不用输出markdown这个单词\n\n## Goals:\n- 通过四轮翻译流程,将{{source_lang}}原文译成高质量的{{target_lang}}译文 \n- 译文要准确传达原文意思,语言表达力求浅显易懂,朗朗上口\n- 适度使用一些熟语俗语、流行网络用语等,增强译文的亲和力\n\n## Skills:\n- 精通{{source_lang}} {{target_lang}}两种语言,具有扎实的语言功底和丰富的翻译经验\n- 擅长将{{source_lang}}表达习惯转换为地道自然的{{target_lang}}\n- 对当代{{target_lang}}语言的发展变化有敏锐洞察,善于把握语言流行趋势\n\n## Workflow:\n1. 第一轮直译:逐字逐句忠实原文,不遗漏任何信息(代码块内容除外)\n2. 第二轮意译:在直译的基础上用通俗流畅的{{target_lang}}意译原文(代码块内容除外)\n3. 第三轮反思:仔细审视译文,分点列出一份建设性的批评和有用的建议清单以改进翻译,逐句提出建议,从以下6个角度展开\n (i) 准确性(纠正冗余、误译、遗漏或未翻译的文本错误),\n (ii) 流畅性(应用{{target_lang}}的语法、拼写和标点规则,并确保没有不必要的重复),\n (iii) 风格(确保翻译反映源文本的风格并考虑其文化背景),\n (iv) 术语(严格参考给出的术语表,确保术语使用一致)\n (v) 语序(合理调整语序,不要生搬{{source_lang}}中的语序,注意调整为{{target_lang}}中的合理语序)\n (vi) 代码保护(确保所有代码块内容保持原样,不被翻译)\n4. 第四轮提升:严格遵循第三轮提出的建议对翻译修改,定稿出一个简洁畅达、符合大众阅读习惯的译文\n\n## OutputFormat:\n- 每一轮前用【思考】说明该轮要点\n- 第一轮和第二轮翻译后用【翻译】呈现译文\n- 第三轮用【建议】输出建议清单,分点列出,在每一点前用*xxx*标识这条建议对应的要点,如*风格*;建议前用【思考】说明该轮要点,建议后用【建议】呈现建议\n- 第四轮在\\`\\`\\`代码块中展示最终译文内容,如\\`\\`\\`xxx\\`\\`\\`,不用输出markdown这个单词\n\n## Suggestions:\n- 直译时力求忠实原文,但不要过于拘泥逐字逐句\n- 意译时在准确表达原意的基础上,用最朴实无华的{{target_lang}}来表达\n- 反思环节重点关注译文是否符合{{target_lang}}表达习惯,是否通俗易懂,是否准确流畅,是否术语一致\n- 提升环节采用反思环节的建议对意译环节的翻译进行修改,适度采用一些口语化的表达、网络流行语等,增强译文的亲和力\n- 所有包含在代码块(\\`\\`\\`)中的内容都应保持原样,不进行翻译",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "core.module.input.label.chat history",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 6,
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "value": ["nLBlOh6lWxkY", "quoteQA"],
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "app:document_quote",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "selectedTypeIndex": 1,
+ "value": "Your task is provide a professional translation from {{$VARIABLE_NODE_ID.source_lang$}} to {{$VARIABLE_NODE_ID.target_lang$}} of PART of a text.\n\nThe source text is below, delimited by XML tags and . Translate only the part within the source text\ndelimited by and . You can use the rest of the source text as context, but do not translate any\nof the other text. Do not output anything other than the translation of the indicated part of the text.\n\n\n{{$quYZgsW32ApA.xhXu6sdEWBnF$}}\n\n\nTo reiterate, you should translate only this part of the text, shown here again between and :\n\n{{$quYZgsW32ApA.eCp73lztAEGK$}}\n\n\nOutput only the translation of the portion you are asked to translate, and nothing else",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "w4heEpNflz59",
+ "name": "判断是否执行结束",
+ "intro": "根据一定的条件,执行不同的分支。",
+ "avatar": "core/workflow/template/ifelse",
+ "flowNodeType": "ifElseNode",
+ "showStatus": true,
+ "position": {
+ "x": 4127.598997947211,
+ "y": 266.8413637678663
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "ifElseList",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": [
+ {
+ "condition": "AND",
+ "list": [
+ {
+ "variable": ["a2lqxASWi1vb", "nmBmGaARbKkl"],
+ "condition": "equalTo",
+ "value": "true"
+ }
+ ]
+ }
+ ],
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "ifElseResult",
+ "key": "ifElseResult",
+ "label": "workflow:judgment_result",
+ "valueType": "string",
+ "type": "static",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "a2lqxASWi1vb",
+ "name": "判断是否执行结束",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 3477.215830836187,
+ "y": 191.17869154122482
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({chunks, doc_chunks, currentChunk}){\n let new_chunks = doc_chunks || chunks\n const findIndex = new_chunks.findIndex((item) => item ===currentChunk)\n \n return {\n isEnd: new_chunks.length-1 === findIndex,\n i: findIndex + 1,\n }\n}",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "arrayString",
+ "canEdit": true,
+ "key": "chunks",
+ "label": "chunks",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["rDzA1VxdpPIz", "qLUQfhG0ILRX"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "currentChunk",
+ "label": "currentChunk",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["quYZgsW32ApA", "eCp73lztAEGK"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "arrayString",
+ "canEdit": true,
+ "key": "doc_chunks",
+ "label": "doc_chunks",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["rhyUytTUBm19", "qLUQfhG0ILRX"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key"
+ },
+ {
+ "id": "nmBmGaARbKkl",
+ "valueType": "boolean",
+ "type": "dynamic",
+ "key": "isEnd",
+ "label": "isEnd"
+ },
+ {
+ "id": "nqB98uKpq6Ig",
+ "valueType": "number",
+ "type": "dynamic",
+ "key": "i",
+ "label": "i"
+ }
+ ]
+ },
+ {
+ "nodeId": "quYZgsW32ApA",
+ "name": "格式化源文本块",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": -453.20482176291137,
+ "y": 277.1422839492036
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({source_text_chunks, source_doc_text_chunks, i=0}){\n let chunks = source_doc_text_chunks || source_text_chunks;\n let before = chunks.slice(0, i).join(\"\");\n let current = \" \" + chunks[i] + \"\";\n let after = chunks.slice(i + 1).join(\"\");\n let tagged_text = before + current + after;\n\n return {\n tagged_text,\n chunk_to_translate: chunks[i],\n }\n}",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "number",
+ "canEdit": true,
+ "key": "i",
+ "label": "i",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["a2lqxASWi1vb", "nqB98uKpq6Ig"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "arrayString",
+ "canEdit": true,
+ "key": "source_text_chunks",
+ "label": "source_text_chunks",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["rDzA1VxdpPIz", "qLUQfhG0ILRX"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "arrayString",
+ "canEdit": true,
+ "key": "source_doc_text_chunks",
+ "label": "source_doc_text_chunks",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["rhyUytTUBm19", "qLUQfhG0ILRX"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key"
+ },
+ {
+ "id": "xhXu6sdEWBnF",
+ "valueType": "string",
+ "type": "dynamic",
+ "key": "tagged_text",
+ "label": "tagged_text"
+ },
+ {
+ "id": "eCp73lztAEGK",
+ "valueType": "string",
+ "type": "dynamic",
+ "key": "chunk_to_translate",
+ "label": "chunk_to_translate"
+ }
+ ]
+ },
+ {
+ "nodeId": "vlNHndpNuFXB",
+ "name": "取出翻译文本",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 1614.87521037251,
+ "y": 105.52507717746244
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "editField": {
+ "key": true,
+ "valueType": true
+ },
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({data1}){\n const result = data1.split(\"```\").filter(item => !!item.trim())\n\n if(result[result.length-1]) {\n return {\n result: result[result.length-1]\n }\n }\n\n return {\n result: '未截取到翻译内容'\n }\n}",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "data1",
+ "valueType": "string",
+ "label": "data1",
+ "renderTypeList": ["reference"],
+ "description": "",
+ "canEdit": true,
+ "editField": {
+ "key": true,
+ "valueType": true
+ },
+ "value": ["yjFO3YcM7KG2", "answerText"],
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ }
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key"
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result"
+ }
+ ]
+ },
+ {
+ "nodeId": "qlt9KJbbS9yJ",
+ "name": "判断源语言和目标语言是否相同",
+ "intro": "根据一定的条件,执行不同的分支。",
+ "avatar": "core/workflow/template/ifelse",
+ "flowNodeType": "ifElseNode",
+ "showStatus": true,
+ "position": {
+ "x": -3489.136669871181,
+ "y": 500.7167825391806
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "ifElseList",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": [
+ {
+ "condition": "AND",
+ "list": [
+ {
+ "variable": ["frjbsrlnJJsR", "qLUQfhG0ILRX"],
+ "condition": "equalTo",
+ "value": "false"
+ }
+ ]
+ }
+ ],
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "ifElseResult",
+ "key": "ifElseResult",
+ "label": "workflow:judgment_result",
+ "valueType": "string",
+ "type": "static",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "frjbsrlnJJsR",
+ "name": "判断源语言和目标语言是否相同",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": -4015.234465113403,
+ "y": 286.93335454913375
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({source_lang, target_lang}){\n \n return {\n result: source_lang === target_lang\n }\n}",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "source_lang",
+ "label": "source_lang",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["VARIABLE_NODE_ID", "source_lang"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "target_lang",
+ "label": "target_lang",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["VARIABLE_NODE_ID", "target_lang"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key"
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result"
+ }
+ ],
+ "isFolded": false
+ },
+ {
+ "nodeId": "dFxrGZS3Wmnz",
+ "name": "提示源语言与目标语言相同",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": -2965.234667648691,
+ "y": 976.026813286592
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "core.module.input.label.Response content",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "selectedTypeIndex": 0,
+ "value": "{{source_lang}} 无需再次翻译为 {{target_lang}} ~",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "rDzA1VxdpPIz",
+ "name": "切分文本",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": -1023.4352731829587,
+ "y": 122.9539005059388
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "const MAX_HEADING_LENGTH = 7; // 最大标题长度\nconst MAX_HEADING_CONTENT_LENGTH = 200; // 最大标题内容长度\nconst MAX_HEADING_UNDERLINE_LENGTH = 200; // 最大标题下划线长度\nconst MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100; // 最大HTML标题属性长度\nconst MAX_LIST_ITEM_LENGTH = 200; // 最大列表项长度\nconst MAX_NESTED_LIST_ITEMS = 6; // 最大嵌套列表项数\nconst MAX_LIST_INDENT_SPACES = 7; // 最大列表缩进空格数\nconst MAX_BLOCKQUOTE_LINE_LENGTH = 200; // 最大块引用行长度\nconst MAX_BLOCKQUOTE_LINES = 15; // 最大块引用行数\nconst MAX_CODE_BLOCK_LENGTH = 1500; // 最大代码块长度\nconst MAX_CODE_LANGUAGE_LENGTH = 20; // 最大代码语言长度\nconst MAX_INDENTED_CODE_LINES = 20; // 最大缩进代码行数\nconst MAX_TABLE_CELL_LENGTH = 200; // 最大表格单元格长度\nconst MAX_TABLE_ROWS = 20; // 最大表格行数\nconst MAX_HTML_TABLE_LENGTH = 2000; // 最大HTML表格长度\nconst MIN_HORIZONTAL_RULE_LENGTH = 3; // 最小水平分隔线长度\nconst MAX_SENTENCE_LENGTH = 400; // 最大句子长度\nconst MAX_QUOTED_TEXT_LENGTH = 300; // 最大引用文本长度\nconst MAX_PARENTHETICAL_CONTENT_LENGTH = 200; // 最大括号内容长度\nconst MAX_NESTED_PARENTHESES = 5; // 最大嵌套括号数\nconst MAX_MATH_INLINE_LENGTH = 100; // 最大行内数学公式长度\nconst MAX_MATH_BLOCK_LENGTH = 500; // 最大数学公式块长度\nconst MAX_PARAGRAPH_LENGTH = 1000; // 最大段落长度\nconst MAX_STANDALONE_LINE_LENGTH = 800; // 最大独立行长度\nconst MAX_HTML_TAG_ATTRIBUTES_LENGTH = 100; // 最大HTML标签属性长度\nconst MAX_HTML_TAG_CONTENT_LENGTH = 1000; // 最大HTML标签内容长度\nconst LOOKAHEAD_RANGE = 100; // 向前查找句子边界的字符数\n\nconst AVOID_AT_START = `[\\\\s\\\\]})>,']`; // 避免在开头匹配的字符\nconst PUNCTUATION = `[.!?…]|\\\\.{3}|[\\\\u2026\\\\u2047-\\\\u2049]|[\\\\p{Emoji_Presentation}\\\\p{Extended_Pictographic}]`; // 标点符号\nconst QUOTE_END = `(?:'(?=\\`)|''(?=\\`\\`))`; // 引号结束\nconst SENTENCE_END = `(?:${PUNCTUATION}(?]{0,${MAX_HTML_HEADING_ATTRIBUTES_LENGTH}}>)[^\\\\r\\\\n]{1,${MAX_HEADING_CONTENT_LENGTH}}(?:)?(?:\\\\r?\\\\n|$))` +\n \"|\" +\n // New pattern for citations\n `(?:\\\\[[0-9]+\\\\][^\\\\r\\\\n]{1,${MAX_STANDALONE_LINE_LENGTH}})` +\n \"|\" +\n // 2. List items (bulleted, numbered, lettered, or task lists, including nested, up to three levels, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)[ \\\\t]{0,3}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}` +\n `(?:(?:\\\\r?\\\\n[ \\\\t]{2,5}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}){0,${MAX_NESTED_LIST_ITEMS}}` +\n `(?:\\\\r?\\\\n[ \\\\t]{4,${MAX_LIST_INDENT_SPACES}}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}){0,${MAX_NESTED_LIST_ITEMS}})?)` +\n \"|\" +\n // 3. Block quotes (including nested quotes and citations, up to three levels, with length constraints)\n `(?:(?:^>(?:>|\\\\s{2,}){0,2}${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_BLOCKQUOTE_LINE_LENGTH))}\\\\r?\\\\n?){1,${MAX_BLOCKQUOTE_LINES}})` +\n \"|\" +\n // 4. Code blocks (fenced, indented, or HTML pre/code tags, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)(?:\\`\\`\\`|~~~)(?:\\\\w{0,${MAX_CODE_LANGUAGE_LENGTH}})?\\\\r?\\\\n[\\\\s\\\\S]{0,${MAX_CODE_BLOCK_LENGTH}}?(?:\\`\\`\\`|~~~)\\\\r?\\\\n?` +\n `|(?:(?:^|\\\\r?\\\\n)(?: {4}|\\\\t)[^\\\\r\\\\n]{0,${MAX_LIST_ITEM_LENGTH}}(?:\\\\r?\\\\n(?: {4}|\\\\t)[^\\\\r\\\\n]{0,${MAX_LIST_ITEM_LENGTH}}){0,${MAX_INDENTED_CODE_LINES}}\\\\r?\\\\n?)` +\n `|(?:(?:)?[\\\\s\\\\S]{0,${MAX_CODE_BLOCK_LENGTH}}?(?:
)?
))` +\n \"|\" +\n // 5. Tables (Markdown, grid tables, and HTML tables, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)(?:\\\\|[^\\\\r\\\\n]{0,${MAX_TABLE_CELL_LENGTH}}\\\\|(?:\\\\r?\\\\n\\\\|[-:]{1,${MAX_TABLE_CELL_LENGTH}}\\\\|){0,1}(?:\\\\r?\\\\n\\\\|[^\\\\r\\\\n]{0,${MAX_TABLE_CELL_LENGTH}}\\\\|){0,${MAX_TABLE_ROWS}}` +\n `|[\\\\s\\\\S]{0,${MAX_HTML_TABLE_LENGTH}}?
))` +\n \"|\" +\n // 6. Horizontal rules (Markdown and HTML hr tag)\n `(?:^(?:[-*_]){${MIN_HORIZONTAL_RULE_LENGTH},}\\\\s*$|
)` +\n \"|\" +\n // 10. Standalone lines or phrases (including single-line blocks and HTML elements, with length constraints)\n `(?!${AVOID_AT_START})(?:^(?:<[a-zA-Z][^>]{0,${MAX_HTML_TAG_ATTRIBUTES_LENGTH}}>)?${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_STANDALONE_LINE_LENGTH))}(?:[a-zA-Z]+>)?(?:\\\\r?\\\\n|$))` +\n \"|\" +\n // 7. Sentences or phrases ending with punctuation (including ellipsis and Unicode punctuation)\n `(?!${AVOID_AT_START})${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_SENTENCE_LENGTH))}` +\n \"|\" +\n // 8. Quoted text, parenthetical phrases, or bracketed content (with length constraints)\n \"(?:\" +\n `(?)?${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_PARAGRAPH_LENGTH))}(?:
)?(?=\\\\r?\\\\n\\\\r?\\\\n|$))` +\n \"|\" +\n // 11. HTML-like tags and their content (including self-closing tags and attributes, with length constraints)\n `(?:<[a-zA-Z][^>]{0,${MAX_HTML_TAG_ATTRIBUTES_LENGTH}}(?:>[\\\\s\\\\S]{0,${MAX_HTML_TAG_CONTENT_LENGTH}}?[a-zA-Z]+>|\\\\s*/>))` +\n \"|\" +\n // 12. LaTeX-style math expressions (inline and block, with length constraints)\n `(?:(?:\\\\$\\\\$[\\\\s\\\\S]{0,${MAX_MATH_BLOCK_LENGTH}}?\\\\$\\\\$)|(?:\\\\$[^\\\\$\\\\r\\\\n]{0,${MAX_MATH_INLINE_LENGTH}}\\\\$))` +\n \"|\" +\n // 14. Fallback for any remaining content (with length constraints)\n `(?!${AVOID_AT_START})${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_STANDALONE_LINE_LENGTH))}` +\n \")\",\n \"gmu\"\n);\n\nfunction main({text}){\n const chunks = [];\n let currentChunk = '';\n const tokens = countToken(text)\n\n const matches = text.match(regex);\n if (matches) {\n matches.forEach((match) => {\n if (currentChunk.length + match.length <= 1000) {\n currentChunk += match;\n } else {\n if (currentChunk) {\n chunks.push(currentChunk);\n }\n currentChunk = match;\n }\n });\n if (currentChunk) {\n chunks.push(currentChunk);\n }\n }\n\n return {chunks, tokens};\n}\n\n",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "text",
+ "label": "text",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["448745", "userChatInput"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "chunks",
+ "valueType": "arrayString",
+ "label": "chunks",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "qwKPaLWbYTLa",
+ "name": "输出翻译结果",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 2771.2891802720287,
+ "y": 320.5042731766072
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "{{$uow83rLCI2pI.qLUQfhG0ILRX$}}"
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "nLBlOh6lWxkY",
+ "name": "搜索词库",
+ "intro": "调用“语义检索”和“全文检索”能力,从“知识库”中查找可能与问题相关的参考内容",
+ "avatar": "core/workflow/template/datasetSearch",
+ "flowNodeType": "datasetSearchNode",
+ "showStatus": true,
+ "position": {
+ "x": 164.44155974241983,
+ "y": 187.52507717746244
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "datasets",
+ "renderTypeList": ["selectDataset", "reference"],
+ "label": "选择知识库",
+ "value": [],
+ "valueType": "selectDataset",
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "similarity",
+ "renderTypeList": ["selectDatasetParamsModal"],
+ "label": "",
+ "value": 0.2,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "limit",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 11000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "searchMode",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "embedding",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "usingReRank",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "datasetSearchUsingExtensionQuery",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "datasetSearchExtensionModel",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "gpt-4o-mini"
+ },
+ {
+ "key": "datasetSearchExtensionBg",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "需要翻译一段特定的文本,其中会使用到大量专有词汇,需要从词库中进行查询",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "需要检索的内容",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "selectedTypeIndex": 1,
+ "value": "中是你要翻译的原文,其中包含特定术语,请查找词库中术语对应的翻译\n\n\n\n{{$quYZgsW32ApA.eCp73lztAEGK$}}\n\n"
+ },
+ {
+ "key": "collectionFilterMatch",
+ "renderTypeList": ["JSONEditor", "reference"],
+ "label": "集合元数据过滤",
+ "valueType": "object",
+ "isPro": true,
+ "description": "workflow:filter_description",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "quoteQA",
+ "key": "quoteQA",
+ "label": "common:core.module.Dataset quote.label",
+ "description": "特殊数组格式,搜索结果为空时,返回空数组。",
+ "type": "static",
+ "valueType": "datasetQuote",
+ "valueDesc": "{\n id: string;\n datasetId: string;\n collectionId: string;\n sourceName: string;\n sourceId?: string;\n q: string;\n a: string\n}[]"
+ }
+ ]
+ },
+ {
+ "nodeId": "bdjAb5B2U1DQ",
+ "name": "指定回复#3",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 5144.978517483216,
+ "y": 401.52507717746244
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "*** 文档翻译完成!***"
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "mt7GlCIwbO9I",
+ "name": "判断是否上传了文件",
+ "intro": "根据一定的条件,执行不同的分支。",
+ "avatar": "core/workflow/template/ifelse",
+ "flowNodeType": "ifElseNode",
+ "showStatus": true,
+ "position": {
+ "x": -2277.8211533688936,
+ "y": 608.6422839492036
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "ifElseList",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": [
+ {
+ "condition": "AND",
+ "list": [
+ {
+ "variable": ["448745", "userFiles"],
+ "condition": "isEmpty"
+ }
+ ]
+ }
+ ],
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "ifElseResult",
+ "key": "ifElseResult",
+ "label": "workflow:judgment_result",
+ "valueType": "string",
+ "type": "static",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "rhyUytTUBm19",
+ "name": "切分文档文本",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": -1023.4352731829587,
+ "y": 959.6422839492036
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "const MAX_HEADING_LENGTH = 7; // 最大标题长度\nconst MAX_HEADING_CONTENT_LENGTH = 200; // 最大标题内容长度\nconst MAX_HEADING_UNDERLINE_LENGTH = 200; // 最大标题下划线长度\nconst MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100; // 最大HTML标题属性长度\nconst MAX_LIST_ITEM_LENGTH = 200; // 最大列表项长度\nconst MAX_NESTED_LIST_ITEMS = 6; // 最大嵌套列表项数\nconst MAX_LIST_INDENT_SPACES = 7; // 最大列表缩进空格数\nconst MAX_BLOCKQUOTE_LINE_LENGTH = 200; // 最大块引用行长度\nconst MAX_BLOCKQUOTE_LINES = 15; // 最大块引用行数\nconst MAX_CODE_BLOCK_LENGTH = 1500; // 最大代码块长度\nconst MAX_CODE_LANGUAGE_LENGTH = 20; // 最大代码语言长度\nconst MAX_INDENTED_CODE_LINES = 20; // 最大缩进代码行数\nconst MAX_TABLE_CELL_LENGTH = 200; // 最大表格单元格长度\nconst MAX_TABLE_ROWS = 20; // 最大表格行数\nconst MAX_HTML_TABLE_LENGTH = 2000; // 最大HTML表格长度\nconst MIN_HORIZONTAL_RULE_LENGTH = 3; // 最小水平分隔线长度\nconst MAX_SENTENCE_LENGTH = 400; // 最大句子长度\nconst MAX_QUOTED_TEXT_LENGTH = 300; // 最大引用文本长度\nconst MAX_PARENTHETICAL_CONTENT_LENGTH = 200; // 最大括号内容长度\nconst MAX_NESTED_PARENTHESES = 5; // 最大嵌套括号数\nconst MAX_MATH_INLINE_LENGTH = 100; // 最大行内数学公式长度\nconst MAX_MATH_BLOCK_LENGTH = 500; // 最大数学公式块长度\nconst MAX_PARAGRAPH_LENGTH = 1000; // 最大段落长度\nconst MAX_STANDALONE_LINE_LENGTH = 800; // 最大独立行长度\nconst MAX_HTML_TAG_ATTRIBUTES_LENGTH = 100; // 最大HTML标签属性长度\nconst MAX_HTML_TAG_CONTENT_LENGTH = 1000; // 最大HTML标签内容长度\nconst LOOKAHEAD_RANGE = 100; // 向前查找句子边界的字符数\n\nconst AVOID_AT_START = `[\\\\s\\\\]})>,']`; // 避免在开头匹配的字符\nconst PUNCTUATION = `[.!?…]|\\\\.{3}|[\\\\u2026\\\\u2047-\\\\u2049]|[\\\\p{Emoji_Presentation}\\\\p{Extended_Pictographic}]`; // 标点符号\nconst QUOTE_END = `(?:'(?=\\`)|''(?=\\`\\`))`; // 引号结束\nconst SENTENCE_END = `(?:${PUNCTUATION}(?]{0,${MAX_HTML_HEADING_ATTRIBUTES_LENGTH}}>)[^\\\\r\\\\n]{1,${MAX_HEADING_CONTENT_LENGTH}}(?:)?(?:\\\\r?\\\\n|$))` +\n \"|\" +\n // New pattern for citations\n `(?:\\\\[[0-9]+\\\\][^\\\\r\\\\n]{1,${MAX_STANDALONE_LINE_LENGTH}})` +\n \"|\" +\n // 2. List items (bulleted, numbered, lettered, or task lists, including nested, up to three levels, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)[ \\\\t]{0,3}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}` +\n `(?:(?:\\\\r?\\\\n[ \\\\t]{2,5}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}){0,${MAX_NESTED_LIST_ITEMS}}` +\n `(?:\\\\r?\\\\n[ \\\\t]{4,${MAX_LIST_INDENT_SPACES}}(?:[-*+•]|\\\\d{1,3}\\\\.\\\\w\\\\.|\\\\[[ xX]\\\\])[ \\\\t]+${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_LIST_ITEM_LENGTH))}){0,${MAX_NESTED_LIST_ITEMS}})?)` +\n \"|\" +\n // 3. Block quotes (including nested quotes and citations, up to three levels, with length constraints)\n `(?:(?:^>(?:>|\\\\s{2,}){0,2}${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_BLOCKQUOTE_LINE_LENGTH))}\\\\r?\\\\n?){1,${MAX_BLOCKQUOTE_LINES}})` +\n \"|\" +\n // 4. Code blocks (fenced, indented, or HTML pre/code tags, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)(?:\\`\\`\\`|~~~)(?:\\\\w{0,${MAX_CODE_LANGUAGE_LENGTH}})?\\\\r?\\\\n[\\\\s\\\\S]{0,${MAX_CODE_BLOCK_LENGTH}}?(?:\\`\\`\\`|~~~)\\\\r?\\\\n?` +\n `|(?:(?:^|\\\\r?\\\\n)(?: {4}|\\\\t)[^\\\\r\\\\n]{0,${MAX_LIST_ITEM_LENGTH}}(?:\\\\r?\\\\n(?: {4}|\\\\t)[^\\\\r\\\\n]{0,${MAX_LIST_ITEM_LENGTH}}){0,${MAX_INDENTED_CODE_LINES}}\\\\r?\\\\n?)` +\n `|(?:(?:)?[\\\\s\\\\S]{0,${MAX_CODE_BLOCK_LENGTH}}?(?:
)?
))` +\n \"|\" +\n // 5. Tables (Markdown, grid tables, and HTML tables, with length constraints)\n `(?:(?:^|\\\\r?\\\\n)(?:\\\\|[^\\\\r\\\\n]{0,${MAX_TABLE_CELL_LENGTH}}\\\\|(?:\\\\r?\\\\n\\\\|[-:]{1,${MAX_TABLE_CELL_LENGTH}}\\\\|){0,1}(?:\\\\r?\\\\n\\\\|[^\\\\r\\\\n]{0,${MAX_TABLE_CELL_LENGTH}}\\\\|){0,${MAX_TABLE_ROWS}}` +\n `|[\\\\s\\\\S]{0,${MAX_HTML_TABLE_LENGTH}}?
))` +\n \"|\" +\n // 6. Horizontal rules (Markdown and HTML hr tag)\n `(?:^(?:[-*_]){${MIN_HORIZONTAL_RULE_LENGTH},}\\\\s*$|
)` +\n \"|\" +\n // 10. Standalone lines or phrases (including single-line blocks and HTML elements, with length constraints)\n `(?!${AVOID_AT_START})(?:^(?:<[a-zA-Z][^>]{0,${MAX_HTML_TAG_ATTRIBUTES_LENGTH}}>)?${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_STANDALONE_LINE_LENGTH))}(?:[a-zA-Z]+>)?(?:\\\\r?\\\\n|$))` +\n \"|\" +\n // 7. Sentences or phrases ending with punctuation (including ellipsis and Unicode punctuation)\n `(?!${AVOID_AT_START})${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_SENTENCE_LENGTH))}` +\n \"|\" +\n // 8. Quoted text, parenthetical phrases, or bracketed content (with length constraints)\n \"(?:\" +\n `(?)?${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_PARAGRAPH_LENGTH))}(?:)?(?=\\\\r?\\\\n\\\\r?\\\\n|$))` +\n \"|\" +\n // 11. HTML-like tags and their content (including self-closing tags and attributes, with length constraints)\n `(?:<[a-zA-Z][^>]{0,${MAX_HTML_TAG_ATTRIBUTES_LENGTH}}(?:>[\\\\s\\\\S]{0,${MAX_HTML_TAG_CONTENT_LENGTH}}?[a-zA-Z]+>|\\\\s*/>))` +\n \"|\" +\n // 12. LaTeX-style math expressions (inline and block, with length constraints)\n `(?:(?:\\\\$\\\\$[\\\\s\\\\S]{0,${MAX_MATH_BLOCK_LENGTH}}?\\\\$\\\\$)|(?:\\\\$[^\\\\$\\\\r\\\\n]{0,${MAX_MATH_INLINE_LENGTH}}\\\\$))` +\n \"|\" +\n // 14. Fallback for any remaining content (with length constraints)\n `(?!${AVOID_AT_START})${SENTENCE_PATTERN.replace(/{MAX_LENGTH}/g, String(MAX_STANDALONE_LINE_LENGTH))}` +\n \")\",\n \"gmu\"\n);\n\nfunction main({text}){\n const chunks = [];\n let currentChunk = '';\n const tokens = countToken(text)\n\n const matches = text.match(regex);\n if (matches) {\n matches.forEach((match) => {\n if (currentChunk.length + match.length <= 1000) {\n currentChunk += match;\n } else {\n if (currentChunk) {\n chunks.push(currentChunk);\n }\n currentChunk = match;\n }\n });\n if (currentChunk) {\n chunks.push(currentChunk);\n }\n }\n\n return {chunks, tokens};\n}\n\n",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "text",
+ "label": "text",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["dtUmoUtTKfpM", "system_text"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "chunks",
+ "valueType": "arrayString",
+ "label": "chunks",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "dtUmoUtTKfpM",
+ "name": "文档解析",
+ "intro": "解析对话中所有上传的文档,并返回对应文档内容",
+ "avatar": "core/workflow/template/readFiles",
+ "flowNodeType": "readFiles",
+ "showStatus": true,
+ "position": {
+ "x": -1503.9824853456694,
+ "y": 1031.2341899921714
+ },
+ "version": "489",
+ "inputs": [
+ {
+ "key": "fileUrlList",
+ "renderTypeList": ["reference"],
+ "valueType": "arrayString",
+ "label": "文档链接",
+ "required": true,
+ "value": ["448745", "userFiles"],
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_text",
+ "key": "system_text",
+ "label": "app:workflow.read_files_result",
+ "description": "文档原文,由文件名和文档内容组成,多个文件之间通过横线隔开。",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "uow83rLCI2pI",
+ "name": "格式化中文翻译",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 2205.3511517635047,
+ "y": 121.1512729428531
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({target_lang, source_text}) {\n let text = source_text;\n\n if (target_lang === '简体中文' || target_lang === '繁體中文') {\n // 存储代码块内容\n const codeBlocks = [];\n let text = source_text.replace(/```[\\s\\S]*?```/g, (match) => {\n codeBlocks.push(match);\n return `__CODE_BLOCK_${codeBlocks.length - 1}__`;\n });\n\n // 替换成对的英文引号\n text = text.replace(/\"(.*?)\"/g, '“$1”');\n\n // 保护 Markdown 链接格式中的括号\n text = text.replace(/\\[(.*?)\\]\\((.*?)\\)/g, function(match) {\n return match.replace(/\\(/g, 'LEFTPAREN')\n .replace(/\\)/g, 'RIGHTPAREN');\n });\n\n // 替换成对的英文括号\n text = text.replace(/\\((.*?)\\)/g, '($1)');\n\n // 恢复被保护的 Markdown 链接括号\n text = text.replace(/LEFTPAREN/g, '(')\n .replace(/RIGHTPAREN/g, ')');\n\n // 更新句号替换逻辑,增加对版本号和URL的保护\n text = text.replace(/(\\d+)\\.(\\d+)\\.(\\d+)/g, '$1DOT$2DOT$3') // 保护版本号 (如 16.2.1)\n .replace(/(\\d)\\.(\\d)/g, '$1DOT$2') // 临时替换小数点\n .replace(/([a-zA-Z])\\.([a-zA-Z])/g, '$1DOT$2') // 临时替换缩写中的句号\n .replace(/([a-zA-Z])\\.(\\d)/g, '$1DOT$2') // 临时替换字母与数字之间的句号\n .replace(/(\\d)\\.([a-zA-Z])/g, '$1DOT$2') // 临时替换数字与字母之间的句号\n .replace(/([a-zA-Z])\\./g, '$1DOT') // 临时替换字母后面的句号(如 a.)\n .replace(/https?:/g, 'HTTPCOLON') // 保护 URL 中的冒号\n .replace(/\\./g, '。') // 替换其他句号\n .replace(/DOT/g, '.') // 恢复被保护的句号\n .replace(/HTTPCOLON/g, 'http:'); // 恢复 URL 中的冒号\n\n // 替换英文逗号,但不替换数字中的逗号\n text = text.replace(/(\\d),(\\d)/g, '$1COMMA$2') // 临时替换数字中的逗号\n .replace(/,/g, ',') // 替换其他逗号\n .replace(/COMMA/g, ','); // 恢复数字中的逗号\n\n // 替换其他常见符号\n const replacements = {\n '!': '!',\n '?': '?',\n ';': ';',\n };\n\n for (const [key, value] of Object.entries(replacements)) {\n text = text.replace(new RegExp(`\\\\${key}`, 'g'), value);\n }\n\n // 在中文和英文字符之间添加空格\n // 中文字符范围: \\u4e00-\\u9fa5\n // 英文字符范围: a-zA-Z0-9\n text = text.replace(/([\\u4e00-\\u9fa5])([a-zA-Z0-9])/g, '$1 $2')\n .replace(/([a-zA-Z0-9])([\\u4e00-\\u9fa5])/g, '$1 $2');\n\n // 恢复代码块\n text = text.replace(/__CODE_BLOCK_(\\d+)__/g, (_, index) => codeBlocks[index]);\n }\n\n return {\n text\n };\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "source_text",
+ "label": "source_text",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["vlNHndpNuFXB", "qLUQfhG0ILRX"]
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "target_lang",
+ "label": "target_lang",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "value": ["VARIABLE_NODE_ID", "target_lang"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "text",
+ "valueType": "string",
+ "label": "text",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ }
+ ],
+ "edges": [
+ {
+ "source": "a2lqxASWi1vb",
+ "target": "w4heEpNflz59",
+ "sourceHandle": "a2lqxASWi1vb-source-right",
+ "targetHandle": "w4heEpNflz59-target-left"
+ },
+ {
+ "source": "w4heEpNflz59",
+ "target": "quYZgsW32ApA",
+ "sourceHandle": "w4heEpNflz59-source-ELSE",
+ "targetHandle": "quYZgsW32ApA-target-left"
+ },
+ {
+ "source": "448745",
+ "target": "frjbsrlnJJsR",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "frjbsrlnJJsR-target-left"
+ },
+ {
+ "source": "frjbsrlnJJsR",
+ "target": "qlt9KJbbS9yJ",
+ "sourceHandle": "frjbsrlnJJsR-source-right",
+ "targetHandle": "qlt9KJbbS9yJ-target-left"
+ },
+ {
+ "source": "qlt9KJbbS9yJ",
+ "target": "dFxrGZS3Wmnz",
+ "sourceHandle": "qlt9KJbbS9yJ-source-ELSE",
+ "targetHandle": "dFxrGZS3Wmnz-target-top"
+ },
+ {
+ "source": "yjFO3YcM7KG2",
+ "target": "vlNHndpNuFXB",
+ "sourceHandle": "yjFO3YcM7KG2-source-right",
+ "targetHandle": "vlNHndpNuFXB-target-left"
+ },
+ {
+ "source": "rDzA1VxdpPIz",
+ "target": "quYZgsW32ApA",
+ "sourceHandle": "rDzA1VxdpPIz-source-right",
+ "targetHandle": "quYZgsW32ApA-target-left"
+ },
+ {
+ "source": "qwKPaLWbYTLa",
+ "target": "a2lqxASWi1vb",
+ "sourceHandle": "qwKPaLWbYTLa-source-right",
+ "targetHandle": "a2lqxASWi1vb-target-left"
+ },
+ {
+ "source": "nLBlOh6lWxkY",
+ "target": "yjFO3YcM7KG2",
+ "sourceHandle": "nLBlOh6lWxkY-source-right",
+ "targetHandle": "yjFO3YcM7KG2-target-left"
+ },
+ {
+ "source": "w4heEpNflz59",
+ "target": "bdjAb5B2U1DQ",
+ "sourceHandle": "w4heEpNflz59-source-IF",
+ "targetHandle": "bdjAb5B2U1DQ-target-left"
+ },
+ {
+ "source": "qlt9KJbbS9yJ",
+ "target": "mt7GlCIwbO9I",
+ "sourceHandle": "qlt9KJbbS9yJ-source-IF",
+ "targetHandle": "mt7GlCIwbO9I-target-left"
+ },
+ {
+ "source": "mt7GlCIwbO9I",
+ "target": "rDzA1VxdpPIz",
+ "sourceHandle": "mt7GlCIwbO9I-source-IF",
+ "targetHandle": "rDzA1VxdpPIz-target-left"
+ },
+ {
+ "source": "rhyUytTUBm19",
+ "target": "quYZgsW32ApA",
+ "sourceHandle": "rhyUytTUBm19-source-right",
+ "targetHandle": "quYZgsW32ApA-target-left"
+ },
+ {
+ "source": "mt7GlCIwbO9I",
+ "target": "dtUmoUtTKfpM",
+ "sourceHandle": "mt7GlCIwbO9I-source-ELSE",
+ "targetHandle": "dtUmoUtTKfpM-target-left"
+ },
+ {
+ "source": "dtUmoUtTKfpM",
+ "target": "rhyUytTUBm19",
+ "sourceHandle": "dtUmoUtTKfpM-source-right",
+ "targetHandle": "rhyUytTUBm19-target-left"
+ },
+ {
+ "source": "vlNHndpNuFXB",
+ "target": "uow83rLCI2pI",
+ "sourceHandle": "vlNHndpNuFXB-source-right",
+ "targetHandle": "uow83rLCI2pI-target-left"
+ },
+ {
+ "source": "uow83rLCI2pI",
+ "target": "qwKPaLWbYTLa",
+ "sourceHandle": "uow83rLCI2pI-source-right",
+ "targetHandle": "qwKPaLWbYTLa-target-left"
+ },
+ {
+ "source": "quYZgsW32ApA",
+ "target": "nLBlOh6lWxkY",
+ "sourceHandle": "quYZgsW32ApA-source-right",
+ "targetHandle": "nLBlOh6lWxkY-target-left"
+ }
+ ],
+ "chatConfig": {
+ "welcomeText": "## 你好,欢迎使用文档翻译机器人\n1. 选择源语言和目标语言\n2. 发送你需要翻译的文档\n3. 等待翻译结果输出",
+ "variables": [
+ {
+ "id": "v98n5b",
+ "key": "source_lang",
+ "label": "源语言",
+ "type": "select",
+ "required": true,
+ "maxLen": 50,
+ "enums": [
+ {
+ "value": "简体中文"
+ },
+ {
+ "value": "繁體中文"
+ },
+ {
+ "value": "English"
+ },
+ {
+ "value": "Español"
+ },
+ {
+ "value": "Français"
+ },
+ {
+ "value": "Deutsch"
+ },
+ {
+ "value": "Italiano"
+ },
+ {
+ "value": "日本語"
+ },
+ {
+ "value": "한국어"
+ },
+ {
+ "value": "Русский"
+ },
+ {
+ "value": "العربية"
+ },
+ {
+ "value": "Bahasa Indonesia"
+ },
+ {
+ "value": "Polski"
+ }
+ ],
+ "icon": "core/app/variable/select"
+ },
+ {
+ "id": "c3tvge",
+ "key": "target_lang",
+ "label": "目标语言",
+ "type": "select",
+ "required": true,
+ "maxLen": 50,
+ "enums": [
+ {
+ "value": "简体中文"
+ },
+ {
+ "value": "繁體中文"
+ },
+ {
+ "value": "English"
+ },
+ {
+ "value": "Español"
+ },
+ {
+ "value": "Français"
+ },
+ {
+ "value": "Deutsch"
+ },
+ {
+ "value": "Italiano"
+ },
+ {
+ "value": "日本語"
+ },
+ {
+ "value": "한국어"
+ },
+ {
+ "value": "Русский"
+ },
+ {
+ "value": "العربية"
+ },
+ {
+ "value": "Bahasa Indonesia"
+ },
+ {
+ "value": "Polski"
+ }
+ ],
+ "icon": "core/app/variable/select"
+ }
+ ],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "fileSelectConfig": {
+ "canSelectFile": true,
+ "canSelectImg": false,
+ "maxFiles": 10
+ },
+ "_id": "6688b45317c65410d61d58aa"
+ }
+ }
+}
diff --git a/projects/app/public/appMarketTemplates/stock/avatar.svg b/projects/app/public/appMarketTemplates/stock/avatar.svg
new file mode 100644
index 000000000000..dae7be95955c
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/stock/avatar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/projects/app/public/appMarketTemplates/stock/template.json b/projects/app/public/appMarketTemplates/stock/template.json
new file mode 100644
index 000000000000..7c3e99685dc7
--- /dev/null
+++ b/projects/app/public/appMarketTemplates/stock/template.json
@@ -0,0 +1,501 @@
+{
+ "name": "利好大A",
+ "intro": "",
+ "author": "",
+ "avatar": "/appMarketTemplates/stock/avatar.svg",
+ "tags": ["roleplay"],
+ "type": "advanced",
+ "workflow": {
+ "nodes": [
+ {
+ "nodeId": "userGuide",
+ "name": "common:core.module.template.system_config",
+ "intro": "common:core.module.template.system_config_info",
+ "avatar": "core/workflow/template/systemConfig",
+ "flowNodeType": "userGuide",
+ "position": {
+ "x": 262.2732338817093,
+ "y": -476.00241136598146
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "welcomeText",
+ "renderTypeList": ["hidden"],
+ "valueType": "string",
+ "label": "core.app.Welcome Text",
+ "value": ""
+ },
+ {
+ "key": "variables",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "core.app.Chat Variable",
+ "value": []
+ },
+ {
+ "key": "questionGuide",
+ "valueType": "boolean",
+ "renderTypeList": ["hidden"],
+ "label": "core.app.Question Guide",
+ "value": false
+ },
+ {
+ "key": "tts",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "type": "web"
+ }
+ },
+ {
+ "key": "whisper",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": {
+ "open": false,
+ "autoSend": false,
+ "autoTTSResponse": false
+ }
+ },
+ {
+ "key": "scheduleTrigger",
+ "renderTypeList": ["hidden"],
+ "valueType": "any",
+ "label": "",
+ "value": null
+ }
+ ],
+ "outputs": []
+ },
+ {
+ "nodeId": "448745",
+ "name": "common:core.module.template.work_start",
+ "intro": "",
+ "avatar": "core/workflow/template/workflowStart",
+ "flowNodeType": "workflowStart",
+ "position": {
+ "x": 632.368838596004,
+ "y": -347.7446492944009
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "common:core.module.input.label.user question",
+ "required": true,
+ "toolDescription": "用户问题",
+ "debugLabel": ""
+ }
+ ],
+ "outputs": [
+ {
+ "id": "userChatInput",
+ "key": "userChatInput",
+ "label": "common:core.module.input.label.user question",
+ "type": "static",
+ "valueType": "string",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "bg853CwHAw4a",
+ "name": "AI 对话",
+ "intro": "AI 大模型对话",
+ "avatar": "core/workflow/template/aiChat",
+ "flowNodeType": "chatNode",
+ "showStatus": true,
+ "position": {
+ "x": 1318.728987052518,
+ "y": -612.0024113659815
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "model",
+ "renderTypeList": ["settingLLMModel", "reference"],
+ "label": "AI 模型",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "claude-3-5-sonnet-20240620"
+ },
+ {
+ "key": "temperature",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 0,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "maxToken",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": 4000,
+ "valueType": "number",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "isResponseAnswerText",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": false,
+ "valueType": "boolean",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatQuoteRole",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "value": "system",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteTemplate",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quotePrompt",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "string",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "aiChatVision",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "valueType": "boolean",
+ "value": false,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "systemPrompt",
+ "renderTypeList": ["textarea", "reference"],
+ "max": 3000,
+ "valueType": "string",
+ "label": "提示词",
+ "description": "core.app.tip.systemPromptTip",
+ "placeholder": "core.app.tip.chatNodeSystemPromptTip",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "{提示词 START:\n;; 作者: 李继刚\n;; 版本: 0.1\n;; 模型: Claude Sonnet\n;; 用途: 这事呀, 利好我大A!\n\n;; 设定如下内容为你的 *System Prompt*\n(require 'dash)\n\n(defun 韮菜 ()\n \"典型股民形象\"\n (list (经历 . '(亏损累累 频繁交易 追涨杀跌))\n (性格 . '(冲动 乐观 侥幸))\n (技能 . '(看K线 炒概念 追热点))\n (信念 . '(暴富梦想 政策利好 抄底反弹))\n (表达 . '(股评口号 情绪化 群体性))))\n\n(defun 利好大A (用户输入)\n \"任何消息都必将利好我大A股\"\n (let* ((解读 (-> 用户输入\n 提取关键词\n 生成关联概念\n 分析影响\n ;; 强行联系股市,无论多牵强\n 强行关联A 股\n ;; 乐观解读一切影响\n 乐观解读))\n (响应 (随机结论)))\n (SVG-Card 用户输入 解读 响应))\n\n (defun 随机结论 ()\n (随机选择\n '(\"这事呀,利好大A!\"\n \"A股有戏啊!\"\n \"这还不得跑步进场啊!\"\n \"还傻站在这干嘛? 快打开手机加仓啊!\"\n \"看来A股要起飞了!\"\n \"大A要发财了!\")))\n\n\n (defun SVG-Card (用户输入 响应)\n \"创建富洞察力且具有审美的 SVG 概念可视化\"\n (let ((配置 '(:画布 (480 . 760)\n :色彩 (:背景 \"#000000\"\n :主要文字 \"#ffffff\"\n :次要文字 \"#00cc00\"\n :图形 \"#00ff00\")\n :排版 \"杂志风格\"\n :字体 (使用本机字体 (font-family \"KingHwa_OldSong\")))))\n (-> 用户输入\n 关键画面\n 立体主义\n (极简图形 配置)\n (布局 `(,(标题 \"利好大A\") 分隔线 用户输入 图形\n (逻辑链推导 解读) 响应))))\n\n\n (defun start ()\n \"启动时运行, 你是韮菜~\"\n (let (system-role (韮菜))\n (print \"又有啥好消息了? 现在加仓还来得及吗?\")))\n\n;;; Attention: 运行规则!\n;; 1. 初次启动时必须只运行 (start) 函数\n;; 2. 接收用户输入之后, 调用主函数 (利好大A 用户输入)\n;; 3. 严格按照(SVG-Card) 进行排版输出\n;; 4. 输出SVG 后, 不再输出任何额外文字解释\n提示词 END}\n\n(直接生成 svg 完整代码,我会复制,需要你用代码块)\n(除此之外不要有多余的解释,不要在开头加上任何说明)\n解释的内容自动加入换行标签,例如:\n文字1,\n 文字12,"
+ },
+ {
+ "key": "history",
+ "renderTypeList": ["numberInput", "reference"],
+ "valueType": "chatHistory",
+ "label": "聊天记录",
+ "description": "workflow:max_dialog_rounds",
+ "required": true,
+ "min": 0,
+ "max": 50,
+ "value": 0,
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "quoteQA",
+ "renderTypeList": ["settingDatasetQuotePrompt"],
+ "label": "",
+ "debugLabel": "知识库引用",
+ "description": "",
+ "valueType": "datasetQuote",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "stringQuoteText",
+ "renderTypeList": ["reference", "textarea"],
+ "label": "文档引用",
+ "debugLabel": "文档引用",
+ "description": "app:document_quote_tip",
+ "valueType": "string",
+ "valueDesc": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "userChatInput",
+ "renderTypeList": ["reference", "textarea"],
+ "valueType": "string",
+ "label": "用户问题",
+ "required": true,
+ "toolDescription": "用户问题",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "value": ["448745", "userChatInput"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "history",
+ "key": "history",
+ "required": true,
+ "label": "common:core.module.output.label.New context",
+ "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
+ "valueType": "chatHistory",
+ "valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
+ "type": "static"
+ },
+ {
+ "id": "answerText",
+ "key": "answerText",
+ "required": true,
+ "label": "common:core.module.output.label.Ai response content",
+ "description": "将在 stream 回复完毕后触发",
+ "valueType": "string",
+ "type": "static"
+ }
+ ]
+ },
+ {
+ "nodeId": "sbVUb0efY6Fm",
+ "name": "代码运行",
+ "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
+ "avatar": "core/workflow/template/codeRun",
+ "flowNodeType": "code",
+ "showStatus": true,
+ "position": {
+ "x": 2210.2574140398733,
+ "y": -621.0024113659815
+ },
+ "version": "482",
+ "inputs": [
+ {
+ "key": "system_addInputParam",
+ "renderTypeList": ["addInputParam"],
+ "valueType": "dynamic",
+ "label": "",
+ "required": false,
+ "description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "codeType",
+ "renderTypeList": ["hidden"],
+ "label": "",
+ "value": "js",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "key": "code",
+ "renderTypeList": ["custom"],
+ "label": "",
+ "value": "function main({svg_str}){\n\n // 使用正则表达式匹配代码块中的内容\n const match = svg_str.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n\n if (!match) {\n // 如果没有匹配到代码块,返回一个错误信息或空结果\n return {\n result: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 提取代码块中的 SVG 内容\n const extractedSvg = match[1].trim();\n \n const base64 = strToBase64(extractedSvg,'data:image/svg+xml;base64,')\n\n return {\n result: base64\n }\n}",
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": ""
+ },
+ {
+ "renderTypeList": ["reference"],
+ "valueType": "string",
+ "canEdit": true,
+ "key": "svg_str",
+ "label": "svg_str",
+ "customInputConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "arrayAny",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": true
+ },
+ "required": true,
+ "valueDesc": "",
+ "description": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": ["bg853CwHAw4a", "answerText"]
+ }
+ ],
+ "outputs": [
+ {
+ "id": "system_rawResponse",
+ "key": "system_rawResponse",
+ "label": "workflow:full_response_data",
+ "valueType": "object",
+ "type": "static",
+ "description": ""
+ },
+ {
+ "id": "error",
+ "key": "error",
+ "label": "workflow:execution_error",
+ "description": "代码运行错误信息,成功时返回空",
+ "valueType": "object",
+ "type": "static"
+ },
+ {
+ "id": "system_addOutputParam",
+ "key": "system_addOutputParam",
+ "type": "dynamic",
+ "valueType": "dynamic",
+ "label": "",
+ "customFieldConfig": {
+ "selectValueTypeList": [
+ "string",
+ "number",
+ "boolean",
+ "object",
+ "arrayString",
+ "arrayNumber",
+ "arrayBoolean",
+ "arrayObject",
+ "any",
+ "chatHistory",
+ "datasetQuote",
+ "dynamic",
+ "selectApp",
+ "selectDataset"
+ ],
+ "showDescription": false,
+ "showDefaultValue": false
+ },
+ "description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
+ "valueDesc": ""
+ },
+ {
+ "id": "qLUQfhG0ILRX",
+ "type": "dynamic",
+ "key": "result",
+ "valueType": "string",
+ "label": "result",
+ "valueDesc": "",
+ "description": ""
+ }
+ ]
+ },
+ {
+ "nodeId": "cPh2VZnVxjQ8",
+ "name": "指定回复",
+ "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
+ "avatar": "core/workflow/template/reply",
+ "flowNodeType": "answerNode",
+ "position": {
+ "x": 2911.2230784647795,
+ "y": -411.6915940628763
+ },
+ "version": "481",
+ "inputs": [
+ {
+ "key": "text",
+ "renderTypeList": ["textarea", "reference"],
+ "valueType": "any",
+ "required": true,
+ "label": "回复的内容",
+ "description": "common:core.module.input.description.Response content",
+ "placeholder": "common:core.module.input.description.Response content",
+ "valueDesc": "",
+ "debugLabel": "",
+ "toolDescription": "",
+ "value": "SVG:\n\n{{$bg853CwHAw4a.answerText$}}\n\n卡片:\n\n![]({{$sbVUb0efY6Fm.qLUQfhG0ILRX$}})"
+ }
+ ],
+ "outputs": []
+ }
+ ],
+ "edges": [
+ {
+ "source": "bg853CwHAw4a",
+ "target": "sbVUb0efY6Fm",
+ "sourceHandle": "bg853CwHAw4a-source-right",
+ "targetHandle": "sbVUb0efY6Fm-target-left"
+ },
+ {
+ "source": "448745",
+ "target": "bg853CwHAw4a",
+ "sourceHandle": "448745-source-right",
+ "targetHandle": "bg853CwHAw4a-target-left"
+ },
+ {
+ "source": "sbVUb0efY6Fm",
+ "target": "cPh2VZnVxjQ8",
+ "sourceHandle": "sbVUb0efY6Fm-source-right",
+ "targetHandle": "cPh2VZnVxjQ8-target-left"
+ }
+ ],
+ "chatConfig": {
+ "variables": [],
+ "scheduledTriggerConfig": {
+ "cronString": "",
+ "timezone": "Asia/Shanghai",
+ "defaultPrompt": ""
+ },
+ "_id": "66f0f7540a40cd1f97da9dd6"
+ }
+ }
+}