流式响应#
¥Streaming responses
流式响应允许你在 AI Agent 节点生成数据时将其发送回用户。这对于聊天机器人非常有用,因为你希望在生成答案的同时将其显示给用户,从而提供更好的用户体验。
¥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:
¥The Chat Trigger
¥The Webhook node
在这两种情况下,都将节点的响应模式设置为“流式”。
¥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.
- 选择支持流式传输的节点,例如:
¥Choose a node that supports streaming, such as:
-
¥Respond to Webhook 2. 你可以在这些节点的选项中禁用流式传输。默认情况下,当执行的触发器的
Response Mode设置为Streaming response时,它们会流式传输数据。
¥You can disable streaming in the options of these nodes. By default, they stream data whenever the executed trigger has its Response Mode set to Streaming response.
重要信息#
¥Important information
配置流式响应时,请注意以下细节:
¥Keep in mind the following details when configuring streaming responses:
- 触发器:你的触发节点必须支持流式传输并已配置流式传输。如果没有此设置,工作流将根据你的响应模式设置运行。
¥Trigger: Your trigger node must support streaming and have streaming configured. Without this, the workflow behaves according to your response mode settings.
- 节点配置:即使触发器启用了流式传输,你也至少需要配置一个节点来传输数据。否则,你的工作流将不会发送任何数据。
¥Node configuration: Even with streaming enabled on the trigger, you need at least one node configured to stream data. Otherwise, your workflow will send no data.