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.34k stars 4.66k forks source link

每隔1小时都会请求gpt-3.5-turbo,日志中报错 #1772

Closed mwnu closed 3 months ago

mwnu commented 4 months ago

例行检查

你的版本

问题描述, 日志截图

首先是每小时都会向OpenAI 的API 发出两个调用gpt-3.5-turbo的请求,消耗的tokens都是固定的。

这个问题是fastgpt 有定时任务的版本后才出现的,我把所有的定时任务都取消了,这个整点定时的请求不知道从哪发出的。

其次也是同一时间,日志中出现错误,向API调用dall-e-3,我的应用中只有一个dall-e-3的应用,这个应用没有直接调用AI对话模块,而是用一个http插件来访问dall-e-3的API,但是没有定时任务。我怀疑上面定时的gpt-3.5-turbo请求也和它有关。

[Error] 2024-06-15 05:00:18 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-15 05:00:31 Http request error 
{
  message: 'Request failed with status code 400',
  stack: 'AxiosError: Request failed with status code 400\n' +
    '    at settle (file:///app/node_modules/.pnpm/axios@1.5.1/node_modules/axios/lib/core/settle.js:19:12)\n' +
    '    at IncomingMessage.handleStreamEnd (file:///app/node_modules/.pnpm/axios@1.5.1/node_modules/axios/lib/adapters/http.js:572:11)\n' +
    '    at IncomingMessage.emit (node:events:526:35)\n' +
    '    at endReadableNT (node:internal/streams/readable:1359:12)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)',
  config: {
    headers: Object [AxiosHeaders] {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      Authorization: 'Bearer xxxxxxxxxxxxxxxxx',
      'User-Agent': 'axios/1.5.1',
      'Content-Length': '118',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    url: 'https://xxx.xxx.xxx/v1/images/generations',
    data: '{"model":"dall-e-3","prompt":"","n":1,"quality":"standard","response_format":"url","style":"vivid","size":"1024x1024"}'
  },
  response: { status: 400, statusText: 'Bad Request' }
}
error => Request failed with status code 400
error => Request failed with status code 400
error => Request failed with status code 400
SyntaxError: Unexpected token { in JSON at position 47
    at JSON.parse (<anonymous>)
    at /app/projects/app/.next/server/chunks/75612.js:314:1220
    at Object.h [as httpRequest468] (/app/projects/app/.next/server/chunks/75612.js:314:1485)
[Error] 2024-06-15 05:00:31 Schedule trigger error 
{
  message: 'Invalid JSON body: {\r\n' +
    '    "created": "{{createdRR",\r\n' +
    '    "data": {{dataRR\r\n' +
    'R\r\n' +
    '  ',
  stack: undefined
}
[Error] 2024-06-15 05:00:37 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-15 05:00:39 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-15 05:00:41 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-15 05:00:52 Schedule trigger error 
{ message: 'core.chat.error.User input empty', stack: undefined }

复现步骤

image

这个是应用的配置:

{
  "nodes": [
    {
      "nodeId": "userGuide",
      "name": "系统配置",
      "intro": "可以配置应用的系统参数",
      "avatar": "/imgs/workflow/userGuide.png",
      "flowNodeType": "userGuide",
      "position": {
        "x": 1703.968936407,
        "y": 162.82262467662048
      },
      "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": [
            {
              "id": "ctibcw",
              "key": "size",
              "label": "大小",
              "type": "select",
              "required": false,
              "maxLen": 50,
              "enums": [
                {
                  "value": "1024x1024"
                },
                {
                  "value": "1024x1792"
                },
                {
                  "value": "1792x1024"
                }
              ],
              "icon": "core/app/variable/select"
            },
            {
              "id": "3mgsuz",
              "key": "style",
              "label": "风格",
              "type": "select",
              "required": false,
              "maxLen": 50,
              "enums": [
                {
                  "value": "vivid"
                },
                {
                  "value": "natural"
                }
              ],
              "icon": "core/app/variable/select"
            }
          ]
        },
        {
          "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": "workflowStartNodeId",
      "name": "流程开始",
      "intro": "",
      "avatar": "/imgs/workflow/userChatInput.svg",
      "flowNodeType": "workflowStart",
      "position": {
        "x": 1412.3987331858677,
        "y": -352.18201522369054
      },
      "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": "lbE116fsgOHp",
      "name": "判断器",
      "intro": "根据一定的条件,执行不同的分支。",
      "avatar": "/imgs/workflow/ifElse.svg",
      "flowNodeType": "ifElseNode",
      "showStatus": true,
      "position": {
        "x": 2925.7998989227094,
        "y": -604.9433630297102
      },
      "version": "481",
      "inputs": [
        {
          "key": "ifElseList",
          "renderTypeList": [
            "hidden"
          ],
          "valueType": "any",
          "label": "",
          "value": [
            {
              "condition": "AND",
              "list": [
                {
                  "variable": [
                    "VARIABLE_NODE_ID",
                    "size"
                  ],
                  "condition": "isNotEmpty"
                }
              ]
            }
          ]
        }
      ],
      "outputs": [
        {
          "id": "ifElseResult",
          "key": "ifElseResult",
          "label": "判断结果",
          "valueType": "string",
          "type": "static"
        }
      ]
    },
    {
      "nodeId": "rQtUwSihmNGW",
      "name": "判断器",
      "intro": "根据一定的条件,执行不同的分支。",
      "avatar": "/imgs/workflow/ifElse.svg",
      "flowNodeType": "ifElseNode",
      "showStatus": true,
      "position": {
        "x": 3719.952403743623,
        "y": -739.7952085847104
      },
      "version": "481",
      "inputs": [
        {
          "key": "ifElseList",
          "renderTypeList": [
            "hidden"
          ],
          "valueType": "any",
          "label": "",
          "value": [
            {
              "condition": "AND",
              "list": [
                {
                  "variable": [
                    "VARIABLE_NODE_ID",
                    "style"
                  ],
                  "condition": "isNotEmpty"
                }
              ]
            }
          ]
        }
      ],
      "outputs": [
        {
          "id": "ifElseResult",
          "key": "ifElseResult",
          "label": "判断结果",
          "valueType": "string",
          "type": "static"
        }
      ]
    },
    {
      "nodeId": "d7tdJlKoxCfl",
      "name": "变量更新",
      "intro": "可以更新指定节点的输出值或更新全局变量",
      "avatar": "/imgs/workflow/variable.png",
      "flowNodeType": "variableUpdate",
      "showStatus": true,
      "position": {
        "x": 4368.235523100005,
        "y": -238.4663959526453
      },
      "version": "481",
      "inputs": [
        {
          "key": "updateList",
          "valueType": "any",
          "label": "",
          "renderTypeList": [
            "hidden"
          ],
          "editField": {
            "key": true,
            "valueType": true
          },
          "value": [
            {
              "variable": [
                "VARIABLE_NODE_ID",
                "style"
              ],
              "value": [
                "",
                "vivid"
              ],
              "renderType": "input"
            }
          ]
        }
      ],
      "outputs": []
    },
    {
      "nodeId": "n6RLJPklPQis",
      "name": "DALL·E 3建图",
      "intro": "根据用户提示用DALL·E 3模型生成图片",
      "avatar": "/icon/logo.svg",
      "flowNodeType": "pluginModule",
      "showStatus": true,
      "position": {
        "x": 4735.381585091102,
        "y": -724.1120046744425
      },
      "version": "481",
      "inputs": [
        {
          "key": "prompt",
          "valueType": "string",
          "label": "prompt",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "A text description of the desired image(s). The maximum length is 4000 characters.",
          "toolDescription": "A text description of the desired image(s). The maximum length is 4000 characters.",
          "canEdit": false,
          "value": [
            "workflowStartNodeId",
            "userChatInput"
          ],
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          }
        },
        {
          "key": "size",
          "valueType": "string",
          "label": "size",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "The size of the generated images. Must be one of 1024x1024, 1792x1024, or 1024x1792. If the user does not specify, the default is 1024x1024.",
          "toolDescription": "The size of the generated images. Must be one of 1024x1024, 1792x1024, or 1024x1792. If the user does not specify, the default is 1024x1024.",
          "canEdit": false,
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          },
          "value": [
            "VARIABLE_NODE_ID",
            "size"
          ]
        },
        {
          "key": "style",
          "valueType": "string",
          "label": "style",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.\nIf the user does not specify, the default value is vivid .",
          "toolDescription": "The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.\nIf the user does not specify, the default value is vivid .",
          "canEdit": false,
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          },
          "value": [
            "VARIABLE_NODE_ID",
            "style"
          ]
        }
      ],
      "outputs": [
        {
          "id": "picinfo",
          "type": "static",
          "key": "picinfo",
          "valueType": "string",
          "label": "picinfo",
          "description": ""
        }
      ],
      "pluginId": "662d9f030902a03b8cf7500c",
      "nodeVersion": "1UamII"
    },
    {
      "nodeId": "boTYci8iiZrj",
      "name": "命令识取",
      "intro": "",
      "avatar": "/icon/logo.svg",
      "flowNodeType": "pluginModule",
      "showStatus": true,
      "position": {
        "x": 1727.4555255752541,
        "y": -345.9065650492245
      },
      "version": "481",
      "inputs": [
        {
          "key": "ask",
          "valueType": "string",
          "label": "ask",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "用户的问题",
          "canEdit": false,
          "value": [
            "workflowStartNodeId",
            "userChatInput"
          ],
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          }
        }
      ],
      "outputs": [
        {
          "id": "prompt",
          "type": "static",
          "key": "prompt",
          "valueType": "any",
          "label": "prompt",
          "description": ""
        },
        {
          "id": "cmdBegin",
          "type": "static",
          "key": "cmdBegin",
          "valueType": "any",
          "label": "cmdBegin",
          "description": ""
        },
        {
          "id": "cmdEnd",
          "type": "static",
          "key": "cmdEnd",
          "valueType": "any",
          "label": "cmdEnd",
          "description": ""
        }
      ],
      "pluginId": "665f491ff66a44eb9c60596e",
      "nodeVersion": "9vB9SC"
    },
    {
      "nodeId": "tLLGDeVVyh1C",
      "name": "判断器",
      "intro": "根据一定的条件,执行不同的分支。",
      "avatar": "/imgs/workflow/ifElse.svg",
      "flowNodeType": "ifElseNode",
      "showStatus": true,
      "position": {
        "x": 2171.640473249486,
        "y": -340.8938756955039
      },
      "version": "481",
      "inputs": [
        {
          "key": "ifElseList",
          "renderTypeList": [
            "hidden"
          ],
          "valueType": "any",
          "label": "",
          "value": [
            {
              "condition": "AND",
              "list": [
                {
                  "variable": [
                    "boTYci8iiZrj",
                    "cmdBegin"
                  ],
                  "condition": "isEmpty",
                  "value": "false"
                },
                {
                  "variable": [
                    "boTYci8iiZrj",
                    "cmdEnd"
                  ],
                  "condition": "equalTo",
                  "value": "0"
                }
              ]
            }
          ]
        }
      ],
      "outputs": [
        {
          "id": "ifElseResult",
          "key": "ifElseResult",
          "label": "判断结果",
          "valueType": "string",
          "type": "static"
        }
      ]
    },
    {
      "nodeId": "raVomC9oksCe",
      "name": "命令分类",
      "intro": "",
      "avatar": "/icon/logo.svg",
      "flowNodeType": "pluginModule",
      "showStatus": true,
      "position": {
        "x": 3034.936030074265,
        "y": 29.149642207255
      },
      "version": "481",
      "inputs": [
        {
          "key": "ask",
          "valueType": "string",
          "label": "ask",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "",
          "canEdit": false,
          "value": [
            "boTYci8iiZrj",
            "prompt"
          ],
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          }
        },
        {
          "key": "context",
          "valueType": "chatHistory",
          "label": "context",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "",
          "canEdit": false,
          "value": [
            "VARIABLE_NODE_ID",
            "histories"
          ],
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          }
        },
        {
          "key": "cmdBegin",
          "valueType": "string",
          "label": "cmdBegin",
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "description": "",
          "canEdit": false,
          "value": [
            "boTYci8iiZrj",
            "cmdBegin"
          ],
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          }
        },
        {
          "inputType": "reference",
          "valueType": "number",
          "key": "cmdEnd",
          "label": "cmdEnd",
          "description": "",
          "isToolInput": false,
          "defaultValue": "",
          "editField": {
            "key": true
          },
          "dynamicParamDefaultValue": {
            "inputType": "reference",
            "valueType": "string",
            "required": true
          },
          "renderTypeList": [
            "reference"
          ],
          "required": true,
          "canEdit": false,
          "value": [
            "boTYci8iiZrj",
            "cmdEnd"
          ]
        }
      ],
      "outputs": [
        {
          "id": "memory",
          "type": "static",
          "key": "memory",
          "valueType": "chatHistory",
          "label": "memory",
          "description": ""
        },
        {
          "id": "reply",
          "type": "static",
          "key": "reply",
          "valueType": "string",
          "label": "reply",
          "description": ""
        }
      ],
      "pluginId": "665f4eaff66a44eb9c605a58",
      "nodeVersion": "Ze5kin"
    },
    {
      "nodeId": "crQJRLAdbUpr",
      "name": "指定回复",
      "intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
      "avatar": "/imgs/workflow/reply.png",
      "flowNodeType": "answerNode",
      "position": {
        "x": 5187.082001745657,
        "y": -655.4952131138776
      },
      "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": [
            "n6RLJPklPQis",
            "picinfo"
          ]
        }
      ],
      "outputs": []
    },
    {
      "nodeId": "j5VA5FJpzHcS",
      "name": "变量更新",
      "intro": "可以更新指定节点的输出值或更新全局变量",
      "avatar": "/imgs/workflow/variable.png",
      "flowNodeType": "variableUpdate",
      "showStatus": false,
      "position": {
        "x": 3763.6277611340442,
        "y": -260.37662880606877
      },
      "version": "481",
      "inputs": [
        {
          "key": "updateList",
          "valueType": "any",
          "label": "",
          "renderTypeList": [
            "hidden"
          ],
          "editField": {
            "key": true,
            "valueType": true
          },
          "value": [
            {
              "variable": [
                "VARIABLE_NODE_ID",
                "size"
              ],
              "value": [
                "",
                "1024x1024"
              ],
              "valueType": "any",
              "renderType": "input"
            }
          ]
        }
      ],
      "outputs": []
    }
  ],
  "edges": [
    {
      "source": "lbE116fsgOHp",
      "target": "rQtUwSihmNGW",
      "sourceHandle": "lbE116fsgOHp-source-IF",
      "targetHandle": "rQtUwSihmNGW-target-left"
    },
    {
      "source": "rQtUwSihmNGW",
      "target": "n6RLJPklPQis",
      "sourceHandle": "rQtUwSihmNGW-source-IF",
      "targetHandle": "n6RLJPklPQis-target-left"
    },
    {
      "source": "workflowStartNodeId",
      "target": "boTYci8iiZrj",
      "sourceHandle": "workflowStartNodeId-source-right",
      "targetHandle": "boTYci8iiZrj-target-left"
    },
    {
      "source": "boTYci8iiZrj",
      "target": "tLLGDeVVyh1C",
      "sourceHandle": "boTYci8iiZrj-source-right",
      "targetHandle": "tLLGDeVVyh1C-target-left"
    },
    {
      "source": "tLLGDeVVyh1C",
      "target": "raVomC9oksCe",
      "sourceHandle": "tLLGDeVVyh1C-source-ELSE",
      "targetHandle": "raVomC9oksCe-target-left"
    },
    {
      "source": "n6RLJPklPQis",
      "target": "crQJRLAdbUpr",
      "sourceHandle": "n6RLJPklPQis-source-right",
      "targetHandle": "crQJRLAdbUpr-target-left"
    },
    {
      "source": "tLLGDeVVyh1C",
      "target": "lbE116fsgOHp",
      "sourceHandle": "tLLGDeVVyh1C-source-IF",
      "targetHandle": "lbE116fsgOHp-target-left"
    },
    {
      "source": "rQtUwSihmNGW",
      "target": "d7tdJlKoxCfl",
      "sourceHandle": "rQtUwSihmNGW-source-ELSE",
      "targetHandle": "d7tdJlKoxCfl-target-left"
    },
    {
      "source": "d7tdJlKoxCfl",
      "target": "n6RLJPklPQis",
      "sourceHandle": "d7tdJlKoxCfl-source-top",
      "targetHandle": "n6RLJPklPQis-target-bottom"
    },
    {
      "source": "d7tdJlKoxCfl",
      "target": "n6RLJPklPQis",
      "sourceHandle": "d7tdJlKoxCfl-source-right",
      "targetHandle": "n6RLJPklPQis-target-bottom"
    },
    {
      "source": "lbE116fsgOHp",
      "target": "j5VA5FJpzHcS",
      "sourceHandle": "lbE116fsgOHp-source-ELSE",
      "targetHandle": "j5VA5FJpzHcS-target-left"
    },
    {
      "source": "j5VA5FJpzHcS",
      "target": "rQtUwSihmNGW",
      "sourceHandle": "j5VA5FJpzHcS-source-top",
      "targetHandle": "rQtUwSihmNGW-target-bottom"
    }
  ],
  "chatConfig": {
    "variables": [
      {
        "id": "9wrwn2",
        "key": "size",
        "label": "大小",
        "type": "select",
        "required": false,
        "maxLen": 50,
        "enums": [
          {
            "value": "1024x1024"
          },
          {
            "value": "1792x1024"
          },
          {
            "value": "1024x1792"
          }
        ],
        "icon": "core/app/variable/select"
      },
      {
        "id": "2jdi7l",
        "key": "style",
        "label": "风格",
        "type": "select",
        "required": false,
        "maxLen": 50,
        "enums": [
          {
            "value": "vivid"
          },
          {
            "value": "natural"
          }
        ],
        "icon": "core/app/variable/select"
      }
    ],
    "scheduledTriggerConfig": {
      "cronString": "",
      "timezone": "Asia/Shanghai",
      "defaultPrompt": ""
    },
    "_id": "665c6f3d29b26086f0056830"
  }
}

