labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.47k stars 4.69k forks source link

最新的 fastgpt-sandbox:v4.8.3 好像有bug #1659

Closed sunk926 closed 4 months ago

sunk926 commented 4 months ago

例行检查

你的版本

问题描述, 日志截图

function main(){
    return {
        result: 123
    }
}

使用上述简单的测试了下,自定义输出一直无法获取结果,折腾了半天 ,把docker-compose.yaml中的sandbox版本修改成 4.8.2 就好了..

sandbox:
    container_name: sandbox
    image: ghcr.io/labring/fastgpt-sandbox:v4.8.2 # git

完整测试配置

{
  "nodes": [
    {
      "nodeId": "userGuide",
      "name": "系统配置",
      "intro": "可以配置应用的系统参数",
      "avatar": "/imgs/workflow/userGuide.png",
      "flowNodeType": "userGuide",
      "position": {
        "x": 531.2422736065552,
        "y": -486.7611729549753
      },
      "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": 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": "dyYIeHqYGaxa",
      "name": "代码运行",
      "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
      "avatar": "/imgs/workflow/code.svg",
      "flowNodeType": "code",
      "showStatus": true,
      "position": {
        "x": 1119.6170938683942,
        "y": 42.42123976213031
      },
      "version": "482",
      "inputs": [
        {
          "key": "system_addInputParam",
          "renderTypeList": [
            "addInputParam"
          ],
          "valueType": "dynamic",
          "label": "",
          "required": false,
          "description": "这些变量会作为代码的运行的输入参数",
          "editField": {
            "key": true,
            "valueType": true
          }
        },
        {
          "key": "codeType",
          "renderTypeList": [
            "hidden"
          ],
          "label": "",
          "value": "js"
        },
        {
          "key": "code",
          "renderTypeList": [
            "custom"
          ],
          "label": "",
          "value": "function main(){\n    \n    return {\n        result: 123\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": "dyLnoKDxVNfY",
      "name": "指定回复",
      "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
      "avatar": "/imgs/workflow/reply.png",
      "flowNodeType": "answerNode",
      "position": {
        "x": 1545.0551236426268,
        "y": 489.7732225594276
      },
      "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": [
            "dyYIeHqYGaxa",
            "qLUQfhG0ILRX"
          ]
        }
      ],
      "outputs": []
    }
  ],
  "edges": [
    {
      "source": "448745",
      "target": "dyYIeHqYGaxa",
      "sourceHandle": "448745-source-right",
      "targetHandle": "dyYIeHqYGaxa-target-left"
    },
    {
      "source": "dyYIeHqYGaxa",
      "target": "dyLnoKDxVNfY",
      "sourceHandle": "dyYIeHqYGaxa-source-right",
      "targetHandle": "dyLnoKDxVNfY-target-left"
    }
  ],
  "chatConfig": {
    "variables": [],
    "scheduledTriggerConfig": {
      "cronString": "0 0 * * *",
      "timezone": "Etc/GMT-8",
      "defaultPrompt": ""
    },
    "_id": "665b3408acc47529035809ae"
  }
}
c121914yu commented 4 months ago

https://github.com/labring/FastGPT/issues/1657 重复