Agent Flow with Streaming Enabled #6839
Replies: 10 comments 6 replies
-
|
Agents are able to stream responses when running an Agentic flow via API with the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
|
Here is my api response {"event": "add_message", "data": {"timestamp": "2025-02-26T11:35:33", "sender": "User", "sender_name": "User", "session_id": "postman_session", "text": "yes", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "e8a5ac64-cb3e-47c6-a6a1-0becb9b10e6e", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}} {"event": "add_message", "data": {"timestamp": "2025-02-26T11:35:35", "sender": "Machine", "sender_name": "Agent", "session_id": "postman_session", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": null, "background_color": null, "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "Bot", "allow_markdown": false, "positive_feedback": null, "state": "partial", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}} {"event": "add_message", "data": {"timestamp": "2025-02-26T11:35:35", "sender": "Machine", "sender_name": "Agent", "session_id": "postman_session", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": null, "background_color": null, "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "Bot", "allow_markdown": false, "positive_feedback": null, "state": "partial", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}} {"event": "add_message", "data": {"timestamp": "2025-02-26T11:35:35", "sender": "Machine", "sender_name": "Agent", "session_id": "postman_session", "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "files": [], "error": false, "edit": false, "properties": {"text_color": null, "background_color": null, "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "Bot", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}, {"type": "text", "duration": 1415, "header": {"title": "Output", "icon": "MessageSquare"}, "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website."}], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}} {"event": "add_message", "data": {"timestamp": "2025-02-26T11:35:35", "sender": "Machine", "sender_name": "AI", "session_id": "postman_session", "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "Agent-NtV7i", "display_name": "Agent", "source": "gpt-4o-mini"}, "icon": "bot", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}, {"type": "text", "duration": 1415, "header": {"title": "Output", "icon": "MessageSquare"}, "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website."}], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}} {"event": "end", "data": {"result": {"session_id": "postman_session", "outputs": [{"inputs": {"input_value": "yes"}, "outputs": [{"results": {"message": {"text_key": "text", "data": {"timestamp": "2025-02-26T11:35:35+00:00", "sender": "Machine", "sender_name": "AI", "session_id": "postman_session", "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "Agent-NtV7i", "display_name": "Agent", "source": "gpt-4o-mini"}, "icon": "bot", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}, {"type": "text", "duration": 1415, "header": {"title": "Output", "icon": "MessageSquare"}, "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website."}], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}, "default_value": "", "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "sender": "Machine", "sender_name": "AI", "files": [], "session_id": "postman_session", "timestamp": "2025-02-26T11:35:35+00:00", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b", "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "Agent-NtV7i", "display_name": "Agent", "source": "gpt-4o-mini"}, "icon": "bot", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}, {"type": "text", "duration": 1415, "header": {"title": "Output", "icon": "MessageSquare"}, "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website."}], "allow_markdown": true, "media_url": null}]}}, "artifacts": {"message": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "sender": "Machine", "sender_name": "AI", "files": [], "type": "object"}, "outputs": {"message": {"message": {"timestamp": "2025-02-26T11:35:35", "sender": "Machine", "sender_name": "AI", "session_id": "postman_session", "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "Agent-NtV7i", "display_name": "Agent", "source": "gpt-4o-mini"}, "icon": "bot", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [{"title": "Agent Steps", "contents": [{"type": "text", "duration": 14, "header": {"title": "Input", "icon": "MessageSquare"}, "text": "Input: yes"}, {"type": "text", "duration": 1415, "header": {"title": "Output", "icon": "MessageSquare"}, "text": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website."}], "allow_markdown": true, "media_url": null}], "id": "2032628b-d731-493d-a7f6-d74a31d8044d", "flow_id": "5240c000-adc9-44dc-9013-be0775235a0b"}, "type": "message"}}, "logs": {"message": []}, "messages": [{"message": "It seems like you might have a question or need assistance. How can I help you today? If you're looking for information on available subsidies, please provide the company name along with its location or website.", "sender": "Machine", "sender_name": "AI", "session_id": "postman_session", "stream_url": null, "component_id": "ChatOutput-JJLGY", "files": [], "type": "message"}], "timedelta": null, "duration": null, "component_display_name": "Chat Output", "component_id": "ChatOutput-JJLGY", "used_frozen_result": false}]}]}}} I dont see the token event which does not allow me to stream responses in real time. My Flow is using Langflow agent with chat input and output. The Agent uses other Agents as tool. |
Beta Was this translation helpful? Give feedback.
-
|
Does this Component - https://docs.langflow.org/components-agents#agent-component |
Beta Was this translation helpful? Give feedback.
-
|
The Agent Component has no attribute/parameter stream. |
Beta Was this translation helpful? Give feedback.
-
|
I have confirmed that the UI of langflow has not parameters called stream for Agent component. |
Beta Was this translation helpful? Give feedback.
-
|
The Agent type node does not have stream parameter. You are reffering to LLM Models, and they have stream attribute. "base_classes": [ |
Beta Was this translation helpful? Give feedback.
-
|
This is the class of the Agent Component. from langchain_core.tools import StructuredTool from langflow.base.agents.agent import LCToolsAgentComponent def set_advanced_true(component_input): class AgentComponent(ToolCallingAgentComponent): There is no paramter stream to enable streaming of responses. |
Beta Was this translation helpful? Give feedback.
-
|
Can you check my above comment? |
Beta Was this translation helpful? Give feedback.
-
|
@raprajapati1208 hi, i meet the same question. Have you solved the problem? |
Beta Was this translation helpful? Give feedback.
-
|
Also having same problem. Only getting |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am running an Agentic flow via API with stream=true paramter. However the results are not streaming. It never returns the token events. Are agents not able to stream responses?
Regards,
Ranjan
Beta Was this translation helpful? Give feedback.
All reactions