问答链节点通用信息问题(Question and Answer Chain node common issues)#
以下是 问答链节点 的一些常见错误和问题,以及解决或排查它们的步骤。
🌐 Here are some common errors and issues with the Question and Answer Chain node and steps to resolve or troubleshoot them.
未指定错误提示(No prompt specified error)#
当提示为空或无效时,会显示此错误。
🌐 This error displays when the Prompt is empty or invalid.
你可能会在以下两种情况下看到此错误:
🌐 You might see this in one of two scenarios:
- 当你将提示设置为在下面定义,并且你的文本中的表达式没有生成值时。
- 要解决此问题,请在 文本 字段中输入有效的提示。
- 确保所有表达式都引用有效字段,并且解析为有效输入而不是 null。
- 当你将 提示 设置为 连接的聊天触发节点 并且传入的数据包含空值时。
- 要解决此问题,请确保你的输入包含
chatInput字段。添加一个 编辑字段(设置) 节点,将传入的字段名称编辑为chatInput。 - 从输入节点的
chatInput字段中删除所有空值。
- 要解决此问题,请确保你的输入包含
检索器子节点未连接错误(A Retriever sub-node must be connected error)#
当 n8n 尝试在未连接检索器的情况下执行节点时,会显示此错误。
🌐 This error displays when n8n tries to execute the node without having a Retriever connected.
要解决此问题,当节点打开时,点击屏幕底部的 + Retriever 按钮;如果节点未打开,则点击 Retriever + 连接器。n8n 随后会打开一系列可供选择的 Retriever。
🌐 To resolve this, click the + Retriever button at the bottom of your screen when the node is open, or click the Retriever + connector when the node isn't open. n8n will then open a selection of possible Retrievers to pick from.
无法生成更长的响应(Can't produce longer responses)#
如果你需要生成比问答链节点默认生成的更长的响应,你可以尝试以下一种或多种方法:
🌐 If you need to generate longer responses than the Question and Answer Chain node produces by default, you can try one or more of the following techniques:
- 连接更详细的模型:某些 AI 模型生成的结果比其他模型更简洁。将你的模型更换为具有更大上下文窗口和更详细输出的模型,可以增加你回答的字数。
- 增加最大令牌数量:许多模型节点(例如 OpenAI 聊天模型)都包含一个 最大令牌数量 选项。你可以设置此选项以增加模型用于生成响应的最大令牌数量。
- 分阶段构建更长的回答:为了获得更详细的答案,你可以尝试使用多种 AI 节点分阶段构建回复。你可以将一个问题拆分成多个提示,并为每个提示创建回答。然后,你可以通过将这些回答再次组合来生成最终回复。虽然具体细节有所不同,但你可以在这个 使用 AI 撰写 WordPress 文章的模板 中找到这个总体思路的一个很好的示例。