Skip to content

Commit cf16595

Browse files
saber-wangautofix-ci[bot]ogabrielluiz
authored
fix: endpoint build_public_tmp now supports event delivery type direct (#7526)
* fix the issue where `build_public_tmp` does not support `EVENT_DELIVERY=direct` * fix: modify `build_public_tmp` to conform to the latest design * [autofix.ci] apply automated fixes * fix: Delete debugging logs * fix: Delete debugging logs * fix: Delete debugging logs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
1 parent 6700919 commit cf16595

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/backend/base/langflow/api/v1/chat.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ async def build_public_tmp(
568568
flow_name: str | None = None,
569569
request: Request,
570570
queue_service: Annotated[JobQueueService, Depends(get_queue_service)],
571+
event_delivery: EventDeliveryType = EventDeliveryType.POLLING,
571572
):
572573
"""Build a public flow without requiring authentication.
573574
@@ -595,6 +596,7 @@ async def build_public_tmp(
595596
flow_name: Optional name for the flow
596597
request: FastAPI request object (needed for cookie access)
597598
queue_service: Queue service for job management
599+
event_delivery: Optional event delivery type - default is streaming
598600
599601
Returns:
600602
Dict with job_id that can be used to poll for build status
@@ -623,4 +625,10 @@ async def build_public_tmp(
623625
if isinstance(exc, HTTPException):
624626
raise
625627
raise HTTPException(status_code=500, detail=str(exc)) from exc
626-
return {"job_id": job_id}
628+
if event_delivery != EventDeliveryType.DIRECT:
629+
return {"job_id": job_id}
630+
return await get_flow_events_response(
631+
job_id=job_id,
632+
queue_service=queue_service,
633+
event_delivery=event_delivery,
634+
)

src/frontend/src/pages/Playground/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useGetConfig } from "@/controllers/API/queries/config/use-get-config";
12
import { useGetFlow } from "@/controllers/API/queries/flows/use-get-flow";
23
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
34
import { track } from "@/customization/utils/analytics";
@@ -11,6 +12,8 @@ import { v4 as uuid } from "uuid";
1112
import useFlowsManagerStore from "../../stores/flowsManagerStore";
1213
import { getInputsAndOutputs } from "../../utils/storeUtils";
1314
export default function PlaygroundPage() {
15+
16+
useGetConfig();
1417
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
1518
const currentSavedFlow = useFlowsManagerStore((state) => state.currentFlow);
1619
const setClientId = useUtilityStore((state) => state.setClientId);

0 commit comments

Comments
 (0)