From 11ac89adf243ee21f68c1258565a6c14f673ba71 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 14 Apr 2025 18:59:23 -0300 Subject: [PATCH] fix: update build_flow_and_stream with event delivery info (#7616) refactor: Update event delivery mechanism in build_flow_and_stream function Modified the build_flow_and_stream function to utilize the new event delivery type, STREAMING, for improved event handling. The function now returns a response from get_flow_events_response, enhancing the clarity and robustness of the event streaming process. Co-authored-by: Cristhian Zanforlin Lousa --- src/backend/base/langflow/api/v1/chat.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/api/v1/chat.py b/src/backend/base/langflow/api/v1/chat.py index 7bd8072ca..2c9c7346f 100644 --- a/src/backend/base/langflow/api/v1/chat.py +++ b/src/backend/base/langflow/api/v1/chat.py @@ -548,9 +548,14 @@ async def build_flow_and_stream(flow_id, inputs, background_tasks, current_user) background_tasks=background_tasks, current_user=current_user, queue_service=queue_service, + event_delivery=EventDeliveryType.STREAMING, ) job_id = build_response["job_id"] - return await get_build_events(job_id, queue_service) + return await get_flow_events_response( + job_id=job_id, + queue_service=queue_service, + event_delivery=EventDeliveryType.STREAMING, + ) @router.post("/build_public_tmp/{flow_id}/flow")