From 99803c53f7ebc9fa29c80bc9def3d8cd0585e5a7 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 27 Feb 2024 15:30:47 -0300 Subject: [PATCH] Add run_id to VerticesOrderResponse --- src/backend/langflow/api/v1/chat.py | 4 +++- src/backend/langflow/api/v1/schemas.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index ca067ce6f..7f85bb211 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -1,5 +1,6 @@ import time from typing import Optional +import uuid from fastapi import ( APIRouter, @@ -120,7 +121,8 @@ async def get_vertices( # Now vertices is a list of lists # We need to get the id of each vertex # and return the same structure but only with the ids - return VerticesOrderResponse(ids=vertices) + run_id = uuid.uuid4() + return VerticesOrderResponse(ids=vertices, run_id=run_id) except Exception as exc: logger.error(f"Error checking build status: {exc}") diff --git a/src/backend/langflow/api/v1/schemas.py b/src/backend/langflow/api/v1/schemas.py index 38db8f85a..0c33fdb36 100644 --- a/src/backend/langflow/api/v1/schemas.py +++ b/src/backend/langflow/api/v1/schemas.py @@ -225,6 +225,7 @@ class ApiKeyCreateRequest(BaseModel): class VerticesOrderResponse(BaseModel): ids: List[List[str]] + run_id: UUID class ResultDataResponse(BaseModel):