预期结果

相关截图 image

c121914yu commented 4 months ago

😂没遇到过,遇到再看

mwnu commented 3 months ago

😂没遇到过,遇到再看

我想已经弄清楚了,是工具调用模块的问题,工具调用插件如果使用不支持函数调用的模型(如claude)就会出现错误,而如果使用支持函数调用但没有没有获取预期的结果,虽然不会报错,但也会重试,只我并没有在该应用中对话,不知道为什么它会每小时重试一次。

image

应用配置:

{
  "nodes": [
    {
      "nodeId": "userGuide",
      "name": "系统配置",
      "intro": "可以配置应用的系统参数",
      "avatar": "/imgs/workflow/userGuide.png",
      "flowNodeType": "userGuide",
      "position": {
        "x": 531.2422736065552,
        "y": -486.7611729549753
      },
      "version": "481",
      "inputs": [],
      "outputs": []
    },
    {
      "nodeId": "workflowStartNodeId",
      "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": "cHiFqx",
      "name": "工具调用(实验)",
      "intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
      "avatar": "/imgs/workflow/tool.svg",
      "flowNodeType": "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": 2,
          "valueType": "number",
          "min": 0,
          "max": 10,
          "step": 1
        },
        {
          "key": "maxToken",
          "renderTypeList": [
            "hidden"
          ],
          "label": "",
          "value": 4096,
          "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": []
    },
    {
      "nodeId": "huoAI4",
      "name": "简单搜索",
      "intro": "简单搜索",
      "avatar": "/icon/logo.svg",
      "flowNodeType": "pluginModule",
      "showStatus": true,
      "position": {
        "x": 1000,
        "y": 545
      },
      "version": "481",
      "inputs": [
        {
          "key": "query",
          "valueType": "string",
          "label": "query",
          "renderTypeList": [
            "reference"
          ],
          "required": false,
          "description": "搜索查询字符串",
          "toolDescription": "搜索查询字符串",
          "canEdit": false,
          "editField": {
            "key": true,
            "name": true,
            "description": true,
            "required": true,
            "dataType": true,
            "inputType": true,
            "isToolInput": true
          },
          "value": ""
        }
      ],
      "outputs": [
        {
          "id": "images",
          "type": "static",
          "key": "images",
          "valueType": "datasetQuote",
          "label": "images",
          "description": ""
        },
        {
          "id": "results",
          "type": "static",
          "key": "results",
          "valueType": "datasetQuote",
          "label": "results",
          "description": ""
        }
      ],
      "pluginId": "662cd19ccf4394583d321fa5"
    }
  ],
  "edges": [
    {
      "source": "workflowStartNodeId",
      "target": "cHiFqx",
      "sourceHandle": "workflowStartNodeId-source-right",
      "targetHandle": "cHiFqx-target-left"
    },
    {
      "source": "cHiFqx",
      "target": "huoAI4",
      "sourceHandle": "selectedTools",
      "targetHandle": "selectedTools"
    }
  ],
  "chatConfig": {
    "welcomeText": "",
    "variables": [],
    "questionGuide": false,
    "ttsConfig": {
      "type": "web"
    },
    "whisperConfig": {
      "open": false,
      "autoSend": false,
      "autoTTSResponse": false
    },
    "scheduledTriggerConfig": {
      "cronString": "",
      "timezone": "Asia/Shanghai",
      "defaultPrompt": ""
    },
    "chatInputGuide": {
      "open": false,
      "textList": [],
      "customUrl": ""
    },
    "_id": "665f5ce9f66a44eb9c606172"
  }
}

插件配置:

{
  "nodes": [
    {
      "nodeId": "OIoX7OM2gXfj",
      "name": "定义插件输入",
      "intro": "自定义配置外部输入,使用插件时,仅暴露自定义配置的输入",
      "avatar": "/imgs/workflow/input.png",
      "flowNodeType": "pluginInput",
      "showStatus": false,
      "position": {
        "x": 557.484620014067,
        "y": -168.21037859203835
      },
      "version": "481",
      "inputs": [
        {
          "key": "query",
          "valueType": "string",
          "label": "query",
          "renderTypeList": [
            "reference"
          ],
          "required": false,
          "description": "搜索查询字符串",
          "toolDescription": "搜索查询字符串",
          "canEdit": true,
          "editField": {
            "key": true,
            "name": true,
            "description": true,
            "required": true,
            "dataType": true,
            "inputType": true,
            "isToolInput": true
          }
        }
      ],
      "outputs": [
        {
          "id": "dFDc3Sl53joi",
          "key": "query",
          "valueType": "string",
          "label": "query",
          "type": "source",
          "edit": true
        }
      ]
    },
    {
      "nodeId": "dekvQjRbs128",
      "name": "定义插件输出",
      "intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
      "avatar": "/imgs/workflow/output.png",
      "flowNodeType": "pluginOutput",
      "showStatus": false,
      "position": {
        "x": 1607.7142331269126,
        "y": -151.8669210746189
      },
      "version": "481",
      "inputs": [
        {
          "key": "images",
          "valueType": "datasetQuote",
          "label": "images",
          "renderTypeList": [
            "reference"
          ],
          "required": false,
          "description": "",
          "canEdit": true,
          "editField": {
            "key": true,
            "description": true,
            "valueType": true
          },
          "value": [
            "coz28JnSopQj",
            "Vah2BqPABZcH"
          ]
        },
        {
          "key": "results",
          "valueType": "datasetQuote",
          "label": "results",
          "renderTypeList": [
            "reference"
          ],
          "required": false,
          "description": "",
          "canEdit": true,
          "editField": {
            "key": true,
            "description": true,
            "valueType": true
          },
          "value": [
            "coz28JnSopQj",
            "3LVZ1hu2w30f"
          ]
        }
      ],
      "outputs": []
    },
    {
      "nodeId": "coz28JnSopQj",
      "name": "HTTP 请求",
      "intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
      "avatar": "/imgs/workflow/http.png",
      "flowNodeType": "httpRequest468",
      "showStatus": true,
      "position": {
        "x": 1042.549746602742,
        "y": -447.77496332641647
      },
      "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": "query",
          "valueType": "string",
          "label": "query",
          "renderTypeList": [
            "reference"
          ],
          "canEdit": true,
          "editField": {
            "key": true,
            "valueType": true
          },
          "value": [
            "OIoX7OM2gXfj",
            "dFDc3Sl53joi"
          ]
        },
        {
          "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.tavily.com/search"
        },
        {
          "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": "{\n  \"api_key\": \"tvly-xxx\",\n  \"query\": \"{{query}}\",\n  \"search_depth\": \"basic\",\n  \"include_images\": false,\n  \"include_answer\": false,\n  \"include_raw_content\": false,\n  \"max_results\": 5,\n  \"include_domains\": [],\n  \"exclude_domains\": []\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",
          "required": true
        },
        {
          "id": "Vah2BqPABZcH",
          "type": "dynamic",
          "key": "images",
          "valueType": "any",
          "label": "images"
        },
        {
          "id": "3LVZ1hu2w30f",
          "type": "dynamic",
          "key": "results",
          "valueType": "any",
          "label": "results"
        }
      ]
    }
  ],
  "edges": [
    {
      "source": "OIoX7OM2gXfj",
      "target": "coz28JnSopQj",
      "sourceHandle": "OIoX7OM2gXfj-source-right",
      "targetHandle": "coz28JnSopQj-target-left"
    },
    {
      "source": "coz28JnSopQj",
      "target": "dekvQjRbs128",
      "sourceHandle": "coz28JnSopQj-source-right",
      "targetHandle": "dekvQjRbs128-target-left"
    }
  ]
}
mwnu commented 3 months ago

工具调用终止模块不知道怎么用的

mwnu commented 3 months ago

也许不是工具插件的问题,我删除了应用重新创建了一下应用,该定时空请求仍然出现,而且多个没有使用工具插件的也出现错误日志(空请求)。 日志里面是这样的:

[Info] 2024-06-16 14:00:00 Clear invalid dataset files, total files: 0 
[Info] 2024-06-16 14:00:00 Clear invalid dataset files finish, remove 0 files 
[Error] 2024-06-16 14:00:01 Schedule trigger error 
{ message: 'core.chat.error.User input empty', stack: undefined }
.....
[Error] 2024-06-16 14:00:02 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-16 14:00:18 Schedule trigger error 
{ message: 'Question is empty', stack: undefined }
c121914yu commented 3 months ago

数据库翻翻 apps 表?看看有没有启用定时器的应用。

mwnu commented 3 months ago

数据库翻翻 apps 表?看看有没有启用定时器的应用。

查了,有多个scheduledTriggerConfig和scheduledTriggerNextTime不为null的, cronString为空,但是却有预定触发时间?

  "scheduledTriggerConfig": {
        "cronString": "",
        "timezone": "Asia/Shanghai",
        "defaultPrompt": ""
    },
    "scheduledTriggerNextTime": ISODate("2024-06-16T16:01:00Z")
mwnu commented 3 months ago

一旦设了定时任务,再给它关闭,scheduledTriggerConfig和scheduledTriggerNextTime这两个参数都不为null了(只是cronString变成空字符串),而定时任务是升级到v4.8.x自动启动的,我手动给它们关了。

mwnu commented 3 months ago

数据库翻翻 apps 表?看看有没有启用定时器的应用。

一旦设了定时任务,再给它关闭,scheduledTriggerConfig和scheduledTriggerNextTime这两个参数都不为null了(只是cronString变成空字符串),而定时任务是升级到v4.8.x自动启动的,我手动给它们关了。

我在数据库中全部设为null之后看起来后面没有再定时发空请求了。

db.apps.updateMany(
  {
    $or: [
      { scheduledTriggerConfig: { $ne: null } },
      { scheduledTriggerNextTime: { $ne: null } },
      { "chatConfig.scheduledTriggerConfig": { $ne: null } }
    ]
  },
  {
    $set: {
      scheduledTriggerConfig: null,
      scheduledTriggerNextTime: null,
      "chatConfig.scheduledTriggerConfig": null
    }
  }
)
c121914yu commented 3 months ago

已pr