流式响应(Streaming responses)#
功能可用性
所有套餐均可使用。
流式响应允许你在 AI 代理节点生成数据时将其发送回用户。这对聊天机器人非常有用,因为你希望在生成答案的同时显示给用户,以提供更好的用户体验。
🌐 Streaming responses let you send data back to users as an AI Agent node generates it. This is useful for chatbots, where you want to show the user the answer as it's generated to provide a better user experience.
你可以使用以下任一方式启用流式传输:
🌐 You can enable streaming using either:
- 聊天触发器
- Webhook 节点
在两种情况下,都将节点的 响应模式 设置为 流式。
🌐 In both cases, set the node's Response Mode to Streaming.
配置用于流式传输的节点(Configure nodes for streaming)#
要进行数据流传输,你需要在工作流中添加支持流输出的节点。并非所有节点都支持此功能。
🌐 To stream data, you need to add nodes to the workflow that support streaming output. Not all nodes support this feature.
- 选择支持流式传输的节点,例如:
- 你可以在这些节点的选项中禁用流式传输。默认情况下,只要执行的触发器其
Response Mode设置为Streaming response,它们就会传输数据。
重要信息(Important information)#
配置流式响应时,请注意以下细节:
🌐 Keep in mind the following details when configuring streaming responses:
- 触发器:你的触发节点必须支持流式传输并已配置流式传输。否则,工作流将根据你的响应模式设置进行操作。
- 节点配置:即使在触发器上启用了流式传输,你仍然需要至少配置一个节点来流式传输数据。否则,你的工作流将不会发送任何数据。