Commit c8bc9838 by Archer Committed by GitHub

feat: app template;fix: chat test reset (#1838)

* feat: app template;fix: chat test reset

* template output

* template output
parent 5c8c7fb9
...@@ -46,12 +46,14 @@ curl --location --request POST 'https://{{host}}/api/admin/init/485' \ ...@@ -46,12 +46,14 @@ curl --location --request POST 'https://{{host}}/api/admin/init/485' \
1. 新增 - 合并插件和应用,统一成工作台 1. 新增 - 合并插件和应用,统一成工作台
2. 新增 - 应用创建副本功能 2. 新增 - 应用创建副本功能
3. 优化 - 原文件编码存取 3. 新增 - 应用创建模板
4. 优化 - 文件夹读取,支持单个文件夹超出 100 个文件 4. 新增 - 支持代码运行结果作为工具输出。
5. 优化 - 问答拆分/手动录入,当有`a`字段时,自动将`q`作为补充索引。 5. 优化 - 原文件编码存取
6. 优化 - 对话框页面代码 6. 优化 - 文件夹读取,支持单个文件夹超出 100 个文件
7. 修复 - SSR渲染 7. 优化 - 问答拆分/手动录入,当有`a`字段时,自动将`q`作为补充索引。
8. 修复 - 定时任务无法实际关闭 8. 优化 - 对话框页面代码
9. 修复 - 输入引导特殊字符导致正则报错 9. 修复 - SSR渲染
10. 修复 - 文件包含特殊字符`%`,且为转义时会导致页面崩溃 10. 修复 - 定时任务无法实际关闭
11. 修复 - 自定义输入选择知识库引用时页面崩溃 11. 修复 - 输入引导特殊字符导致正则报错
\ No newline at end of file 12. 修复 - 文件包含特殊字符`%`,且为转义时会导致页面崩溃
13. 修复 - 自定义输入选择知识库引用时页面崩溃
\ No newline at end of file
...@@ -272,7 +272,7 @@ Response: ...@@ -272,7 +272,7 @@ Response:
{ {
"key": "Authorization", "key": "Authorization",
"type": "string", "type": "string",
"value": "Bearer sk-zsfBsxEU3ApSFGYxF4CdB97e9556412588421823371b9f7b" "value": "Bearer "
} }
], ],
"label": "", "label": "",
......
...@@ -26,456 +26,378 @@ weight: 404 ...@@ -26,456 +26,378 @@ weight: 404
{{% details title="编排配置" closed="true" %}} {{% details title="编排配置" closed="true" %}}
```json ```json
[ {
"nodes": [
{ {
"nodeId": "userGuide", "nodeId": "userGuide",
"name": "core.module.template.App system setting", "name": "系统配置",
"intro": "core.app.tip.userGuideTip", "intro": "可以配置应用的系统参数",
"avatar": "/imgs/workflow/userGuide.png", "avatar": "/imgs/workflow/userGuide.png",
"flowNodeType": "userGuide", "flowNodeType": "userGuide",
"position": { "position": {
"x": -92.26884681344463, "x": 303.41163758039283,
"y": 710.9354029649536 "y": -552.297639861266
}, },
"inputs": [ "version": "481",
{ "inputs": [],
"key": "welcomeText",
"type": "hidden",
"valueType": "string",
"label": "core.app.Welcome Text",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "",
"connected": false
},
{
"key": "variables",
"type": "hidden",
"valueType": "any",
"label": "core.module.Variable",
"value": [],
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "questionGuide",
"valueType": "boolean",
"type": "switch",
"label": "",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": false,
"connected": false
},
{
"key": "tts",
"type": "hidden",
"valueType": "any",
"label": "",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": {
"type": "web"
},
"connected": false
}
],
"outputs": [] "outputs": []
}, },
{ {
"nodeId": "userChatInput", "nodeId": "workflowStartNodeId",
"name": "core.module.template.Chat entrance", "name": "流程开始",
"intro": "当用户发送一个内容后,流程将会从这个模块开始执行。", "intro": "",
"avatar": "/imgs/workflow/userChatInput.svg", "avatar": "/imgs/workflow/userChatInput.svg",
"flowNodeType": "questionInput", "flowNodeType": "workflowStart",
"position": { "position": {
"x": 241.60980819261408, "x": 529.3935295017156,
"y": 1330.9528898009685 "y": 197.114018410347
}, },
"version": "481",
"inputs": [ "inputs": [
{ {
"key": "userChatInput", "key": "userChatInput",
"type": "systemInput", "renderTypeList": [
"reference",
"textarea"
],
"valueType": "string", "valueType": "string",
"label": "core.module.input.label.user question", "label": "用户问题",
"showTargetInApp": false, "required": true,
"showTargetInPlugin": false, "toolDescription": "用户问题"
"connected": false
} }
], ],
"outputs": [ "outputs": [
{ {
"id": "userChatInput",
"key": "userChatInput", "key": "userChatInput",
"label": "core.module.input.label.user question", "label": "core.module.input.label.user question",
"type": "source",
"valueType": "string", "valueType": "string",
"targets": [ "type": "static"
{
"nodeId": "n84rvg",
"key": "userChatInput"
}
]
} }
] ]
}, },
{ {
"nodeId": "n84rvg", "nodeId": "u6IAOEssxoZT",
"name": "工具调用(实验)", "name": "工具调用(实验)",
"intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。", "intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
"avatar": "/imgs/workflow/tool.svg", "avatar": "/imgs/workflow/tool.svg",
"flowNodeType": "tools", "flowNodeType": "tools",
"showStatus": true, "showStatus": true,
"position": { "position": {
"x": 809.4264785615641, "x": 1003.146243538873,
"y": 873.3971746859133 "y": 48.52327869406625
}, },
"version": "481",
"inputs": [ "inputs": [
{ {
"key": "model", "key": "model",
"type": "settingLLMModel", "renderTypeList": [
"settingLLMModel",
"reference"
],
"label": "core.module.input.label.aiModel", "label": "core.module.input.label.aiModel",
"required": true,
"valueType": "string", "valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"llmModelType": "all", "llmModelType": "all",
"value": "gpt-3.5-turbo", "value": "gpt-3.5-turbo"
"connected": false
}, },
{ {
"key": "temperature", "key": "temperature",
"type": "hidden", "renderTypeList": [
"hidden"
],
"label": "", "label": "",
"value": 0, "value": 0,
"valueType": "number", "valueType": "number",
"min": 0, "min": 0,
"max": 10, "max": 10,
"step": 1, "step": 1
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}, },
{ {
"key": "maxToken", "key": "maxToken",
"type": "hidden", "renderTypeList": [
"hidden"
],
"label": "", "label": "",
"value": 2000, "value": 2000,
"valueType": "number", "valueType": "number",
"min": 100, "min": 100,
"max": 4000, "max": 4000,
"step": 50, "step": 50
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}, },
{ {
"key": "systemPrompt", "key": "systemPrompt",
"type": "textarea", "renderTypeList": [
"textarea",
"reference"
],
"max": 3000, "max": 3000,
"valueType": "string", "valueType": "string",
"label": "core.ai.Prompt", "label": "core.ai.Prompt",
"description": "core.app.tip.chatNodeSystemPromptTip", "description": "core.app.tip.chatNodeSystemPromptTip",
"placeholder": "core.app.tip.chatNodeSystemPromptTip", "placeholder": "core.app.tip.chatNodeSystemPromptTip"
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
}, },
{ {
"key": "history", "key": "history",
"type": "numberInput", "renderTypeList": [
"numberInput",
"reference"
],
"valueType": "chatHistory",
"label": "core.module.input.label.chat history", "label": "core.module.input.label.chat history",
"description": "最多携带多少轮对话记录",
"required": true, "required": true,
"min": 0, "min": 0,
"max": 30, "max": 50,
"valueType": "chatHistory", "value": 6
"value": 6,
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
}, },
{ {
"key": "userChatInput", "key": "userChatInput",
"type": "custom", "renderTypeList": [
"label": "", "reference",
"required": true, "textarea"
],
"valueType": "string", "valueType": "string",
"showTargetInApp": true, "label": "用户问题",
"showTargetInPlugin": true, "required": true,
"connected": true "value": [
"workflowStartNodeId",
"userChatInput"
]
} }
], ],
"outputs": [ "outputs": [
{ {
"key": "userChatInput", "id": "answerText",
"label": "core.module.input.label.user question", "key": "answerText",
"type": "hidden", "label": "core.module.output.label.Ai response content",
"description": "core.module.output.description.Ai response content",
"valueType": "string", "valueType": "string",
"targets": [] "type": "static"
},
{
"key": "selectedTools",
"valueType": "tools",
"type": "hidden",
"targets": [
{
"nodeId": "3mbu91",
"key": "selectedTools"
} }
] ]
}, },
{ {
"key": "finish", "nodeId": "fvY5hb0K646V",
"label": "", "name": "工具调用终止",
"description": "", "intro": "该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。",
"valueType": "boolean", "avatar": "/imgs/workflow/toolStop.svg",
"type": "hidden", "flowNodeType": "stopTool",
"targets": [] "position": {
} "x": 2367.838362362707,
] "y": 732.355988936165
},
"version": "481",
"inputs": [],
"outputs": []
}, },
{ {
"nodeId": "3mbu91", "nodeId": "x9rN2a4WnZmt",
"name": "HTTP 请求", "name": "HTTP 请求",
"intro": "调用飞书webhook,发送一个通知", "intro": "向飞书发送一个webhooks通知信息。",
"avatar": "/imgs/workflow/http.png", "avatar": "/imgs/workflow/http.png",
"flowNodeType": "httpRequest468", "flowNodeType": "httpRequest468",
"showStatus": true, "showStatus": true,
"position": { "position": {
"x": 1483.6437630977423, "x": 1623.9214305901633,
"y": 798.9716928475544 "y": 22.777089001645862
}, },
"version": "481",
"inputs": [ "inputs": [
{
"key": "system_addInputParam",
"renderTypeList": [
"addInputParam"
],
"valueType": "dynamic",
"label": "",
"required": false,
"description": "core.module.input.description.HTTP Dynamic Input",
"editField": {
"key": true,
"valueType": true
}
},
{
"valueType": "string",
"renderTypeList": [
"reference"
],
"key": "text",
"label": "text",
"toolDescription": "发送的消息",
"required": true,
"canEdit": true,
"editField": {
"key": true,
"description": true
}
},
{ {
"key": "system_httpMethod", "key": "system_httpMethod",
"type": "custom", "renderTypeList": [
"custom"
],
"valueType": "string", "valueType": "string",
"label": "", "label": "",
"value": "POST", "value": "POST",
"required": true, "required": true
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}, },
{ {
"key": "system_httpReqUrl", "key": "system_httpReqUrl",
"type": "hidden", "renderTypeList": [
"hidden"
],
"valueType": "string", "valueType": "string",
"label": "", "label": "",
"description": "core.module.input.description.Http Request Url", "description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"showTargetInApp": false, "value": ""
"showTargetInPlugin": false,
"value": "这里填写你的飞书机器人地址",
"connected": false
}, },
{ {
"key": "system_httpHeader", "key": "system_httpHeader",
"type": "custom", "renderTypeList": [
"custom"
],
"valueType": "any", "valueType": "any",
"value": [], "value": [],
"label": "", "label": "",
"description": "core.module.input.description.Http Request Header", "description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header", "placeholder": "core.module.input.description.Http Request Header",
"required": false, "required": false
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}, },
{ {
"key": "system_httpParams", "key": "system_httpParams",
"type": "hidden", "renderTypeList": [
"hidden"
],
"valueType": "any", "valueType": "any",
"value": [], "value": [],
"label": "", "label": "",
"required": false, "required": false
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}, },
{ {
"key": "system_httpJsonBody", "key": "system_httpJsonBody",
"type": "hidden", "renderTypeList": [
"hidden"
],
"valueType": "any", "valueType": "any",
"value": "{\r\n \"msg_type\": \"text\",\r\n \"content\": {\r\n \"text\": \"{{text}}\"\r\n }\r\n}", "value": "{\r\n \"msg_type\": \"text\",\r\n \"content\": {\r\n \"text\": \"{{text}}\"\r\n }\r\n}",
"label": "", "label": "",
"required": false, "required": false
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.workflow.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string"
},
"connected": false
},
{
"valueType": "string",
"type": "hidden",
"key": "text",
"label": "text",
"toolDescription": "需要发送的通知内容",
"required": true,
"connected": false
} }
], ],
"outputs": [ "outputs": [
{ {
"key": "httpRawResponse", "id": "system_addOutputParam",
"label": "原始响应",
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"valueType": "any",
"type": "source",
"targets": [
{
"nodeId": "rzx4mj",
"key": "switch"
},
{
"nodeId": "psdhs1",
"key": "switch"
}
]
},
{
"key": "system_addOutputParam", "key": "system_addOutputParam",
"type": "addOutputParam", "type": "dynamic",
"valueType": "any", "valueType": "dynamic",
"label": "", "label": "",
"targets": [],
"editField": { "editField": {
"key": true, "key": true,
"description": true, "valueType": true
"dataType": true,
"defaultValue": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
} }
}, },
{ {
"type": "source", "id": "error",
"valueType": "string", "key": "error",
"key": "prompt", "label": "请求错误",
"label": "prompt", "description": "HTTP请求错误信息,成功时返回空",
"description": "", "valueType": "object",
"required": false, "type": "static"
"edit": true,
"editField": {
"key": true,
"description": true,
"dataType": true,
"defaultValue": true
},
"targets": []
}
]
}, },
{ {
"nodeId": "rzx4mj", "id": "httpRawResponse",
"name": "工具调用终止", "key": "httpRawResponse",
"intro": "该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。", "label": "原始响应",
"avatar": "/imgs/workflow/toolStop.svg", "required": true,
"flowNodeType": "stopTool", "description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"position": {
"x": 2145.5070710160267,
"y": 1306.3581817783079
},
"inputs": [
{
"key": "switch",
"type": "triggerAndFinish",
"label": "",
"description": "core.module.input.description.Trigger",
"valueType": "any", "valueType": "any",
"showTargetInApp": true, "type": "static"
"showTargetInPlugin": true,
"connected": true
} }
], ]
"outputs": []
}, },
{ {
"nodeId": "psdhs1", "nodeId": "aGHGqH2oUupj",
"name": "指定回复", "name": "指定回复",
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。", "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
"avatar": "/imgs/workflow/reply.png", "avatar": "/imgs/workflow/reply.png",
"flowNodeType": "answerNode", "flowNodeType": "answerNode",
"position": { "position": {
"x": 2117.0429459850598, "x": 2350.7077940158674,
"y": 1658.4125434513746 "y": 107.32448732713493
}, },
"version": "481",
"inputs": [ "inputs": [
{ {
"key": "switch",
"type": "triggerAndFinish",
"label": "",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "text", "key": "text",
"type": "textarea", "renderTypeList": [
"textarea",
"reference"
],
"valueType": "any", "valueType": "any",
"required": true,
"label": "core.module.input.label.Response content", "label": "core.module.input.label.Response content",
"description": "core.module.input.description.Response content", "description": "core.module.input.description.Response content",
"placeholder": "core.module.input.description.Response content", "placeholder": "core.module.input.description.Response content",
"showTargetInApp": true, "value": "嘻嘻,发送成功"
"showTargetInPlugin": true,
"value": "笑死发送成功啦",
"connected": false
} }
], ],
"outputs": [ "outputs": []
}
],
"edges": [
{ {
"key": "finish", "source": "workflowStartNodeId",
"label": "", "target": "u6IAOEssxoZT",
"description": "", "sourceHandle": "workflowStartNodeId-source-right",
"valueType": "boolean", "targetHandle": "u6IAOEssxoZT-target-left"
"type": "hidden", },
"targets": [] {
"source": "u6IAOEssxoZT",
"target": "x9rN2a4WnZmt",
"sourceHandle": "selectedTools",
"targetHandle": "selectedTools"
},
{
"source": "x9rN2a4WnZmt",
"target": "fvY5hb0K646V",
"sourceHandle": "x9rN2a4WnZmt-source-right",
"targetHandle": "fvY5hb0K646V-target-left"
},
{
"source": "x9rN2a4WnZmt",
"target": "aGHGqH2oUupj",
"sourceHandle": "x9rN2a4WnZmt-source-right",
"targetHandle": "aGHGqH2oUupj-target-left"
}
],
"chatConfig": {
"variables": [
{
"id": "txq1ca",
"key": "test",
"label": "测试",
"type": "custom",
"required": true,
"maxLen": 50,
"enums": [
{
"value": ""
} }
] ]
} }
] ],
"questionGuide": false,
"scheduledTriggerConfig": {
"cronString": "",
"timezone": "Asia/Shanghai",
"defaultPrompt": ""
},
"_id": "66715d4bf577287d39e35ecf"
}
}
``` ```
{{% /details %}} {{% /details %}}
......
...@@ -42,6 +42,7 @@ export const dispatchRunCode = async (props: RunCodeType): Promise<RunCodeRespon ...@@ -42,6 +42,7 @@ export const dispatchRunCode = async (props: RunCodeType): Promise<RunCodeRespon
customOutputs: runResult.data.codeReturn, customOutputs: runResult.data.codeReturn,
codeLog: runResult.data.log codeLog: runResult.data.log
}, },
[DispatchNodeResponseKeyEnum.toolResponses]: runResult.data.codeReturn,
...runResult.data.codeReturn ...runResult.data.codeReturn
}; };
} else { } else {
......
<svg t="1719285602998" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13146" width="256" height="256"><path d="M383.853714 257.170286l-0.487619-4.681143c-14.019048-104.082286 73.264762-183.759238 184.758857-139.580953 45.83619 18.16381 94.329905 45.884952 126.415238 73.386667A30.47619 30.47619 0 0 1 654.872381 232.594286c-26.575238-22.77181-69.241905-47.201524-109.226667-63.024762-64.121905-25.404952-107.910095 12.653714-102.351238 70.631619l0.487619 4.169143c6.777905 50.785524-13.775238 96.207238-58.148571 114.663619-58.09981 24.137143-121.392762 5.510095-149.138286-55.344762-8.362667-18.334476-34.986667-33.475048-62.342095-32.402286-33.767619 1.316571-64.146286 25.404952-84.163048 77.653333-67.876571 177.005714 15.262476 371.614476 190.805334 441.148953 68.388571 27.111619 147.602286 30.549333 221.379047 11.702857a30.47619 30.47619 0 0 1 15.116191 59.050667c-85.869714 21.942857-178.176 17.92-258.925715-14.092191-206.848-81.92-305.005714-311.661714-225.28-519.631238C61.44 253.123048 112.39619 212.699429 171.78819 210.383238c49.39581-1.926095 97.475048 24.33219 117.906286 63.439238l2.243048 4.559238c13.04381 28.598857 40.569905 36.693333 70.314666 24.356572 15.36-6.38781 23.454476-22.601143 21.601524-45.592381zM826.343619 18.992762a30.47619 30.47619 0 0 1 52.370286 31.134476l-5.290667 9.313524-3.267048 5.948952c-7.070476 12.946286-14.969905 28.184381-23.478857 45.568a1723.026286 1723.026286 0 0 0-71.801904 169.618286c-3.730286 10.264381-7.387429 20.626286-10.971429 31.085714-27.843048 81.188571-43.715048 167.424-50.517333 250.148572a30.47619 30.47619 0 0 1-60.757334-4.998096c7.192381-87.381333 23.942095-178.41981 53.613715-264.923428 3.705905-10.825143 7.484952-21.528381 11.361523-32.134095a1783.710476 1783.710476 0 0 1 74.361905-175.640381l8.679619-17.456762c4.242286-8.362667 8.313905-16.164571 12.190476-23.405714l10.337524-18.797715c1.316571-2.31619 2.364952-4.144762 3.169524-5.461333zM990.305524 45.251048a30.47619 30.47619 0 0 1 28.135619 32.670476l-1.316572 13.921524a959.878095 959.878095 0 0 1-0.950857 8.387047l-2.291809 18.432c-1.706667 12.873143-3.754667 26.86781-6.217143 41.886476a1806.921143 1806.921143 0 0 1-47.542857 209.066667c-15.555048 53.76-37.034667 108.153905-62.927238 162.133333a1327.250286 1327.250286 0 0 1-61.147429 112.88381l-8.533333 13.897143c-2.730667 4.388571-5.412571 8.582095-7.948191 12.55619l-10.678857 16.140191a30.47619 30.47619 0 1 1-51.053714-33.353143l6.972952-10.410667 7.216762-11.215238a1266.736762 1266.736762 0 0 0 70.217143-126.902857c24.527238-51.102476 44.78781-102.4 59.318857-152.673524a1746.236952 1746.236952 0 0 0 45.958095-201.947428c2.340571-14.384762 4.315429-27.769905 5.924572-39.984762l2.194286-17.505524c1.145905-9.849905 1.755429-16.579048 2.023619-19.846095a30.47619 30.47619 0 0 1 29.525333-28.208762l3.120762 0.073143z" fill="#5AC2EE" p-id="13147"></path><path d="M594.944 641.609143c-6.192762 5.38819-13.848381 14.628571-20.967619 28.038095-17.529905 33.01181-23.235048 76.092952-11.434667 128.731429 9.581714 42.73981 3.85219 84.74819-11.702857 123.245714a213.113905 213.113905 0 0 1-11.142095 23.478857l-4.315429 7.265524c-15.335619 22.479238 4.217905 52.248381 30.939429 47.104 15.774476-3.023238 41.447619-11.337143 73.679238-27.452952 52.687238-26.331429 105.130667-65.462857 153.84381-119.759239 4.217905-4.705524 8.411429-9.532952 12.55619-14.457904 53.174857-63.24419 38.838857-154.209524-25.453714-203.580953-54.613333-41.984-131.779048-39.984762-182.393905 4.096l-3.608381 3.291429z m148.870095 40.935619c37.741714 29.013333 45.860571 80.457143 15.945143 116.004571-3.730286 4.437333-7.484952 8.777143-11.288381 13.019429l-8.728381 9.508571c-37.961143 40.350476-77.897143 70.38781-117.784381 91.672381l-4.486095 2.29181 1.194667-4.071619c10.069333-36.985905 12.775619-76.239238 5.266285-116.589715l-1.926095-9.337904c-8.630857-38.473143-4.87619-66.681905 5.802667-86.820572 2.925714-5.485714 5.461333-8.825905 6.631619-10.118095l1.536-1.438476c28.525714-27.209143 75.142095-29.257143 107.836952-4.144762z" fill="#5AC2EE" p-id="13148"></path><path d="M663.210667 743.545905c18.334476-7.314286 38.253714-9.508571 58.294857-2.998857l6.290286 2.340571 4.510476 1.950476c3.120762 1.487238 5.973333 3.169524 12.970666 7.484953l3.267048 1.999238c16.871619 10.361905 20.23619 10.556952 36.181333-3.291429a30.47619 30.47619 0 1 1 39.936 46.08c-37.497905 32.475429-68.266667 32.182857-103.765333 11.702857l-13.628952-8.216381a26.136381 26.136381 0 0 0-2.340572-1.219047l-0.902095-0.365715c-5.193143-2.072381-11.580952-1.511619-18.212571 1.145905l-3.82781 1.755429a30.47619 30.47619 0 1 1-33.401905-50.980572c3.34019-2.194286 8.289524-4.87619 14.628572-7.387428zM759.686095 498.688l96.889905 29.866667-17.944381 58.270476-96.914286-29.891048zM243.321905 571.075048a50.371048 50.371048 0 1 0 0 100.766476 50.371048 50.371048 0 0 0 0-100.766476z m0 39.814095a10.581333 10.581333 0 1 1 0 21.138286 10.581333 10.581333 0 0 1 0-21.138286zM402.529524 650.703238a50.371048 50.371048 0 1 0 0 100.742095 50.371048 50.371048 0 0 0 0-100.742095z m0 39.789714a10.581333 10.581333 0 1 1 0 21.162667 10.581333 10.581333 0 0 1 0-21.162667zM183.588571 411.867429a50.371048 50.371048 0 1 0 0 100.766476 50.371048 50.371048 0 0 0 0-100.766476z m0 39.814095a10.581333 10.581333 0 1 1 0 21.138286 10.581333 10.581333 0 0 1 0-21.138286zM561.761524 252.635429a50.371048 50.371048 0 1 0 0 100.766476 50.371048 50.371048 0 0 0 0-100.766476z m0 39.814095a10.556952 10.556952 0 1 1 0 21.138286 10.556952 10.556952 0 0 1 0-21.138286z" fill="#5AC2EE" p-id="13149"></path></svg>
\ No newline at end of file
<svg t="1719284536895" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5409" width="256" height="256"><path d="M891.318857 340.845714c4.900571 0 9.728 0.292571 14.628572 0.804572a409.965714 409.965714 0 0 1 108.836571 30.061714c10.093714 4.534857 12.580571 8.192 3.949714 17.334857-24.868571 26.624-45.494857 57.051429-61.001143 89.965714-16.822857 35.328-35.108571 69.851429-52.297142 105.033143a225.28 225.28 0 0 1-52.150858 69.412572c-53.613714 48.493714-116.150857 68.973714-187.538285 59.099428-81.92-11.337143-159.451429-38.985143-232.740572-75.483428a143.506286 143.506286 0 0 1-10.459428-5.485715 5.339429 5.339429 0 0 1 0.292571-9.216l5.12-2.706285c59.245714-31.670857 108.836571-75.849143 156.525714-122.294857 20.187429-19.529143 39.497143-40.009143 59.904-59.318858A345.014857 345.014857 0 0 1 804.571429 352.256c13.165714-3.218286 26.550857-5.778286 39.789714-8.630857h0.585143l28.233143-2.56" fill="#133C9A" p-id="5410"></path><path d="M317.659429 913.846857c-8.996571-0.512-31.158857-3.584-33.865143-3.949714a536.429714 536.429714 0 0 1-165.083429-48.274286c-30.208-14.116571-59.245714-30.72-88.356571-46.957714-19.163429-10.678857-27.794286-27.282286-27.648-49.883429 0.585143-83.382857 0.585143-166.765714 0-250.148571C2.413714 461.019429 0.731429 407.405714 0 353.718857c0-4.754286 0.731429-9.508571 2.194286-13.897143 3.291429-9.728 9.947429-10.24 16.530285-3.949714 7.606857 7.314286 13.677714 16.237714 21.211429 23.405714 67.291429 66.413714 138.752 127.195429 218.770286 177.225143 45.056 28.891429 91.940571 54.710857 140.434285 77.385143 77.750857 35.328 157.549714 66.486857 241.078858 86.235429 73.874286 17.481143 145.627429 6.436571 205.458285-40.374858 18.285714-15.652571 27.282286-27.062857 48.932572-55.881142a359.862857 359.862857 0 0 1-37.376 72.850285c-13.897143 21.942857-45.348571 51.2-69.193143 74.093715-36.278857 35.108571-83.748571 63.561143-128.292572 87.552-48.566857 26.185143-99.035429 47.104-152.941714 58.514285-27.648 6.948571-67.584 14.848-81.334857 15.579429-2.413714-0.146286-10.678857 1.682286-14.848 1.389714-35.547429 2.633143-57.490286 3.657143-92.891429 0z" fill="#3370FF" p-id="5411"></path><path d="M165.083429 110.518857a52.443429 52.443429 0 0 1 7.460571 0c152.649143 0 304.128 2.486857 456.630857 2.486857 0.292571 0 0.585143 0 0.731429 0.219429 14.189714 12.361143 27.282286 25.746286 39.277714 40.155428 34.450286 34.230857 60.123429 93.622857 77.677714 129.755429 8.777143 25.014857 21.942857 48.859429 28.16 76.8v0.438857c-15.579429 5.046857-30.72 11.190857-45.348571 18.505143-44.178286 22.381714-64.219429 38.765714-100.790857 74.752-19.968 19.529143-37.010286 37.083429-63.488 62.098286a563.346286 563.346286 0 0 1-29.769143 26.916571c-7.021714-12.434286-125.732571-244.589714-364.251429-427.300571" fill="#00D6B9" p-id="5412"></path></svg>
\ No newline at end of file
<svg t="1719285050683" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6411" width="256" height="256"><path d="M214.101333 512c0-32.512 5.546667-63.701333 15.36-92.928L57.173333 290.218667A491.861333 491.861333 0 0 0 4.693333 512c0 79.701333 18.858667 154.88 52.394667 221.610667l172.202667-129.066667A290.56 290.56 0 0 1 214.101333 512" fill="#FBBC05" p-id="6412"></path><path d="M516.693333 216.192c72.106667 0 137.258667 25.002667 188.458667 65.962667L854.101333 136.533333C763.349333 59.178667 646.997333 11.392 516.693333 11.392c-202.325333 0-376.234667 113.28-459.52 278.826667l172.373334 128.853333c39.68-118.016 152.832-202.88 287.146666-202.88" fill="#EA4335" p-id="6413"></path><path d="M516.693333 807.808c-134.357333 0-247.509333-84.864-287.232-202.88l-172.288 128.853333c83.242667 165.546667 257.152 278.826667 459.52 278.826667 124.842667 0 244.053333-43.392 333.568-124.757333l-163.584-123.818667c-46.122667 28.458667-104.234667 43.776-170.026666 43.776" fill="#34A853" p-id="6414"></path><path d="M1005.397333 512c0-29.568-4.693333-61.44-11.648-91.008H516.650667V614.4h274.602666c-13.696 65.962667-51.072 116.650667-104.533333 149.632l163.541333 123.818667c93.994667-85.418667 155.136-212.650667 155.136-375.850667" fill="#4285F4" p-id="6415"></path></svg>
\ No newline at end of file
<svg t="1719284028629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4376" width="256" height="256"><path d="M381.5 483.7c0-53.1 43.2-96.3 96.3-96.3h85v-187c0-9.4-7.6-17-17-17H137.9c-9.4 0-17 7.6-17 17v283.3c0 9.4 7.6 17 17 17h73.6v32.1l64.3-32.1h105.7v-17z" fill="#9ADCCF" p-id="4377"></path><path d="M747.7 784h-270c-9.4 0-17-7.6-17-17V483.7c0-9.4 7.6-17 17-17h407.9c9.4 0 17 7.6 17 17V767c0 9.4-7.6 17-17 17H812v32.1L747.7 784z" fill="#FFF370" p-id="4378"></path><path d="M341.8 523.4h-56.7c-2.6 0-5.2 0.6-7.6 1.8l-88.7 44.4v-29.2c0-9.4-7.6-17-17-17h-34c-21.9 0-39.7-17.8-39.7-39.7V200.5c0-21.9 17.8-39.7 39.7-39.7h407.9c21.9 0 39.7 17.8 39.7 39.7v147.3c0 9.4 7.6 17 17 17s17-7.6 17-17V200.5c0-40.6-33-73.6-73.6-73.6H137.9c-40.6 0-73.6 33-73.6 73.6v283.3c0 40.6 33 73.6 73.6 73.6h17V597c0 5.9 3 11.4 8.1 14.5 2.7 1.7 5.8 2.5 8.9 2.5 2.6 0 5.2-0.6 7.6-1.8l109.7-54.9h52.6c9.4 0 17-7.6 17-17 0-9.3-7.6-16.9-17-16.9z" fill="#4F3D3B" p-id="4379"></path><path d="M885.7 410.1h-65.8c-9.4 0-17 7.6-17 17s7.6 17 17 17h65.8c21.9 0 39.7 17.8 39.7 39.7V767c0 21.9-17.8 39.7-39.7 39.7h-34c-9.4 0-17 7.6-17 17v29.2L746 808.4c-2.4-1.2-5-1.8-7.6-1.8H477.8c-21.9 0-39.7-17.8-39.7-39.7V483.7c0-21.9 17.8-39.7 39.7-39.7h249.3c9.4 0 17-7.6 17-17s-7.6-17-17-17H477.8c-12.9 0-25 3.3-35.5 9.2l-85-180.7c-2.8-6-8.8-9.8-15.4-9.8s-12.6 3.8-15.4 9.8l-90.6 192.6c-4 8.5-0.3 18.6 8.1 22.6 8.5 4 18.6 0.3 22.6-8.1l19.4-41.2h111.7l18.4 39.1c-7.6 11.6-12 25.4-12 40.2V767c0 40.6 33 73.6 73.6 73.6h256.6L844 895.5c2.4 1.2 5 1.8 7.6 1.8 3.1 0 6.2-0.9 8.9-2.5 5-3.1 8.1-8.6 8.1-14.5v-39.7h17c40.6 0 73.6-33 73.6-73.6V483.7c0.1-40.6-32.9-73.6-73.5-73.6z m-583.8-39.7l39.9-84.7 39.9 84.7h-79.8zM358 733.9c-0.2-0.6-0.3-1.1-0.5-1.7-0.2-0.6-0.6-1.1-0.9-1.7-0.2-0.4-0.4-0.8-0.7-1.2-1.2-1.9-2.9-3.5-4.7-4.7-0.4-0.3-0.8-0.4-1.2-0.6-0.6-0.3-1.1-0.7-1.7-0.9-0.5-0.2-1.1-0.3-1.7-0.5-0.5-0.2-1-0.3-1.5-0.4-1.1-0.2-2.2-0.3-3.3-0.3H241c-21.9 0-39.7-17.8-39.7-39.7v-17.1c0-9.4-7.6-17-17-17s-17 7.6-17 17V682c0 40.6 33 73.6 73.6 73.6h59.8L284.5 772c-6.6 6.6-6.6 17.4 0 24 3.3 3.3 7.7 5 12 5s8.7-1.7 12-5l45.3-45.3c0.8-0.8 1.5-1.7 2.1-2.6 0.3-0.4 0.4-0.8 0.7-1.2 0.3-0.6 0.6-1.1 0.9-1.7 0.2-0.5 0.4-1.1 0.5-1.7 0.1-0.5 0.3-1 0.4-1.5 0.4-2.2 0.4-4.5 0-6.7 0-0.5-0.2-1-0.4-1.4zM665.5 222.3c0.2 0.6 0.3 1.1 0.5 1.7 0.2 0.6 0.6 1.1 0.9 1.7 0.2 0.4 0.4 0.8 0.7 1.2 1.2 1.9 2.9 3.5 4.7 4.7 0.4 0.3 0.8 0.4 1.2 0.6 0.6 0.3 1.1 0.7 1.7 0.9 0.5 0.2 1.1 0.3 1.7 0.5 0.5 0.2 1 0.3 1.5 0.4 1.1 0.2 2.2 0.3 3.3 0.3h100.8c21.9 0 39.7 17.8 39.7 39.7v73.6c0 9.4 7.6 17 17 17s17-7.6 17-17V274c0-40.6-33-73.6-73.6-73.6h-59.8l16.3-16.3c6.6-6.6 6.6-17.4 0-24-6.6-6.6-17.4-6.6-24 0l-45.3 45.3c-0.8 0.8-1.5 1.7-2.1 2.6-0.3 0.4-0.4 0.8-0.7 1.2-0.3 0.6-0.6 1.1-0.9 1.7-0.2 0.5-0.4 1.1-0.5 1.7-0.1 0.5-0.3 1-0.4 1.5-0.4 2.2-0.4 4.5 0 6.7 0 0.5 0.2 1 0.3 1.5z" fill="#4F3D3B" p-id="4380"></path><path d="M681.7 750c9.4 0 17-7.6 17-17v-45.3H778c9.4 0 17-7.6 17-17V580c0-9.4-7.6-17-17-17h-79.3v-45.3c0-9.4-7.6-17-17-17s-17 7.6-17 17V563h-79.3c-9.4 0-17 7.6-17 17v90.6c0 9.4 7.6 17 17 17h79.3V733c0 9.4 7.6 17 17 17z m17-153H761v56.7h-62.3V597z m-96.3 56.7V597h62.3v56.7h-62.3z" fill="#4F3D3B" p-id="4381"></path></svg>
\ No newline at end of file
...@@ -316,8 +316,8 @@ export const ResponseBox = React.memo(function ResponseBox({ ...@@ -316,8 +316,8 @@ export const ResponseBox = React.memo(function ResponseBox({
)} )}
{/* code */} {/* code */}
<Row label={workflowT('response.Custom inputs')} value={activeModule?.customInputs} />
<Row label={workflowT('response.Custom outputs')} value={activeModule?.customOutputs} /> <Row label={workflowT('response.Custom outputs')} value={activeModule?.customOutputs} />
<Row label={workflowT('response.Custom inputs')} value={activeModule?.customInputs} />
<Row label={workflowT('response.Code log')} value={activeModule?.codeLog} /> <Row label={workflowT('response.Code log')} value={activeModule?.codeLog} />
</Box> </Box>
</> </>
......
import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/index.d'; import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/index.d';
import React, { useRef, forwardRef, ForwardedRef, useImperativeHandle } from 'react'; import React, { forwardRef, ForwardedRef } from 'react';
import { SmallCloseIcon } from '@chakra-ui/icons'; import { SmallCloseIcon } from '@chakra-ui/icons';
import { Box, Flex, IconButton } from '@chakra-ui/react'; import { Box, Flex, IconButton } from '@chakra-ui/react';
import MyIcon from '@fastgpt/web/components/common/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip'; import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
import { useUserStore } from '@/web/support/user/useUserStore';
import type { ComponentRef } from '@/components/ChatBox/type.d';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge'; import { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge';
...@@ -32,7 +30,6 @@ const ChatTest = ( ...@@ -32,7 +30,6 @@ const ChatTest = (
ref: ForwardedRef<ChatTestComponentRef> ref: ForwardedRef<ChatTestComponentRef>
) => { ) => {
const { t } = useTranslation(); const { t } = useTranslation();
const ChatBoxRef = useRef<ComponentRef>(null);
const { appDetail } = useContextSelector(AppContext, (v) => v); const { appDetail } = useContextSelector(AppContext, (v) => v);
const { resetChatBox, ChatBox } = useChatTest({ const { resetChatBox, ChatBox } = useChatTest({
...@@ -41,10 +38,6 @@ const ChatTest = ( ...@@ -41,10 +38,6 @@ const ChatTest = (
chatConfig: appDetail.chatConfig chatConfig: appDetail.chatConfig
}); });
useImperativeHandle(ref, () => ({
resetChatTest: resetChatBox
}));
return ( return (
<> <>
<Box <Box
...@@ -84,9 +77,7 @@ const ChatTest = ( ...@@ -84,9 +77,7 @@ const ChatTest = (
borderRadius={'md'} borderRadius={'md'}
aria-label={'delete'} aria-label={'delete'}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); resetChatBox();
ChatBoxRef.current?.resetHistory([]);
ChatBoxRef.current?.resetVariables();
}} }}
/> />
</MyTooltip> </MyTooltip>
......
// @ts-nocheck
import { AppItemType } from '@/types/app'; import { AppItemType } from '@/types/app';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants'; import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants'; import {
NodeOutputKeyEnum,
WorkflowIOValueTypeEnum
} from '@fastgpt/global/core/workflow/constants';
import { import {
FlowNodeInputTypeEnum, FlowNodeInputTypeEnum,
FlowNodeOutputTypeEnum, FlowNodeOutputTypeEnum,
...@@ -819,15 +824,197 @@ export const simpleBotTemplates: TemplateType = [ ...@@ -819,15 +824,197 @@ export const simpleBotTemplates: TemplateType = [
targetHandle: '7BdojPlukIQw-target-left' targetHandle: '7BdojPlukIQw-target-left'
} }
] ]
},
{
id: 'toolChat',
avatar: '/imgs/workflow/history.png',
name: '知道时间的机器人',
intro: '通过挂载时间插件,让模型获取当前最新时间',
type: AppTypeEnum.simple,
modules: [
{
nodeId: 'userGuide',
name: '系统配置',
intro: '可以配置应用的系统参数',
avatar: '/imgs/workflow/userGuide.png',
flowNodeType: FlowNodeTypeEnum.systemConfig,
position: {
x: 531.2422736065552,
y: -486.7611729549753
},
version: '481',
inputs: [],
outputs: []
},
{
nodeId: 'workflowStartNodeId',
name: '流程开始',
intro: '',
avatar: '/imgs/workflow/userChatInput.svg',
flowNodeType: FlowNodeTypeEnum.workflowStart,
position: {
x: 558.4082376415505,
y: 123.72387429194112
},
version: '481',
inputs: [
{
key: 'userChatInput',
renderTypeList: ['reference', 'textarea'],
valueType: 'string',
label: '用户问题',
required: true,
toolDescription: '用户问题'
}
],
outputs: [
{
id: 'userChatInput',
key: 'userChatInput',
label: 'core.module.input.label.user question',
valueType: 'string',
type: 'static'
}
]
},
{
nodeId: 'jrWPV9',
name: '工具调用(实验)',
intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。',
avatar: '/imgs/workflow/tool.svg',
flowNodeType: FlowNodeTypeEnum.tools,
showStatus: true,
position: {
x: 1062.1738942532802,
y: -223.65033022650476
},
version: '481',
inputs: [
{
key: 'model',
renderTypeList: ['settingLLMModel', 'reference'],
label: 'core.module.input.label.aiModel',
valueType: 'string',
llmModelType: 'all',
value: 'gpt-3.5-turbo'
},
{
key: 'temperature',
renderTypeList: ['hidden'],
label: '',
value: 0,
valueType: 'number',
min: 0,
max: 10,
step: 1
},
{
key: 'maxToken',
renderTypeList: ['hidden'],
label: '',
value: 2000,
valueType: 'number',
min: 100,
max: 4000,
step: 50
},
{
key: 'systemPrompt',
renderTypeList: ['textarea', 'reference'],
max: 3000,
valueType: 'string',
label: 'core.ai.Prompt',
description: 'core.app.tip.chatNodeSystemPromptTip',
placeholder: 'core.app.tip.chatNodeSystemPromptTip',
value: ''
},
{
key: 'history',
renderTypeList: ['numberInput', 'reference'],
valueType: 'chatHistory',
label: 'core.module.input.label.chat history',
description: '最多携带多少轮对话记录',
required: true,
min: 0,
max: 30,
value: 6
},
{
key: 'userChatInput',
renderTypeList: ['reference', 'textarea'],
valueType: 'string',
label: '用户问题',
required: true,
value: ['workflowStartNodeId', 'userChatInput']
}
],
outputs: [
{
id: 'answerText',
key: 'answerText',
label: 'core.module.output.label.Ai response content',
description: 'core.module.output.description.Ai response content',
valueType: 'string',
type: 'static'
}
]
},
{
nodeId: 'zBxjo5',
name: '获取当前时间',
intro: '获取用户当前时区的时间。',
avatar: '/imgs/workflow/getCurrentTime.svg',
flowNodeType: 'pluginModule',
showStatus: false,
position: {
x: 1000,
y: 545
},
version: '481',
inputs: [],
outputs: [
{
id: 'time',
type: 'static',
key: 'time',
valueType: 'string',
label: 'time',
description: ''
}
],
pluginId: 'community-getCurrentTime'
}
],
edges: [
{
source: 'workflowStartNodeId',
target: 'jrWPV9',
sourceHandle: 'workflowStartNodeId-source-right',
targetHandle: 'jrWPV9-target-left'
},
{
source: 'jrWPV9',
target: 'zBxjo5',
sourceHandle: 'selectedTools',
targetHandle: 'selectedTools'
}
],
chatConfig: {
scheduledTriggerConfig: {
cronString: '',
timezone: 'Asia/Shanghai',
defaultPrompt: ''
}
}
} }
]; ];
export const workflowTemplates: TemplateType = [ export const workflowTemplates: TemplateType = [
{ {
id: 'CQ', id: 'TranslateRobot',
avatar: '/imgs/workflow/cq.png', avatar: '/imgs/app/templates/translate.svg',
name: '问题分类 + 知识库', name: '多轮翻译机器人',
intro: '先对用户的问题进行分类,再根据不同类型问题,执行不同的操作', intro: '通过4轮翻译,提高翻译英文的质量',
type: AppTypeEnum.workflow, type: AppTypeEnum.workflow,
modules: [ modules: [
{ {
...@@ -835,7 +1022,7 @@ export const workflowTemplates: TemplateType = [ ...@@ -835,7 +1022,7 @@ export const workflowTemplates: TemplateType = [
name: '系统配置', name: '系统配置',
intro: '可以配置应用的系统参数', intro: '可以配置应用的系统参数',
avatar: '/imgs/workflow/userGuide.png', avatar: '/imgs/workflow/userGuide.png',
flowNodeType: FlowNodeTypeEnum.systemConfig, flowNodeType: 'userGuide',
position: { position: {
x: 531.2422736065552, x: 531.2422736065552,
y: -486.7611729549753 y: -486.7611729549753
...@@ -844,29 +1031,29 @@ export const workflowTemplates: TemplateType = [ ...@@ -844,29 +1031,29 @@ export const workflowTemplates: TemplateType = [
inputs: [ inputs: [
{ {
key: 'welcomeText', key: 'welcomeText',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
label: 'core.app.Welcome Text', label: 'core.app.Welcome Text',
value: '你好,我是知识库助手,请不要忘记选择知识库噢~\n[你是谁]\n[如何使用]' value: ''
}, },
{ {
key: 'variables', key: 'variables',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
valueType: WorkflowIOValueTypeEnum.any, valueType: 'any',
label: 'core.app.Chat Variable', label: 'core.app.Chat Variable',
value: [] value: []
}, },
{ {
key: 'questionGuide', key: 'questionGuide',
valueType: WorkflowIOValueTypeEnum.boolean, valueType: 'boolean',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: 'core.app.Question Guide', label: 'core.app.Question Guide',
value: true value: false
}, },
{ {
key: 'tts', key: 'tts',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
valueType: WorkflowIOValueTypeEnum.any, valueType: 'any',
label: '', label: '',
value: { value: {
type: 'web' type: 'web'
...@@ -874,8 +1061,8 @@ export const workflowTemplates: TemplateType = [ ...@@ -874,8 +1061,8 @@ export const workflowTemplates: TemplateType = [
}, },
{ {
key: 'whisper', key: 'whisper',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
valueType: WorkflowIOValueTypeEnum.any, valueType: 'any',
label: '', label: '',
value: { value: {
open: false, open: false,
...@@ -885,8 +1072,8 @@ export const workflowTemplates: TemplateType = [ ...@@ -885,8 +1072,8 @@ export const workflowTemplates: TemplateType = [
}, },
{ {
key: 'scheduleTrigger', key: 'scheduleTrigger',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
valueType: WorkflowIOValueTypeEnum.any, valueType: 'any',
label: '', label: '',
value: null value: null
} }
...@@ -894,11 +1081,11 @@ export const workflowTemplates: TemplateType = [ ...@@ -894,11 +1081,11 @@ export const workflowTemplates: TemplateType = [
outputs: [] outputs: []
}, },
{ {
nodeId: 'workflowStartNodeId', nodeId: '448745',
name: '流程开始', name: '流程开始',
intro: '', intro: '',
avatar: '/imgs/workflow/userChatInput.svg', avatar: '/imgs/workflow/userChatInput.svg',
flowNodeType: FlowNodeTypeEnum.workflowStart, flowNodeType: 'workflowStart',
position: { position: {
x: 558.4082376415505, x: 558.4082376415505,
y: 123.72387429194112 y: 123.72387429194112
...@@ -907,8 +1094,8 @@ export const workflowTemplates: TemplateType = [ ...@@ -907,8 +1094,8 @@ export const workflowTemplates: TemplateType = [
inputs: [ inputs: [
{ {
key: 'userChatInput', key: 'userChatInput',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea], renderTypeList: ['reference', 'textarea'],
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
label: '用户问题', label: '用户问题',
required: true, required: true,
toolDescription: '用户问题' toolDescription: '用户问题'
...@@ -919,88 +1106,87 @@ export const workflowTemplates: TemplateType = [ ...@@ -919,88 +1106,87 @@ export const workflowTemplates: TemplateType = [
id: 'userChatInput', id: 'userChatInput',
key: 'userChatInput', key: 'userChatInput',
label: 'core.module.input.label.user question', label: 'core.module.input.label.user question',
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
type: FlowNodeOutputTypeEnum.static type: 'static'
} }
] ]
}, },
{ {
nodeId: '7BdojPlukIQw', nodeId: 'loOvhld2ZTKa',
name: 'AI 对话', name: '第一轮翻译',
intro: 'AI 大模型对话', intro: 'AI 大模型对话',
avatar: '/imgs/workflow/AI.png', avatar: '/imgs/workflow/AI.png',
flowNodeType: FlowNodeTypeEnum.chatNode, flowNodeType: 'chatNode',
showStatus: true, showStatus: true,
position: { position: {
x: 2701.1267277679685, x: 1748.8252410306534,
y: -767.8956312653042 y: -245.08260685989214
}, },
version: '481', version: '481',
inputs: [ inputs: [
{ {
key: 'model', key: 'model',
renderTypeList: [ renderTypeList: ['settingLLMModel', 'reference'],
FlowNodeInputTypeEnum.settingLLMModel,
FlowNodeInputTypeEnum.reference
],
label: 'core.module.input.label.aiModel', label: 'core.module.input.label.aiModel',
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
value: 'gpt-3.5-turbo' value: 'gpt-4o'
}, },
{ {
key: 'temperature', key: 'temperature',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: '', label: '',
value: 3, value: 0,
valueType: WorkflowIOValueTypeEnum.number, valueType: 'number',
min: 0, min: 0,
max: 10, max: 10,
step: 1 step: 1
}, },
{ {
key: 'maxToken', key: 'maxToken',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: '', label: '',
value: 1950, value: 2000,
valueType: WorkflowIOValueTypeEnum.number, valueType: 'number',
min: 100, min: 100,
max: 4000, max: 4000,
step: 50 step: 50
}, },
{ {
key: 'isResponseAnswerText', key: 'isResponseAnswerText',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: '', label: '',
value: true, value: true,
valueType: WorkflowIOValueTypeEnum.boolean valueType: 'boolean'
}, },
{ {
key: 'quoteTemplate', key: 'quoteTemplate',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: '', label: '',
valueType: WorkflowIOValueTypeEnum.string valueType: 'string'
}, },
{ {
key: 'quotePrompt', key: 'quotePrompt',
renderTypeList: [FlowNodeInputTypeEnum.hidden], renderTypeList: ['hidden'],
label: '', label: '',
valueType: WorkflowIOValueTypeEnum.string valueType: 'string'
}, },
{ {
key: 'systemPrompt', key: 'systemPrompt',
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference], renderTypeList: ['textarea', 'reference'],
max: 3000, max: 3000,
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
label: 'core.ai.Prompt', label: 'core.ai.Prompt',
description: 'core.app.tip.chatNodeSystemPromptTip', description: 'core.app.tip.chatNodeSystemPromptTip',
placeholder: 'core.app.tip.chatNodeSystemPromptTip', placeholder: 'core.app.tip.chatNodeSystemPromptTip',
value: '' value:
'# Role: 资深英汉翻译专家\n\n## Background:\n你是一位经验丰富的英汉翻译专家,精通英汉互译,尤其擅长将英文文章译成流畅易懂的现代汉语。你曾多次带领团队完成大型翻译项目,译文广受好评。\n\n## Attention:\n- 翻译过程中要始终坚持"信、达、雅"的原则,但"达"尤为重要\n- 译文要符合现代汉语的表达习惯,通俗易懂,连贯流畅 \n- 避免使用过于文绉绉的表达和晦涩难懂的典故引用\n\n## Profile: \n- Author: 米开朗基杨 \n- Version: 0.2\n- Language: 中文\n- Description: 你是一位资深英汉翻译专家,精通英汉互译。你擅长将英文文章译成地道流畅的现代汉语,表达准确易懂,符合当代中文语言习惯。\n\n## Constraints:\n- 必须严格遵循四轮翻译流程:直译、意译、校审、定稿 \n- 译文要忠实原文,准确无误,不能遗漏或曲解原意\n- 译文应以现代白话文为主,避免过多使用文言文和古典诗词\n- 每一轮翻译前后必须添加【思考】和【翻译】标记\n- 最终译文使用Markdown的代码块呈现\n\n## Goals:\n- 通过四轮翻译流程,将英文原文译成高质量的现代汉语译文 \n- 译文要准确传达原文意思,语言表达力求浅显易懂,朗朗上口\n- 适度使用一些熟语俗语、流行网络用语等,增强译文的亲和力\n- 在直译的基础上,提供至少2个不同风格的意译版本供选择\n\n## Skills:\n- 精通英汉双语,具有扎实的语言功底和丰富的翻译经验\n- 擅长将英语表达习惯转换为地道自然的现代汉语\n- 对当代中文语言的发展变化有敏锐洞察,善于把握语言流行趋势\n\n## Workflow:\n1. 第一轮直译:逐字逐句忠实原文,不遗漏任何信息\n2. 第二轮意译:在直译的基础上用通俗流畅的现代汉语意译原文,至少提供2个不同风格的版本\n3. 第三轮校审:仔细审视译文,消除偏差和欠缺,使译文更加地道易懂 \n4. 第四轮定稿:择优选取,反复修改润色,最终定稿出一个简洁畅达、符合大众阅读习惯的译文\n\n## OutputFormat: \n- 每一轮翻译前用【思考】说明该轮要点\n- 每一轮翻译后用【翻译】呈现译文\n- 在\\`\\`\\`代码块中展示最终定稿译文\n\n## Suggestions:\n- 直译时力求忠实原文,但不要过于拘泥逐字逐句\n- 意译时在准确表达原意的基础上,用最朴实无华的现代汉语来表达 \n- 校审环节重点关注译文是否符合当代汉语表达习惯,是否通俗易懂\n- 定稿时适度采用一些熟语谚语、网络流行语等,使译文更接地气\n- 善于利用中文的灵活性,用不同的表述方式展现同一内容,提高译文的可读性\n\n## Initialization\n作为一名资深英汉翻译专家,你必须严格遵循翻译流程的各项要求。首先请向用户问好,介绍你将带领团队完成翻译任务,力求将英文原文译成通俗易懂的现代汉语。然后简要说明四轮翻译流程,请用户提供英文原文,开始进行翻译工作。'
}, },
{ {
key: 'history', key: 'history',
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference], renderTypeList: ['numberInput', 'reference'],
valueType: WorkflowIOValueTypeEnum.chatHistory, valueType: 'chatHistory',
label: 'core.module.input.label.chat history', label: 'core.module.input.label.chat history',
description: '最多携带多少轮对话记录',
required: true, required: true,
min: 0, min: 0,
max: 30, max: 30,
...@@ -1008,21 +1194,20 @@ export const workflowTemplates: TemplateType = [ ...@@ -1008,21 +1194,20 @@ export const workflowTemplates: TemplateType = [
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea], renderTypeList: ['reference', 'textarea'],
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
label: '用户问题', label: '用户问题',
required: true, required: true,
toolDescription: '用户问题', toolDescription: '用户问题',
value: ['workflowStartNodeId', 'userChatInput'] value: ['k2QsBOBmH9Xu', 'text']
}, },
{ {
key: 'quoteQA', key: 'quoteQA',
renderTypeList: [FlowNodeInputTypeEnum.settingDatasetQuotePrompt], renderTypeList: ['settingDatasetQuotePrompt'],
label: '', label: '',
debugLabel: '知识库引用', debugLabel: '知识库引用',
description: '', description: '',
valueType: WorkflowIOValueTypeEnum.datasetQuote, valueType: 'datasetQuote'
value: ['MNMMMIjjWyMU', 'quoteQA']
} }
], ],
outputs: [ outputs: [
...@@ -1031,73 +1216,1380 @@ export const workflowTemplates: TemplateType = [ ...@@ -1031,73 +1216,1380 @@ export const workflowTemplates: TemplateType = [
key: 'history', key: 'history',
label: 'core.module.output.label.New context', label: 'core.module.output.label.New context',
description: 'core.module.output.description.New context', description: 'core.module.output.description.New context',
valueType: WorkflowIOValueTypeEnum.chatHistory, valueType: 'chatHistory',
type: FlowNodeOutputTypeEnum.static type: 'static',
required: true
}, },
{ {
id: 'answerText', id: 'answerText',
key: 'answerText', key: 'answerText',
label: 'core.module.output.label.Ai response content', label: 'core.module.output.label.Ai response content',
description: 'core.module.output.description.Ai response content', description: 'core.module.output.description.Ai response content',
valueType: WorkflowIOValueTypeEnum.string, valueType: 'string',
type: FlowNodeOutputTypeEnum.static type: 'static',
required: true
} }
] ]
}, },
{ {
nodeId: 'rvbo634w3AYj', nodeId: 'k2QsBOBmH9Xu',
name: '问题分类', name: '原文声明',
intro: intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。',
'根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题', avatar: '/imgs/workflow/textEditor.svg',
avatar: '/imgs/workflow/cq.png', flowNodeType: 'pluginModule',
flowNodeType: FlowNodeTypeEnum.classifyQuestion, showStatus: false,
showStatus: true,
position: { position: {
x: 1020.9667229609946, x: 1000.9259923224292,
y: -385.0060974413916 y: 3.3737410194846404
}, },
version: '481', version: '481',
inputs: [ inputs: [
{ {
key: 'model', key: 'system_addInputParam',
renderTypeList: [FlowNodeInputTypeEnum.selectLLMModel, FlowNodeInputTypeEnum.reference], valueType: 'dynamic',
label: 'core.module.input.label.aiModel', label: '动态外部数据',
required: true, renderTypeList: ['addInputParam'],
valueType: WorkflowIOValueTypeEnum.string, required: false,
llmModelType: 'classify', description: '',
value: 'gpt-3.5-turbo' canEdit: false,
}, value: '',
{ editField: {
key: 'systemPrompt', key: true
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference], },
max: 3000, dynamicParamDefaultValue: {
valueType: WorkflowIOValueTypeEnum.string, inputType: 'reference',
label: 'core.module.input.label.Background', valueType: 'string',
description: 'core.module.input.description.Background', required: true
placeholder: 'core.module.input.placeholder.Classify background', }
value: ''
}, },
{ {
key: 'history', key: 'q',
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference], valueType: 'string',
valueType: WorkflowIOValueTypeEnum.chatHistory, label: 'q',
label: 'core.module.input.label.chat history', renderTypeList: ['reference'],
required: true, required: true,
min: 0, description: '',
max: 30, canEdit: true,
value: 6 editField: {
key: true
},
value: ['448745', 'userChatInput']
}, },
{ {
key: 'userChatInput', key: '文本',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea], valueType: 'string',
valueType: WorkflowIOValueTypeEnum.string, label: '文本',
label: '用户问题', renderTypeList: ['textarea'],
required: true, required: true,
value: ['workflowStartNodeId', 'userChatInput'] description: '',
canEdit: false,
value: '原文:\n"""\n{{q}}\n"""',
editField: {
key: true
},
maxLength: '',
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
}
],
outputs: [
{
id: 'text',
type: 'static',
key: 'text',
valueType: 'string',
label: 'text',
description: ''
}
],
pluginId: 'community-textEditor'
}, },
{ {
key: 'agents', nodeId: 'w0oBbQ3YJHye',
renderTypeList: [FlowNodeInputTypeEnum.custom], name: '代码运行',
intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。',
avatar: '/imgs/workflow/code.svg',
flowNodeType: 'code',
showStatus: true,
position: {
x: 2522.61682940854,
y: -79.74569750380468
},
version: '482',
inputs: [
{
key: 'system_addInputParam',
renderTypeList: ['addInputParam'],
valueType: 'dynamic',
label: '',
required: false,
description: '这些变量会作为代码的运行的输入参数',
editField: {
key: true,
valueType: true
}
},
{
key: 'data1',
valueType: 'string',
label: 'data1',
renderTypeList: ['reference'],
description: '',
canEdit: true,
editField: {
key: true,
valueType: true
},
value: ['loOvhld2ZTKa', 'answerText']
},
{
key: 'codeType',
renderTypeList: ['hidden'],
label: '',
value: 'js'
},
{
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}'
}
],
outputs: [
{
id: 'system_addOutputParam',
key: 'system_addOutputParam',
type: 'dynamic',
valueType: 'dynamic',
label: '',
editField: {
key: true,
valueType: true
},
description: '将代码中 return 的对象作为输出,传递给后续的节点'
},
{
id: 'system_rawResponse',
key: 'system_rawResponse',
label: '完整响应数据',
valueType: 'object',
type: 'static'
},
{
id: 'error',
key: 'error',
label: '运行错误',
description: '代码运行错误信息,成功时返回空',
valueType: 'object',
type: 'static'
},
{
id: 'qLUQfhG0ILRX',
type: 'dynamic',
key: 'result',
valueType: 'string',
label: 'result'
}
]
},
{
nodeId: 'foO69L5FOmDQ',
name: '指定回复',
intro:
'该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。',
avatar: '/imgs/workflow/reply.png',
flowNodeType: 'answerNode',
position: {
x: 3798.4479531204515,
y: 116.03040242110023
},
version: '481',
inputs: [
{
key: 'text',
renderTypeList: ['textarea', 'reference'],
valueType: 'any',
required: true,
label: 'core.module.input.label.Response content',
description: 'core.module.input.description.Response content',
placeholder: 'core.module.input.description.Response content',
selectedTypeIndex: 1,
value: ['v9ijHqeA2NY2', 'text']
}
],
outputs: []
},
{
nodeId: 'v9ijHqeA2NY2',
name: '合并输出结果',
intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。',
avatar: '/imgs/workflow/textEditor.svg',
flowNodeType: 'pluginModule',
showStatus: false,
position: {
x: 3083.567683275386,
y: 60.05513835086097
},
version: '481',
inputs: [
{
key: 'system_addInputParam',
valueType: 'dynamic',
label: '动态外部数据',
renderTypeList: ['addInputParam'],
required: false,
description: '',
canEdit: false,
value: '',
editField: {
key: true
},
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
},
{
key: 'result',
valueType: 'string',
label: 'result',
renderTypeList: ['reference'],
required: true,
description: '',
canEdit: true,
editField: {
key: true
},
value: ['w0oBbQ3YJHye', 'qLUQfhG0ILRX']
},
{
key: '文本',
valueType: 'string',
label: '文本',
renderTypeList: ['textarea'],
required: true,
description: '',
canEdit: false,
value: '------\n\n最终翻译结果如下: \n\n```\n{{result}}\n```',
editField: {
key: true
},
maxLength: '',
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
}
],
outputs: [
{
id: 'text',
type: 'static',
key: 'text',
valueType: 'string',
label: 'text',
description: ''
}
],
pluginId: 'community-textEditor'
}
],
edges: [
{
source: '448745',
target: 'k2QsBOBmH9Xu',
sourceHandle: '448745-source-right',
targetHandle: 'k2QsBOBmH9Xu-target-left'
},
{
source: 'k2QsBOBmH9Xu',
target: 'loOvhld2ZTKa',
sourceHandle: 'k2QsBOBmH9Xu-source-right',
targetHandle: 'loOvhld2ZTKa-target-left'
},
{
source: 'loOvhld2ZTKa',
target: 'w0oBbQ3YJHye',
sourceHandle: 'loOvhld2ZTKa-source-right',
targetHandle: 'w0oBbQ3YJHye-target-left'
},
{
source: 'w0oBbQ3YJHye',
target: 'v9ijHqeA2NY2',
sourceHandle: 'w0oBbQ3YJHye-source-right',
targetHandle: 'v9ijHqeA2NY2-target-left'
},
{
source: 'v9ijHqeA2NY2',
target: 'foO69L5FOmDQ',
sourceHandle: 'v9ijHqeA2NY2-source-right',
targetHandle: 'foO69L5FOmDQ-target-left'
}
]
},
{
id: 'google',
avatar: '/imgs/app/templates/google.svg',
name: '谷歌搜索',
intro: '通过请求谷歌搜索,查询相关内容作为模型的参考。',
type: AppTypeEnum.workflow,
modules: [
{
nodeId: 'userGuide',
name: '系统配置',
intro: '可以配置应用的系统参数',
avatar: '/imgs/workflow/userGuide.png',
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: '流程开始',
intro: '',
avatar: '/imgs/workflow/userChatInput.svg',
flowNodeType: 'workflowStart',
position: {
x: 295.8944548701009,
y: 110.81336038514848
},
version: '481',
inputs: [
{
key: 'userChatInput',
renderTypeList: ['reference', 'textarea'],
valueType: 'string',
label: '用户问题',
required: true,
toolDescription: '用户问题'
}
],
outputs: [
{
id: 'userChatInput',
key: 'userChatInput',
label: 'core.module.input.label.user question',
valueType: 'string',
type: 'static'
}
]
},
{
nodeId: 'NOgbnBzUwDgT',
name: '工具调用(实验)',
intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。',
avatar: '/imgs/workflow/tool.svg',
flowNodeType: 'tools',
showStatus: true,
position: {
x: 1028.8358722416106,
y: -500.8755882990822
},
version: '481',
inputs: [
{
key: 'model',
renderTypeList: ['settingLLMModel', 'reference'],
label: 'core.module.input.label.aiModel',
valueType: 'string',
llmModelType: 'all',
value: 'FastAI-plus'
},
{
key: 'temperature',
renderTypeList: ['hidden'],
label: '',
value: 0,
valueType: 'number',
min: 0,
max: 10,
step: 1
},
{
key: 'maxToken',
renderTypeList: ['hidden'],
label: '',
value: 2000,
valueType: 'number',
min: 100,
max: 4000,
step: 50
},
{
key: 'systemPrompt',
renderTypeList: ['textarea', 'reference'],
max: 3000,
valueType: 'string',
label: 'core.ai.Prompt',
description: 'core.app.tip.chatNodeSystemPromptTip',
placeholder: 'core.app.tip.chatNodeSystemPromptTip',
value: ''
},
{
key: 'history',
renderTypeList: ['numberInput', 'reference'],
valueType: 'chatHistory',
label: 'core.module.input.label.chat history',
description: '最多携带多少轮对话记录',
required: true,
min: 0,
max: 30,
value: 6
},
{
key: 'userChatInput',
renderTypeList: ['reference', 'textarea'],
valueType: 'string',
label: '用户问题',
required: true,
value: ['448745', 'userChatInput']
}
],
outputs: [
{
id: NodeOutputKeyEnum.answerText,
key: NodeOutputKeyEnum.answerText,
label: 'core.module.output.label.Ai response content',
description: 'core.module.output.description.Ai response content',
valueType: WorkflowIOValueTypeEnum.string,
type: FlowNodeOutputTypeEnum.static
}
]
},
{
nodeId: 'GMELVPxHfpg5',
name: 'HTTP 请求',
intro: '调用谷歌搜索,查询相关内容',
avatar: '/imgs/workflow/http.png',
flowNodeType: 'httpRequest468',
showStatus: true,
position: {
x: 1005.4777753640342,
y: 319.4905539380939
},
version: '481',
inputs: [
{
key: 'system_addInputParam',
renderTypeList: ['addInputParam'],
valueType: 'dynamic',
label: '',
required: false,
description: 'core.module.input.description.HTTP Dynamic Input',
editField: {
key: true,
valueType: true
}
},
{
valueType: 'string',
renderTypeList: ['reference'],
key: 'query',
label: 'query',
toolDescription: '谷歌搜索检索词',
required: true,
canEdit: true,
editField: {
key: true,
description: true
}
},
{
key: 'system_httpMethod',
renderTypeList: ['custom'],
valueType: 'string',
label: '',
value: 'GET',
required: true
},
{
key: 'system_httpReqUrl',
renderTypeList: ['hidden'],
valueType: 'string',
label: '',
description: 'core.module.input.description.Http Request Url',
placeholder: 'https://api.ai.com/getInventory',
required: false,
value: 'https://www.googleapis.com/customsearch/v1'
},
{
key: 'system_httpHeader',
renderTypeList: ['custom'],
valueType: 'any',
value: [],
label: '',
description: 'core.module.input.description.Http Request Header',
placeholder: 'core.module.input.description.Http Request Header',
required: false
},
{
key: 'system_httpParams',
renderTypeList: ['hidden'],
valueType: 'any',
value: [
{
key: 'q',
type: 'string',
value: '{{query}}'
},
{
key: 'cx',
type: 'string',
value: '谷歌搜索cxID'
},
{
key: 'key',
type: 'string',
value: '谷歌搜索key'
},
{
key: 'c2coff',
type: 'string',
value: '1'
},
{
key: 'start',
type: 'string',
value: '1'
},
{
key: 'end',
type: 'string',
value: '20'
},
{
key: 'dateRestrict',
type: 'string',
value: 'm[1]'
}
],
label: '',
required: false
},
{
key: 'system_httpJsonBody',
renderTypeList: ['hidden'],
valueType: 'any',
value: '',
label: '',
required: false
}
],
outputs: [
{
id: 'system_addOutputParam',
key: 'system_addOutputParam',
type: 'dynamic',
valueType: 'dynamic',
label: '',
editField: {
key: true,
valueType: true
}
},
{
id: 'httpRawResponse',
key: 'httpRawResponse',
label: '原始响应',
description: 'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。',
valueType: 'any',
type: 'static',
required: true
},
{
id: 'M5YmxaYe8em1',
type: 'dynamic',
key: 'prompt',
valueType: 'string',
label: 'prompt'
}
]
},
{
nodeId: 'poIbrrA8aiR0',
name: '代码运行',
intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。',
avatar: '/imgs/workflow/code.svg',
flowNodeType: 'code',
showStatus: true,
position: {
x: 1711.805344753384,
y: 650.1023414708576
},
version: '482',
inputs: [
{
key: 'system_addInputParam',
renderTypeList: ['addInputParam'],
valueType: 'dynamic',
label: '',
required: false,
description: '这些变量会作为代码的运行的输入参数',
editField: {
key: true,
valueType: true
}
},
{
key: 'data',
valueType: 'object',
label: 'data',
renderTypeList: ['reference'],
description: '',
canEdit: true,
editField: {
key: true,
valueType: true
},
value: ['GMELVPxHfpg5', 'httpRawResponse']
},
{
key: 'codeType',
renderTypeList: ['hidden'],
label: '',
value: 'js'
},
{
key: 'code',
renderTypeList: ['custom'],
label: '',
value:
'function main({data}){\n const result = data.items.map((item) => ({\n title: item.title,\n link: item.link,\n snippet: item.snippet\n }))\n return { prompt: JSON.stringify(result) }\n}'
}
],
outputs: [
{
id: 'system_addOutputParam',
key: 'system_addOutputParam',
type: 'dynamic',
valueType: 'dynamic',
label: '',
editField: {
key: true,
valueType: true
},
description: '将代码中 return 的对象作为输出,传递给后续的节点'
},
{
id: 'system_rawResponse',
key: 'system_rawResponse',
label: '完整响应数据',
valueType: 'object',
type: 'static'
},
{
id: 'error',
key: 'error',
label: '运行错误',
description: '代码运行错误信息,成功时返回空',
valueType: 'object',
type: 'static'
},
{
id: 'qLUQfhG0ILRX',
type: 'dynamic',
key: 'prompt',
valueType: 'string',
label: 'prompt'
}
]
}
],
edges: [
{
source: '448745',
target: 'NOgbnBzUwDgT',
sourceHandle: '448745-source-right',
targetHandle: 'NOgbnBzUwDgT-target-left'
},
{
source: 'NOgbnBzUwDgT',
target: 'GMELVPxHfpg5',
sourceHandle: 'selectedTools',
targetHandle: 'selectedTools'
},
{
source: 'GMELVPxHfpg5',
target: 'poIbrrA8aiR0',
sourceHandle: 'GMELVPxHfpg5-source-right',
targetHandle: 'poIbrrA8aiR0-target-left'
}
]
},
{
id: 'dalle',
avatar: '/imgs/app/templates/dalle.svg',
name: 'Dalle3绘图',
intro: '通过请求Dalle3接口绘图,需要有 api key',
type: AppTypeEnum.workflow,
modules: [
{
nodeId: 'userGuide',
name: '系统配置',
intro: '可以配置应用的系统参数',
avatar: '/imgs/workflow/userGuide.png',
flowNodeType: 'userGuide',
position: {
x: 531.2422736065552,
y: -486.7611729549753
},
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: '/imgs/workflow/userChatInput.svg',
flowNodeType: 'workflowStart',
position: {
x: 532.1275542407774,
y: 46.03775600322817
},
inputs: [
{
key: 'userChatInput',
renderTypeList: ['reference', 'textarea'],
valueType: 'string',
label: '用户问题',
required: true,
toolDescription: '用户问题'
}
],
outputs: [
{
id: 'userChatInput',
key: 'userChatInput',
label: 'core.module.input.label.user question',
valueType: 'string',
type: 'static'
}
]
},
{
nodeId: 'tMyUnRL5jIrC',
name: 'HTTP 请求',
intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)',
avatar: '/imgs/workflow/http.png',
flowNodeType: 'httpRequest468',
showStatus: true,
position: {
x: 921.2377506442713,
y: -483.94114977914256
},
inputs: [
{
key: 'system_addInputParam',
renderTypeList: ['addInputParam'],
valueType: 'dynamic',
label: '',
required: false,
description: 'core.module.input.description.HTTP Dynamic Input',
editField: {
key: true,
valueType: true
}
},
{
key: 'prompt',
valueType: 'string',
label: 'prompt',
renderTypeList: ['reference'],
description: '',
canEdit: true,
editField: {
key: true,
valueType: true
},
value: ['448745', 'userChatInput']
},
{
key: 'system_httpMethod',
renderTypeList: ['custom'],
valueType: 'string',
label: '',
value: 'POST',
required: true
},
{
key: 'system_httpReqUrl',
renderTypeList: ['hidden'],
valueType: 'string',
label: '',
description: 'core.module.input.description.Http Request Url',
placeholder: 'https://api.ai.com/getInventory',
required: false,
value: 'https://api.openai.com/v1/images/generations'
},
{
key: 'system_httpHeader',
renderTypeList: ['custom'],
valueType: 'any',
value: [
{
key: 'Authorization',
type: 'string',
value: 'Bearer '
}
],
label: '',
description: 'core.module.input.description.Http Request Header',
placeholder: 'core.module.input.description.Http Request Header',
required: false
},
{
key: 'system_httpParams',
renderTypeList: ['hidden'],
valueType: 'any',
value: [],
label: '',
required: false
},
{
key: 'system_httpJsonBody',
renderTypeList: ['hidden'],
valueType: 'any',
value:
'{\n "model": "dall-e-3",\n "prompt": "{{prompt}}",\n "n": 1,\n "size": "1024x1024"\n}',
label: '',
required: false
}
],
outputs: [
{
id: 'system_addOutputParam',
key: 'system_addOutputParam',
type: 'dynamic',
valueType: 'dynamic',
label: '',
editField: {
key: true,
valueType: true
}
},
{
id: 'httpRawResponse',
key: 'httpRawResponse',
label: '原始响应',
description: 'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。',
valueType: 'any',
type: 'static'
},
{
id: 'DeKGGioBwaMf',
type: 'dynamic',
key: 'data[0].url',
valueType: 'string',
label: 'data[0].url'
}
]
},
{
nodeId: 'CO3POL8svbbi',
name: '文本加工',
intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。',
avatar: '/imgs/workflow/textEditor.svg',
flowNodeType: 'pluginModule',
showStatus: false,
position: {
x: 1417.5940290051137,
y: -478.81889618104356
},
inputs: [
{
key: 'system_addInputParam',
valueType: 'dynamic',
label: '动态外部数据',
renderTypeList: ['addInputParam'],
required: false,
description: '',
canEdit: false,
value: '',
editField: {
key: true
},
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
},
{
key: 'url',
valueType: 'string',
label: 'url',
renderTypeList: ['reference'],
required: true,
description: '',
canEdit: true,
editField: {
key: true
},
value: ['tMyUnRL5jIrC', 'DeKGGioBwaMf']
},
{
key: '文本',
valueType: 'string',
label: '文本',
renderTypeList: ['textarea'],
required: true,
description: '',
canEdit: false,
value: '![]({{url}})',
editField: {
key: true
},
maxLength: '',
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
}
],
outputs: [
{
id: 'text',
type: 'static',
key: 'text',
valueType: 'string',
label: 'text',
description: ''
}
],
pluginId: 'community-textEditor'
},
{
nodeId: '7mapnCgHfKW6',
name: '指定回复',
intro:
'该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。',
avatar: '/imgs/workflow/reply.png',
flowNodeType: 'answerNode',
position: {
x: 1922.5628399315042,
y: -471.67391598231796
},
inputs: [
{
key: 'text',
renderTypeList: ['textarea', 'reference'],
valueType: 'string',
label: 'core.module.input.label.Response content',
description: 'core.module.input.description.Response content',
placeholder: 'core.module.input.description.Response content',
selectedTypeIndex: 1,
value: ['CO3POL8svbbi', 'text']
}
],
outputs: []
}
],
edges: [
{
source: '448745',
target: 'tMyUnRL5jIrC',
sourceHandle: '448745-source-right',
targetHandle: 'tMyUnRL5jIrC-target-left'
},
{
source: 'tMyUnRL5jIrC',
target: 'CO3POL8svbbi',
sourceHandle: 'tMyUnRL5jIrC-source-right',
targetHandle: 'CO3POL8svbbi-target-left'
},
{
source: 'CO3POL8svbbi',
target: '7mapnCgHfKW6',
sourceHandle: 'CO3POL8svbbi-source-right',
targetHandle: '7mapnCgHfKW6-target-left'
}
]
},
{
id: 'CQ',
avatar: '/imgs/workflow/cq.png',
name: '问题分类 + 知识库',
intro: '先对用户的问题进行分类,再根据不同类型问题,执行不同的操作',
type: AppTypeEnum.workflow,
modules: [
{
nodeId: 'userGuide',
name: '系统配置',
intro: '可以配置应用的系统参数',
avatar: '/imgs/workflow/userGuide.png',
flowNodeType: FlowNodeTypeEnum.systemConfig,
position: {
x: 531.2422736065552,
y: -486.7611729549753
},
version: '481',
inputs: [
{
key: 'welcomeText',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.string,
label: 'core.app.Welcome Text',
value: '你好,我是知识库助手,请不要忘记选择知识库噢~\n[你是谁]\n[如何使用]'
},
{
key: 'variables',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.any,
label: 'core.app.Chat Variable',
value: []
},
{
key: 'questionGuide',
valueType: WorkflowIOValueTypeEnum.boolean,
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: 'core.app.Question Guide',
value: true
},
{
key: 'tts',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.any,
label: '',
value: {
type: 'web'
}
},
{
key: 'whisper',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.any,
label: '',
value: {
open: false,
autoSend: false,
autoTTSResponse: false
}
},
{
key: 'scheduleTrigger',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.any,
label: '',
value: null
}
],
outputs: []
},
{
nodeId: 'workflowStartNodeId',
name: '流程开始',
intro: '',
avatar: '/imgs/workflow/userChatInput.svg',
flowNodeType: FlowNodeTypeEnum.workflowStart,
position: {
x: 558.4082376415505,
y: 123.72387429194112
},
version: '481',
inputs: [
{
key: 'userChatInput',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea],
valueType: WorkflowIOValueTypeEnum.string,
label: '用户问题',
required: true,
toolDescription: '用户问题'
}
],
outputs: [
{
id: 'userChatInput',
key: 'userChatInput',
label: 'core.module.input.label.user question',
valueType: WorkflowIOValueTypeEnum.string,
type: FlowNodeOutputTypeEnum.static
}
]
},
{
nodeId: '7BdojPlukIQw',
name: 'AI 对话',
intro: 'AI 大模型对话',
avatar: '/imgs/workflow/AI.png',
flowNodeType: FlowNodeTypeEnum.chatNode,
showStatus: true,
position: {
x: 2701.1267277679685,
y: -767.8956312653042
},
version: '481',
inputs: [
{
key: 'model',
renderTypeList: [
FlowNodeInputTypeEnum.settingLLMModel,
FlowNodeInputTypeEnum.reference
],
label: 'core.module.input.label.aiModel',
valueType: WorkflowIOValueTypeEnum.string,
value: 'gpt-3.5-turbo'
},
{
key: 'temperature',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
value: 3,
valueType: WorkflowIOValueTypeEnum.number,
min: 0,
max: 10,
step: 1
},
{
key: 'maxToken',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
value: 1950,
valueType: WorkflowIOValueTypeEnum.number,
min: 100,
max: 4000,
step: 50
},
{
key: 'isResponseAnswerText',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
value: true,
valueType: WorkflowIOValueTypeEnum.boolean
},
{
key: 'quoteTemplate',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
valueType: WorkflowIOValueTypeEnum.string
},
{
key: 'quotePrompt',
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
valueType: WorkflowIOValueTypeEnum.string
},
{
key: 'systemPrompt',
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
max: 3000,
valueType: WorkflowIOValueTypeEnum.string,
label: 'core.ai.Prompt',
description: 'core.app.tip.chatNodeSystemPromptTip',
placeholder: 'core.app.tip.chatNodeSystemPromptTip',
value: ''
},
{
key: 'history',
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.chatHistory,
label: 'core.module.input.label.chat history',
required: true,
min: 0,
max: 30,
value: 6
},
{
key: 'userChatInput',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea],
valueType: WorkflowIOValueTypeEnum.string,
label: '用户问题',
required: true,
toolDescription: '用户问题',
value: ['workflowStartNodeId', 'userChatInput']
},
{
key: 'quoteQA',
renderTypeList: [FlowNodeInputTypeEnum.settingDatasetQuotePrompt],
label: '',
debugLabel: '知识库引用',
description: '',
valueType: WorkflowIOValueTypeEnum.datasetQuote,
value: ['MNMMMIjjWyMU', 'quoteQA']
}
],
outputs: [
{
id: 'history',
key: 'history',
label: 'core.module.output.label.New context',
description: 'core.module.output.description.New context',
valueType: WorkflowIOValueTypeEnum.chatHistory,
type: FlowNodeOutputTypeEnum.static
},
{
id: 'answerText',
key: 'answerText',
label: 'core.module.output.label.Ai response content',
description: 'core.module.output.description.Ai response content',
valueType: WorkflowIOValueTypeEnum.string,
type: FlowNodeOutputTypeEnum.static
}
]
},
{
nodeId: 'rvbo634w3AYj',
name: '问题分类',
intro:
'根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题',
avatar: '/imgs/workflow/cq.png',
flowNodeType: FlowNodeTypeEnum.classifyQuestion,
showStatus: true,
position: {
x: 1020.9667229609946,
y: -385.0060974413916
},
version: '481',
inputs: [
{
key: 'model',
renderTypeList: [FlowNodeInputTypeEnum.selectLLMModel, FlowNodeInputTypeEnum.reference],
label: 'core.module.input.label.aiModel',
required: true,
valueType: WorkflowIOValueTypeEnum.string,
llmModelType: 'classify',
value: 'gpt-3.5-turbo'
},
{
key: 'systemPrompt',
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
max: 3000,
valueType: WorkflowIOValueTypeEnum.string,
label: 'core.module.input.label.Background',
description: 'core.module.input.description.Background',
placeholder: 'core.module.input.placeholder.Classify background',
value: ''
},
{
key: 'history',
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.chatHistory,
label: 'core.module.input.label.chat history',
required: true,
min: 0,
max: 30,
value: 6
},
{
key: 'userChatInput',
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea],
valueType: WorkflowIOValueTypeEnum.string,
label: '用户问题',
required: true,
value: ['workflowStartNodeId', 'userChatInput']
},
{
key: 'agents',
renderTypeList: [FlowNodeInputTypeEnum.custom],
valueType: WorkflowIOValueTypeEnum.any, valueType: WorkflowIOValueTypeEnum.any,
label: '', label: '',
value: [ value: [
...@@ -1317,6 +2809,242 @@ export const pluginTemplates: TemplateType = [ ...@@ -1317,6 +2809,242 @@ export const pluginTemplates: TemplateType = [
} }
], ],
edges: [] edges: []
},
{
id: 'plugin-feishu',
avatar: '/imgs/app/templates/feishu.svg',
name: '飞书webhook插件',
intro: '通过 webhook 给飞书机器人发送一条消息',
type: AppTypeEnum.plugin,
modules: [
{
nodeId: 'pluginInput',
name: '自定义插件输入',
intro: '自定义配置外部输入,使用插件时,仅暴露自定义配置的输入',
avatar: '/imgs/workflow/input.png',
flowNodeType: 'pluginInput',
showStatus: false,
position: {
x: 517.5620777851774,
y: -173.55711888178655
},
version: '481',
inputs: [
{
inputType: 'input',
valueType: 'string',
key: '飞书机器人地址',
label: '飞书机器人地址',
description: '',
isToolInput: false,
defaultValue: '',
editField: {
key: true
},
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
},
renderTypeList: ['input'],
required: true,
canEdit: true,
value: ''
},
{
key: '发送的消息',
valueType: 'string',
label: '发送的消息',
renderTypeList: ['reference'],
required: true,
description: '',
canEdit: true,
value: '',
editField: {
key: true
},
dynamicParamDefaultValue: {
inputType: 'reference',
valueType: 'string',
required: true
}
}
],
outputs: [
{
id: 'mv52BrPVE6bm',
key: '飞书机器人地址',
valueType: 'string',
label: '飞书机器人地址',
type: 'static'
},
{
id: 'p0m68Dv5KaIp',
key: '发送的消息',
valueType: 'string',
label: '发送的消息',
type: 'static'
}
]
},
{
nodeId: 'pluginOutput',
name: '自定义插件输出',
intro: '自定义配置外部输出,使用插件时,仅暴露自定义配置的输出',
avatar: '/imgs/workflow/output.png',
flowNodeType: 'pluginOutput',
showStatus: false,
position: {
x: 1668.9410524554828,
y: -153.47815316221283
},
version: '481',
inputs: [],
outputs: []
},
{
nodeId: 'rKBYGQuYefae',
name: 'HTTP 请求',
intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)',
avatar: '/imgs/workflow/http.png',
flowNodeType: 'httpRequest468',
showStatus: true,
position: {
x: 1069.7228495148624,
y: -392.26482361861054
},
version: '481',
inputs: [
{
key: 'system_addInputParam',
renderTypeList: ['addInputParam'],
valueType: 'dynamic',
label: '',
required: false,
description: 'core.module.input.description.HTTP Dynamic Input',
editField: {
key: true,
valueType: true
}
},
{
key: 'text',
valueType: 'string',
label: 'text',
renderTypeList: ['reference'],
description: '',
canEdit: true,
editField: {
key: true,
valueType: true
},
value: ['pluginInput', 'p0m68Dv5KaIp']
},
{
key: 'url',
valueType: 'string',
label: 'url',
renderTypeList: ['reference'],
description: '',
canEdit: true,
editField: {
key: true,
valueType: true
},
value: ['pluginInput', 'mv52BrPVE6bm']
},
{
key: 'system_httpMethod',
renderTypeList: ['custom'],
valueType: 'string',
label: '',
value: 'POST',
required: true
},
{
key: 'system_httpReqUrl',
renderTypeList: ['hidden'],
valueType: 'string',
label: '',
description: 'core.module.input.description.Http Request Url',
placeholder: 'https://api.ai.com/getInventory',
required: false,
value: '{{url}}'
},
{
key: 'system_httpHeader',
renderTypeList: ['custom'],
valueType: 'any',
value: [],
label: '',
description: 'core.module.input.description.Http Request Header',
placeholder: 'core.module.input.description.Http Request Header',
required: false
},
{
key: 'system_httpParams',
renderTypeList: ['hidden'],
valueType: 'any',
value: [],
label: '',
required: false
},
{
key: 'system_httpJsonBody',
renderTypeList: ['hidden'],
valueType: 'any',
value:
'{\r\n "msg_type": "text",\r\n "content": {\r\n "text": "{{text}}"\r\n }\r\n}',
label: '',
required: false
}
],
outputs: [
{
id: 'system_addOutputParam',
key: 'system_addOutputParam',
type: 'dynamic',
valueType: 'dynamic',
label: '',
editField: {
key: true,
valueType: true
}
},
{
id: 'error',
key: 'error',
label: '请求错误',
description: 'HTTP请求错误信息,成功时返回空',
valueType: 'object',
type: 'static'
},
{
id: 'httpRawResponse',
key: 'httpRawResponse',
label: '原始响应',
required: true,
description: 'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。',
valueType: 'any',
type: 'static'
}
]
}
],
edges: [
{
source: 'pluginInput',
target: 'rKBYGQuYefae',
sourceHandle: 'pluginInput-source-right',
targetHandle: 'rKBYGQuYefae-target-left'
},
{
source: 'rKBYGQuYefae',
target: 'pluginOutput',
sourceHandle: 'rKBYGQuYefae-source-right',
targetHandle: 'pluginOutput-target-left'
}
]
} }
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment