FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

core.chat.error.User question empty

Open oldunclez opened this issue 1 year ago • 10 comments

使用的镜像是 ghcr.io/labring/fastgpt:latest。 建立了一个知识库+对话引导的应用, 当在应用中与fastgpt进行对话时候,当输入第二个问题后,系统自动提示“问题补全”,然后就抛错core.chat.error.User question empty,请问是哪里没有设置对吗? 谢谢!

image image

oldunclez avatar Jan 08 '24 08:01 oldunclez

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The image used is ghcr.io/labring/fastgpt:latest. Established a knowledge base + dialogue guidance application, When talking to fastgpt in the application, after entering the second question, the system automatically prompts "question completion", and then throws the error core.chat.error.User question empty. Is there any setting? Thanks!

image image

c121914yu avatar Jan 08 '24 08:01 c121914yu

目前未了解该功能,只能在该应用的“高级编排”里面,把这个"问题补全”功能去掉了。

oldunclez avatar Jan 09 '24 06:01 oldunclez

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I don't know about this function yet, so I can only remove the "Question Completion" function in the "Advanced Orchestration" of the application.

c121914yu avatar Jan 09 '24 06:01 c121914yu

看着像编排有点问题,没有把问题传递到下一个模块。可以提供下编排内容?

c121914yu avatar Jan 10 '24 07:01 c121914yu

看着像编排有点问题,没有把问题传递到下一个模块。可以提供下编排内容?

编排内容是指高级编排的画面吗?实际上一开始是没有使用“高级编排”,只是默认建立了应用, 然后出现问题补全抛错后,才在“高级编排”了去掉了问题补全,从而现在是使用“高级编排”模式, 而不是“简易模式”

oldunclez avatar Jan 12 '24 04:01 oldunclez

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It looks like there is something wrong with the arrangement, and the problem is not passed to the next module. Can you provide the arrangement content?

Does the arrangement content refer to the advanced arrangement screen? In fact, "Advanced Orchestration" was not used at the beginning, and the application was just created by default. Then after the problem completion error occurred, the problem completion was removed in "Advanced Orchestration", so now the "Advanced Orchestration" mode is used. instead of "Easy Mode"

c121914yu avatar Jan 12 '24 04:01 c121914yu

遇到同样的问题

[
  {
    "moduleId": "userGuide",
    "name": "用户引导",
    "avatar": "/imgs/module/userGuide.png",
    "flowType": "userGuide",
    "position": {
      "x": 447.98520778293346,
      "y": 721.4016845336229
    },
    "inputs": [
      {
        "key": "welcomeText",
        "type": "hidden",
        "valueType": "string",
        "label": "开场白",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "你好,我是知识库助手,请不要忘记选择知识库噢~\n[你是谁]\n[如何使用]",
        "connected": false
      },
      {
        "key": "variables",
        "type": "hidden",
        "valueType": "any",
        "label": "对话框变量",
        "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": []
  },
  {
    "moduleId": "userChatInput",
    "name": "用户问题(对话入口)",
    "avatar": "/imgs/module/userChatInput.png",
    "flowType": "questionInput",
    "position": {
      "x": 324.81436595478294,
      "y": 1527.0012457753612
    },
    "inputs": [
      {
        "key": "userChatInput",
        "type": "systemInput",
        "valueType": "string",
        "label": "用户问题",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      }
    ],
    "outputs": [
      {
        "key": "userChatInput",
        "label": "用户问题",
        "type": "source",
        "valueType": "string",
        "targets": [
          {
            "moduleId": "vuc92c",
            "key": "userChatInput"
          },
          {
            "moduleId": "chatModule",
            "key": "userChatInput"
          }
        ]
      }
    ]
  },
  {
    "moduleId": "datasetSearch",
    "name": "知识库搜索",
    "avatar": "/imgs/module/db.png",
    "flowType": "datasetSearchNode",
    "showStatus": true,
    "position": {
      "x": 1351.5043753345153,
      "y": 947.0780385418003
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "datasets",
        "type": "selectDataset",
        "label": "关联的知识库",
        "value": [],
        "valueType": "selectDataset",
        "list": [],
        "required": true,
        "showTargetInApp": false,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "similarity",
        "type": "hidden",
        "label": "最低相关性",
        "value": 0.4,
        "valueType": "number",
        "min": 0,
        "max": 1,
        "step": 0.01,
        "markList": [
          {
            "label": "0",
            "value": 0
          },
          {
            "label": "1",
            "value": 1
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "limit",
        "type": "hidden",
        "label": "引用上限",
        "description": "单次搜索最大的 Tokens 数量,中文约1字=1.7Tokens,英文约1字=1Tokens",
        "value": 1500,
        "valueType": "number",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "searchMode",
        "type": "hidden",
        "label": "",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "embedding",
        "connected": false
      },
      {
        "key": "usingReRank",
        "type": "hidden",
        "label": "",
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": false,
        "connected": false
      },
      {
        "key": "datasetParamsModal",
        "type": "selectDatasetParamsModal",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "isEmpty",
        "label": "搜索结果为空",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "unEmpty",
        "label": "搜索结果不为空",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "quoteQA",
        "label": "引用内容",
        "description": "始终返回数组,如果希望搜索结果为空时执行额外操作,需要用到上面的两个输入以及目标模块的触发器",
        "type": "source",
        "valueType": "datasetQuote",
        "targets": [
          {
            "moduleId": "chatModule",
            "key": "quoteQA"
          }
        ]
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "chatModule",
    "name": "AI 对话",
    "avatar": "/imgs/module/AI.png",
    "flowType": "chatNode",
    "showStatus": true,
    "position": {
      "x": 2022.7264786978908,
      "y": 1006.3102431257475
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectChatModel",
        "label": "对话模型",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-16k",
        "connected": false
      },
      {
        "key": "temperature",
        "type": "hidden",
        "label": "温度",
        "value": 0,
        "valueType": "number",
        "min": 0,
        "max": 10,
        "step": 1,
        "markList": [
          {
            "label": "严谨",
            "value": 0
          },
          {
            "label": "发散",
            "value": 10
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "maxToken",
        "type": "hidden",
        "label": "回复上限",
        "value": 8000,
        "valueType": "number",
        "min": 100,
        "max": 4000,
        "step": 50,
        "markList": [
          {
            "label": "100",
            "value": 100
          },
          {
            "label": "4000",
            "value": 4000
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "isResponseAnswerText",
        "type": "hidden",
        "label": "返回AI内容",
        "value": true,
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "quoteTemplate",
        "type": "hidden",
        "label": "引用内容模板",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "quotePrompt",
        "type": "hidden",
        "label": "引用内容提示词",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "aiSettings",
        "type": "aiSettings",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "系统提示词",
        "max": 300,
        "valueType": "string",
        "description": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
        "placeholder": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "value": "你是个知识百科,什么问题都可以回答。",
        "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": "quoteQA",
        "type": "target",
        "label": "引用内容",
        "description": "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
        "valueType": "datasetQuote",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "answerText",
        "label": "AI回复内容",
        "description": "将在 stream 回复完毕后触发",
        "valueType": "string",
        "type": "source",
        "targets": []
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "history",
        "label": "新的上下文",
        "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
        "valueType": "chatHistory",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "vuc92c",
    "name": "core.module.template.cfr",
    "avatar": "/imgs/module/cfr.svg",
    "flowType": "cfr",
    "showStatus": true,
    "position": {
      "x": 758.2985382279098,
      "y": 1124.6527309337314
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectExtractModel",
        "label": "core.module.input.label.aiModel",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-1106",
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "core.module.input.label.cfr background",
        "max": 300,
        "valueType": "string",
        "description": "core.app.edit.cfr background tip",
        "placeholder": "core.module.input.placeholder.cfr background",
        "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": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "system_text",
        "label": "core.module.output.label.cfr result",
        "valueType": "string",
        "type": "source",
        "targets": [
          {
            "moduleId": "datasetSearch",
            "key": "userChatInput"
          }
        ]
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  }
]

userChatInput 为空

lolocoo avatar Jan 15 '24 09:01 lolocoo

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Encountered the same problem

[
  {
    "moduleId": "userGuide",
    "name": "User Guide",
    "avatar": "/imgs/module/userGuide.png",
    "flowType": "userGuide",
    "position": {
      "x": 447.98520778293346,
      "y": 721.4016845336229
    },
    "inputs": [
      {
        "key": "welcomeText",
        "type": "hidden",
        "valueType": "string",
        "label": "Opening Statement",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "Hello, I am the knowledge base assistant, please don't forget to select the knowledge base~\n[Who are you]\n[How to use]",
        "connected": false
      },
      {
        "key": "variables",
        "type": "hidden",
        "valueType": "any",
        "label": "Dialog variable",
        "value": [],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "questionGuide",
        "valueType": "boolean",
        "type": "switch",
        "label": "Question guidance",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": false,
        "connected": false
      },
      {
        "key": "tts",
        "type": "hidden",
        "valueType": "any",
        "label": "Voice broadcast",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": {
          "type": "web"
        },
        "connected": false
      }
    ],
    "outputs": []
  },
  {
    "moduleId": "userChatInput",
    "name": "User question (dialogue entry)",
    "avatar": "/imgs/module/userChatInput.png",
    "flowType": "questionInput",
    "position": {
      "x": 324.81436595478294,
      "y": 1527.0012457753612
    },
    "inputs": [
      {
        "key": "userChatInput",
        "type": "systemInput",
        "valueType": "string",
        "label": "User Question",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      }
    ],
    "outputs": [
      {
        "key": "userChatInput",
        "label": "User Question",
        "type": "source",
        "valueType": "string",
        "targets": [
          {
            "moduleId": "vuc92c",
            "key": "userChatInput"
          },
          {
            "moduleId": "chatModule",
            "key": "userChatInput"
          }
        ]
      }
    ]
  },
  {
    "moduleId": "datasetSearch",
    "name": "Knowledge Base Search",
    "avatar": "/imgs/module/db.png",
    "flowType": "datasetSearchNode",
    "showStatus": true,
    "position": {
      "x": 1351.5043753345153,
      "y": 947.0780385418003
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "datasets",
        "type": "selectDataset",
        "label": "Associated knowledge base",
        "value": [],
        "valueType": "selectDataset",
        "list": [],
        "required": true,
        "showTargetInApp": false,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "similarity",
        "type": "hidden",
        "label": "minimum relevance",
        "value": 0.4,
        "valueType": "number",
        "min": 0,
        "max": 1,
        "step": 0.01,
        "markList": [
          {
            "label": "0",
            "value": 0
          },
          {
            "label": "1",
            "value": 1
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "limit",
        "type": "hidden",
        "label": "Quote upper limit",
        "description": "The maximum number of Tokens in a single search, about 1 Chinese character = 1.7 Tokens, about 1 English character = 1 Tokens",
        "value": 1500,
        "valueType": "number",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "searchMode",
        "type": "hidden",
        "label": "",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "embedding",
        "connected": false
      },
      {
        "key": "usingReRank",
        "type": "hidden",
        "label": "",
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": false,
        "connected": false
      },
      {
        "key": "datasetParamsModal",
        "type": "selectDatasetParamsModal",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "isEmpty",
        "label": "Search results are empty",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "unEmpty",
        "label": "Search results are not empty",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "quoteQA",
        "label": "Quoted content",
        "description": "Always return an array. If you want to perform additional operations when the search result is empty, you need to use the above two inputs and the trigger of the target module",
        "type": "source",
        "valueType": "datasetQuote",
        "targets": [
          {
            "moduleId": "chatModule",
            "key": "quoteQA"
          }
        ]
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "chatModule",
    "name": "AI dialogue",
    "avatar": "/imgs/module/AI.png",
    "flowType": "chatNode",
    "showStatus": true,
    "position": {
      "x": 2022.7264786978908,
      "y": 1006.3102431257475
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectChatModel",
        "label": "dialogue model",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-16k",
        "connected": false
      },
      {
        "key": "temperature",
        "type": "hidden",
        "label": "temperature",
        "value": 0,
        "valueType": "number",
        "min": 0,
        "max": 10,
        "step": 1,
        "markList": [
          {
            "label": "rigorous",
            "value": 0
          },
          {
            "label": "divergent",
            "value": 10
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "maxToken",
        "type": "hidden",
        "label": "Reply limit",
        "value": 8000,
        "valueType": "number",
        "min": 100,
        "max": 4000,
        "step": 50,
        "markList": [
          {
            "label": "100",
            "value": 100
          },
          {
            "label": "4000",
            "value": 4000
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "isResponseAnswerText",
        "type": "hidden",
        "label": "Return AI content",
        "value": true,
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "quoteTemplate",
        "type": "hidden",
        "label": "Quote content template",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "quotePrompt",
        "type": "hidden",
        "label": "Quote content prompt words",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "aiSettings",
        "type": "aiSettings",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "System prompt word",
        "max": 300,
        "valueType": "string",
        "description": "The guide word fixed by the model. By adjusting the content, you can guide the model chat direction. The content will be fixed at the beginning of the context. Variables can be used, such as {{language}}",
        "placeholder": "The guide word fixed by the model. By adjusting the content, you can guide the model chat direction. The content will be fixed at the beginning of the context. Variables can be used, such as {{language}}",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "value": "You are an encyclopedia of knowledge and can answer any question.",
        "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": "quoteQA",
        "type": "target",
        "label": "Quoted content",
        "description": "Object array format, structure:\n [{q:'question',a:'answer'}]",
        "valueType": "datasetQuote",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "answerText",
        "label": "AI reply content",
        "description": "Will be triggered after the stream has finished replying",
        "valueType": "string",
        "type": "source",
        "targets": []
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "history",
        "label": "New context",
        "description": "Splice the content of this reply with the historical record and return it as a new context",
        "valueType": "chatHistory",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "vuc92c",
    "name": "core.module.template.cfr",
    "avatar": "/imgs/module/cfr.svg",
    "flowType": "cfr",
    "showStatus": true,
    "position": {
      "x": 758.2985382279098,
      "y": 1124.6527309337314
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectExtractModel",
        "label": "core.module.input.label.aiModel",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-1106",
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "core.module.input.label.cfr background",
        "max": 300,
        "valueType": "string",
        "description": "core.app.edit.cfr background tip",
        "placeholder": "core.module.input.placeholder.cfr background",
        "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": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "system_text",
        "label": "core.module.output.label.cfr result",
        "valueType": "string",
        "type": "source",
        "targets": [
          {
            "moduleId": "datasetSearch",
            "key": "userChatInput"
          }
        ]
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  }
]

userChatInput is empty

c121914yu avatar Jan 15 '24 09:01 c121914yu

大概率是用了其他模型,又没改补全模型,导致补全结果为空。

c121914yu avatar Jan 17 '24 02:01 c121914yu

遇到同样的问题

[
  {
    "moduleId": "userGuide",
    "name": "用户引导",
    "avatar": "/imgs/module/userGuide.png",
    "flowType": "userGuide",
    "position": {
      "x": 447.98520778293346,
      "y": 721.4016845336229
    },
    "inputs": [
      {
        "key": "welcomeText",
        "type": "hidden",
        "valueType": "string",
        "label": "开场白",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "你好,我是知识库助手,请不要忘记选择知识库噢~\n[你是谁]\n[如何使用]",
        "connected": false
      },
      {
        "key": "variables",
        "type": "hidden",
        "valueType": "any",
        "label": "对话框变量",
        "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": []
  },
  {
    "moduleId": "userChatInput",
    "name": "用户问题(对话入口)",
    "avatar": "/imgs/module/userChatInput.png",
    "flowType": "questionInput",
    "position": {
      "x": 324.81436595478294,
      "y": 1527.0012457753612
    },
    "inputs": [
      {
        "key": "userChatInput",
        "type": "systemInput",
        "valueType": "string",
        "label": "用户问题",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      }
    ],
    "outputs": [
      {
        "key": "userChatInput",
        "label": "用户问题",
        "type": "source",
        "valueType": "string",
        "targets": [
          {
            "moduleId": "vuc92c",
            "key": "userChatInput"
          },
          {
            "moduleId": "chatModule",
            "key": "userChatInput"
          }
        ]
      }
    ]
  },
  {
    "moduleId": "datasetSearch",
    "name": "知识库搜索",
    "avatar": "/imgs/module/db.png",
    "flowType": "datasetSearchNode",
    "showStatus": true,
    "position": {
      "x": 1351.5043753345153,
      "y": 947.0780385418003
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "datasets",
        "type": "selectDataset",
        "label": "关联的知识库",
        "value": [],
        "valueType": "selectDataset",
        "list": [],
        "required": true,
        "showTargetInApp": false,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "similarity",
        "type": "hidden",
        "label": "最低相关性",
        "value": 0.4,
        "valueType": "number",
        "min": 0,
        "max": 1,
        "step": 0.01,
        "markList": [
          {
            "label": "0",
            "value": 0
          },
          {
            "label": "1",
            "value": 1
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "limit",
        "type": "hidden",
        "label": "引用上限",
        "description": "单次搜索最大的 Tokens 数量,中文约1字=1.7Tokens,英文约1字=1Tokens",
        "value": 1500,
        "valueType": "number",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "searchMode",
        "type": "hidden",
        "label": "",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "embedding",
        "connected": false
      },
      {
        "key": "usingReRank",
        "type": "hidden",
        "label": "",
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": false,
        "connected": false
      },
      {
        "key": "datasetParamsModal",
        "type": "selectDatasetParamsModal",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "isEmpty",
        "label": "搜索结果为空",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "unEmpty",
        "label": "搜索结果不为空",
        "type": "source",
        "valueType": "boolean",
        "targets": []
      },
      {
        "key": "quoteQA",
        "label": "引用内容",
        "description": "始终返回数组,如果希望搜索结果为空时执行额外操作,需要用到上面的两个输入以及目标模块的触发器",
        "type": "source",
        "valueType": "datasetQuote",
        "targets": [
          {
            "moduleId": "chatModule",
            "key": "quoteQA"
          }
        ]
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "chatModule",
    "name": "AI 对话",
    "avatar": "/imgs/module/AI.png",
    "flowType": "chatNode",
    "showStatus": true,
    "position": {
      "x": 2022.7264786978908,
      "y": 1006.3102431257475
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectChatModel",
        "label": "对话模型",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-16k",
        "connected": false
      },
      {
        "key": "temperature",
        "type": "hidden",
        "label": "温度",
        "value": 0,
        "valueType": "number",
        "min": 0,
        "max": 10,
        "step": 1,
        "markList": [
          {
            "label": "严谨",
            "value": 0
          },
          {
            "label": "发散",
            "value": 10
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "maxToken",
        "type": "hidden",
        "label": "回复上限",
        "value": 8000,
        "valueType": "number",
        "min": 100,
        "max": 4000,
        "step": 50,
        "markList": [
          {
            "label": "100",
            "value": 100
          },
          {
            "label": "4000",
            "value": 4000
          }
        ],
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "isResponseAnswerText",
        "type": "hidden",
        "label": "返回AI内容",
        "value": true,
        "valueType": "boolean",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "quoteTemplate",
        "type": "hidden",
        "label": "引用内容模板",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "quotePrompt",
        "type": "hidden",
        "label": "引用内容提示词",
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "",
        "connected": false
      },
      {
        "key": "aiSettings",
        "type": "aiSettings",
        "label": "",
        "valueType": "any",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "系统提示词",
        "max": 300,
        "valueType": "string",
        "description": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
        "placeholder": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "value": "你是个知识百科,什么问题都可以回答。",
        "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": "quoteQA",
        "type": "target",
        "label": "引用内容",
        "description": "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
        "valueType": "datasetQuote",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      },
      {
        "key": "userChatInput",
        "type": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "answerText",
        "label": "AI回复内容",
        "description": "将在 stream 回复完毕后触发",
        "valueType": "string",
        "type": "source",
        "targets": []
      },
      {
        "key": "finish",
        "label": "core.module.output.label.running done",
        "description": "core.module.output.description.running done",
        "valueType": "boolean",
        "type": "source",
        "targets": []
      },
      {
        "key": "history",
        "label": "新的上下文",
        "description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
        "valueType": "chatHistory",
        "type": "source",
        "targets": []
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  },
  {
    "moduleId": "vuc92c",
    "name": "core.module.template.cfr",
    "avatar": "/imgs/module/cfr.svg",
    "flowType": "cfr",
    "showStatus": true,
    "position": {
      "x": 758.2985382279098,
      "y": 1124.6527309337314
    },
    "inputs": [
      {
        "key": "switch",
        "type": "target",
        "label": "core.module.input.label.switch",
        "valueType": "any",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": false
      },
      {
        "key": "model",
        "type": "selectExtractModel",
        "label": "core.module.input.label.aiModel",
        "required": true,
        "valueType": "string",
        "showTargetInApp": false,
        "showTargetInPlugin": false,
        "value": "gpt-3.5-turbo-1106",
        "connected": false
      },
      {
        "key": "systemPrompt",
        "type": "textarea",
        "label": "core.module.input.label.cfr background",
        "max": 300,
        "valueType": "string",
        "description": "core.app.edit.cfr background tip",
        "placeholder": "core.module.input.placeholder.cfr background",
        "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": "hidden",
        "label": "core.module.input.label.user question",
        "required": true,
        "valueType": "string",
        "showTargetInApp": true,
        "showTargetInPlugin": true,
        "connected": true
      }
    ],
    "outputs": [
      {
        "key": "system_text",
        "label": "core.module.output.label.cfr result",
        "valueType": "string",
        "type": "source",
        "targets": [
          {
            "moduleId": "datasetSearch",
            "key": "userChatInput"
          }
        ]
      },
      {
        "key": "userChatInput",
        "label": "core.module.input.label.user question",
        "type": "hidden",
        "valueType": "string",
        "targets": []
      }
    ]
  }
]

userChatInput 为空

这个我也能可以正常运行

c121914yu avatar Jan 17 '24 02:01 c121914yu

经过测试,发现应该是 max_tokens 太小导致,目前的配置是150 token,当上下文长度较大时就会导致该问题。但是我不知道在哪里修改问题补全的 max_tokens。

a245589351 avatar Jan 21 '24 08:01 a245589351

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After testing, it was found that max_tokens is too small. The current configuration is 150 tokens. This problem will occur when the context length is large. But I don't know where to modify max_tokens for problem completion.

c121914yu avatar Jan 21 '24 08:01 c121914yu

我也遇到同样的问题。

dockersky avatar Jan 24 '24 09:01 dockersky

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I also encountered the same problem.

c121914yu avatar Jan 24 '24 09:01 c121914yu