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 <gabriel@langflow.org>
This commit is contained in:
parent
67009190cd
commit
cf165953f1
2 changed files with 12 additions and 1 deletions
|
|
@ -568,6 +568,7 @@ async def build_public_tmp(
|
||||||
flow_name: str | None = None,
|
flow_name: str | None = None,
|
||||||
request: Request,
|
request: Request,
|
||||||
queue_service: Annotated[JobQueueService, Depends(get_queue_service)],
|
queue_service: Annotated[JobQueueService, Depends(get_queue_service)],
|
||||||
|
event_delivery: EventDeliveryType = EventDeliveryType.POLLING,
|
||||||
):
|
):
|
||||||
"""Build a public flow without requiring authentication.
|
"""Build a public flow without requiring authentication.
|
||||||
|
|
||||||
|
|
@ -595,6 +596,7 @@ async def build_public_tmp(
|
||||||
flow_name: Optional name for the flow
|
flow_name: Optional name for the flow
|
||||||
request: FastAPI request object (needed for cookie access)
|
request: FastAPI request object (needed for cookie access)
|
||||||
queue_service: Queue service for job management
|
queue_service: Queue service for job management
|
||||||
|
event_delivery: Optional event delivery type - default is streaming
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dict with job_id that can be used to poll for build status
|
Dict with job_id that can be used to poll for build status
|
||||||
|
|
@ -623,4 +625,10 @@ async def build_public_tmp(
|
||||||
if isinstance(exc, HTTPException):
|
if isinstance(exc, HTTPException):
|
||||||
raise
|
raise
|
||||||
raise HTTPException(status_code=500, detail=str(exc)) from exc
|
raise HTTPException(status_code=500, detail=str(exc)) from exc
|
||||||
|
if event_delivery != EventDeliveryType.DIRECT:
|
||||||
return {"job_id": job_id}
|
return {"job_id": job_id}
|
||||||
|
return await get_flow_events_response(
|
||||||
|
job_id=job_id,
|
||||||
|
queue_service=queue_service,
|
||||||
|
event_delivery=event_delivery,
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { useGetConfig } from "@/controllers/API/queries/config/use-get-config";
|
||||||
import { useGetFlow } from "@/controllers/API/queries/flows/use-get-flow";
|
import { useGetFlow } from "@/controllers/API/queries/flows/use-get-flow";
|
||||||
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
||||||
import { track } from "@/customization/utils/analytics";
|
import { track } from "@/customization/utils/analytics";
|
||||||
|
|
@ -11,6 +12,8 @@ import { v4 as uuid } from "uuid";
|
||||||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||||
import { getInputsAndOutputs } from "../../utils/storeUtils";
|
import { getInputsAndOutputs } from "../../utils/storeUtils";
|
||||||
export default function PlaygroundPage() {
|
export default function PlaygroundPage() {
|
||||||
|
|
||||||
|
useGetConfig();
|
||||||
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
|
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
|
||||||
const currentSavedFlow = useFlowsManagerStore((state) => state.currentFlow);
|
const currentSavedFlow = useFlowsManagerStore((state) => state.currentFlow);
|
||||||
const setClientId = useUtilityStore((state) => state.setClientId);
|
const setClientId = useUtilityStore((state) => state.setClientId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue