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

* feat: app template;fix: chat test reset

* template output

* template output
This commit is contained in:
Archer
2024-06-25 13:47:25 +08:00
committed by GitHub
parent 5c8c7fb9f2
commit c8bc9838e3
11 changed files with 2110 additions and 462 deletions

View File

@@ -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. 修复 - 输入引导特殊字符导致正则报错
12. 修复 - 文件包含特殊字符`%`,且为转义时会导致页面崩溃
13. 修复 - 自定义输入选择知识库引用时页面崩溃

View File

@@ -272,7 +272,7 @@ Response:
{ {
"key": "Authorization", "key": "Authorization",
"type": "string", "type": "string",
"value": "Bearer sk-zsfBsxEU3ApSFGYxF4CdB97e9556412588421823371b9f7b" "value": "Bearer "
} }
], ],
"label": "", "label": "",

View File

@@ -26,456 +26,378 @@ weight: 404
{{% details title="编排配置" closed="true" %}} {{% details title="编排配置" closed="true" %}}
```json ```json
[ {
{ "nodes": [
"nodeId": "userGuide", {
"name": "core.module.template.App system setting", "nodeId": "userGuide",
"intro": "core.app.tip.userGuideTip", "name": "系统配置",
"avatar": "/imgs/workflow/userGuide.png", "intro": "可以配置应用的系统参数",
"flowNodeType": "userGuide", "avatar": "/imgs/workflow/userGuide.png",
"position": { "flowNodeType": "userGuide",
"x": -92.26884681344463, "position": {
"y": 710.9354029649536 "x": 303.41163758039283,
"y": -552.297639861266
},
"version": "481",
"inputs": [],
"outputs": []
}, },
"inputs": [ {
{ "nodeId": "workflowStartNodeId",
"key": "welcomeText", "name": "流程开始",
"type": "hidden", "intro": "",
"valueType": "string", "avatar": "/imgs/workflow/userChatInput.svg",
"label": "core.app.Welcome Text", "flowNodeType": "workflowStart",
"showTargetInApp": false, "position": {
"showTargetInPlugin": false, "x": 529.3935295017156,
"value": "", "y": 197.114018410347
"connected": false
}, },
{ "version": "481",
"key": "variables", "inputs": [
"type": "hidden", {
"valueType": "any", "key": "userChatInput",
"label": "core.module.Variable", "renderTypeList": [
"value": [], "reference",
"showTargetInApp": false, "textarea"
"showTargetInPlugin": false, ],
"connected": false "valueType": "string",
}, "label": "用户问题",
{ "required": true,
"key": "questionGuide", "toolDescription": "用户问题"
"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": []
},
{
"nodeId": "userChatInput",
"name": "core.module.template.Chat entrance",
"intro": "当用户发送一个内容后,流程将会从这个模块开始执行。",
"avatar": "/imgs/workflow/userChatInput.svg",
"flowNodeType": "questionInput",
"position": {
"x": 241.60980819261408,
"y": 1330.9528898009685
},
"inputs": [
{
"key": "userChatInput",
"type": "systemInput",
"valueType": "string",
"label": "core.module.input.label.user question",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "source",
"valueType": "string",
"targets": [
{
"nodeId": "n84rvg",
"key": "userChatInput"
}
]
}
]
},
{
"nodeId": "n84rvg",
"name": "工具调用(实验)",
"intro": "通过AI模型自动选择一个或多个功能块进行调用也可以对插件进行调用。",
"avatar": "/imgs/workflow/tool.svg",
"flowNodeType": "tools",
"showStatus": true,
"position": {
"x": 809.4264785615641,
"y": 873.3971746859133
},
"inputs": [
{
"key": "model",
"type": "settingLLMModel",
"label": "core.module.input.label.aiModel",
"required": true,
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"llmModelType": "all",
"value": "gpt-3.5-turbo",
"connected": false
},
{
"key": "temperature",
"type": "hidden",
"label": "",
"value": 0,
"valueType": "number",
"min": 0,
"max": 10,
"step": 1,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "maxToken",
"type": "hidden",
"label": "",
"value": 2000,
"valueType": "number",
"min": 100,
"max": 4000,
"step": 50,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "systemPrompt",
"type": "textarea",
"max": 3000,
"valueType": "string",
"label": "core.ai.Prompt",
"description": "core.app.tip.chatNodeSystemPromptTip",
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "history",
"type": "numberInput",
"label": "core.module.input.label.chat history",
"required": true,
"min": 0,
"max": 30,
"valueType": "chatHistory",
"value": 6,
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "userChatInput",
"type": "custom",
"label": "",
"required": true,
"valueType": "string",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "hidden",
"valueType": "string",
"targets": []
},
{
"key": "selectedTools",
"valueType": "tools",
"type": "hidden",
"targets": [
{
"nodeId": "3mbu91",
"key": "selectedTools"
}
]
},
{
"key": "finish",
"label": "",
"description": "",
"valueType": "boolean",
"type": "hidden",
"targets": []
}
]
},
{
"nodeId": "3mbu91",
"name": "HTTP 请求",
"intro": "调用飞书webhook发送一个通知",
"avatar": "/imgs/workflow/http.png",
"flowNodeType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1483.6437630977423,
"y": 798.9716928475544
},
"inputs": [
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "POST",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "这里填写你的飞书机器人地址",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "{\r\n \"msg_type\": \"text\",\r\n \"content\": {\r\n \"text\": \"{{text}}\"\r\n }\r\n}",
"label": "",
"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": [
{
"key": "httpRawResponse",
"label": "原始响应",
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"valueType": "any",
"type": "source",
"targets": [
{
"nodeId": "rzx4mj",
"key": "switch"
},
{
"nodeId": "psdhs1",
"key": "switch"
}
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"description": true,
"dataType": true,
"defaultValue": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
} }
],
"outputs": [
{
"id": "userChatInput",
"key": "userChatInput",
"label": "core.module.input.label.user question",
"valueType": "string",
"type": "static"
}
]
},
{
"nodeId": "u6IAOEssxoZT",
"name": "工具调用(实验)",
"intro": "通过AI模型自动选择一个或多个功能块进行调用也可以对插件进行调用。",
"avatar": "/imgs/workflow/tool.svg",
"flowNodeType": "tools",
"showStatus": true,
"position": {
"x": 1003.146243538873,
"y": 48.52327869406625
}, },
{ "version": "481",
"type": "source", "inputs": [
"valueType": "string", {
"key": "prompt", "key": "model",
"label": "prompt", "renderTypeList": [
"description": "", "settingLLMModel",
"required": false, "reference"
"edit": true, ],
"editField": { "label": "core.module.input.label.aiModel",
"key": true, "valueType": "string",
"description": true, "llmModelType": "all",
"dataType": true, "value": "gpt-3.5-turbo"
"defaultValue": true
}, },
"targets": [] {
} "key": "temperature",
] "renderTypeList": [
}, "hidden"
{ ],
"nodeId": "rzx4mj", "label": "",
"name": "工具调用终止", "value": 0,
"intro": "该模块需配置工具调用使用。当该模块被执行时本次工具调用将会强制结束并且不再调用AI针对工具调用结果回答问题。", "valueType": "number",
"avatar": "/imgs/workflow/toolStop.svg", "min": 0,
"flowNodeType": "stopTool", "max": 10,
"position": { "step": 1
"x": 2145.5070710160267, },
"y": 1306.3581817783079 {
"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"
},
{
"key": "history",
"renderTypeList": [
"numberInput",
"reference"
],
"valueType": "chatHistory",
"label": "core.module.input.label.chat history",
"description": "最多携带多少轮对话记录",
"required": true,
"min": 0,
"max": 50,
"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"
}
]
}, },
"inputs": [ {
{ "nodeId": "fvY5hb0K646V",
"key": "switch", "name": "工具调用终止",
"type": "triggerAndFinish", "intro": "该模块需配置工具调用使用。当该模块被执行时本次工具调用将会强制结束并且不再调用AI针对工具调用结果回答问题。",
"label": "", "avatar": "/imgs/workflow/toolStop.svg",
"description": "core.module.input.description.Trigger", "flowNodeType": "stopTool",
"valueType": "any", "position": {
"showTargetInApp": true, "x": 2367.838362362707,
"showTargetInPlugin": true, "y": 732.355988936165
"connected": true
}
],
"outputs": []
},
{
"nodeId": "psdhs1",
"name": "指定回复",
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
"avatar": "/imgs/workflow/reply.png",
"flowNodeType": "answerNode",
"position": {
"x": 2117.0429459850598,
"y": 1658.4125434513746
},
"inputs": [
{
"key": "switch",
"type": "triggerAndFinish",
"label": "",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
}, },
"version": "481",
"inputs": [],
"outputs": []
},
{
"nodeId": "x9rN2a4WnZmt",
"name": "HTTP 请求",
"intro": "向飞书发送一个webhooks通知信息。",
"avatar": "/imgs/workflow/http.png",
"flowNodeType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1623.9214305901633,
"y": 22.777089001645862
},
"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": "text",
"label": "text",
"toolDescription": "发送的消息",
"required": true,
"canEdit": true,
"editField": {
"key": true,
"description": true
}
},
{
"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": ""
},
{
"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"
}
]
},
{
"nodeId": "aGHGqH2oUupj",
"name": "指定回复",
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
"avatar": "/imgs/workflow/reply.png",
"flowNodeType": "answerNode",
"position": {
"x": 2350.7077940158674,
"y": 107.32448732713493
},
"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",
"value": "嘻嘻,发送成功"
}
],
"outputs": []
}
],
"edges": [
{
"source": "workflowStartNodeId",
"target": "u6IAOEssxoZT",
"sourceHandle": "workflowStartNodeId-source-right",
"targetHandle": "u6IAOEssxoZT-target-left"
},
{
"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": [
{ {
"key": "text", "id": "txq1ca",
"type": "textarea", "key": "test",
"valueType": "any", "label": "测试",
"label": "core.module.input.label.Response content", "type": "custom",
"description": "core.module.input.description.Response content", "required": true,
"placeholder": "core.module.input.description.Response content", "maxLen": 50,
"showTargetInApp": true, "enums": [
"showTargetInPlugin": true, {
"value": "笑死发送成功啦", "value": ""
"connected": false }
]
} }
], ],
"outputs": [ "questionGuide": false,
{ "scheduledTriggerConfig": {
"key": "finish", "cronString": "",
"label": "", "timezone": "Asia/Shanghai",
"description": "", "defaultPrompt": ""
"valueType": "boolean", },
"type": "hidden", "_id": "66715d4bf577287d39e35ecf"
"targets": []
}
]
} }
] }
``` ```
{{% /details %}} {{% /details %}}

View File

@@ -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 {

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -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>
</> </>

View File

@@ -1,11 +1,9 @@
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 = (
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 = (
chatConfig: appDetail.chatConfig chatConfig: appDetail.chatConfig
}); });
useImperativeHandle(ref, () => ({
resetChatTest: resetChatBox
}));
return ( return (
<> <>
<Box <Box
@@ -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>

File diff suppressed because it is too large Load Diff