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 <cristhian.lousa@gmail.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-04-14 18:59:23 -03:00 committed by GitHub
commit 11ac89adf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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")