From 2cac7b472f87759050d2278e5c30d262d512803e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 21 Jun 2024 21:59:51 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(chat.py):=20Call=20'initialize?= =?UTF-8?q?=5Frun()'=20method=20on=20the=20'graph'=20object=20after=20retr?= =?UTF-8?q?ieving=20it=20from=20cache=20to=20ensure=20proper=20initializat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/base/langflow/api/v1/chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/api/v1/chat.py b/src/backend/base/langflow/api/v1/chat.py index a641f0c4e..32b59f151 100644 --- a/src/backend/base/langflow/api/v1/chat.py +++ b/src/backend/base/langflow/api/v1/chat.py @@ -25,6 +25,7 @@ from langflow.api.v1.schemas import ( VerticesOrderResponse, ) from langflow.exceptions.component import ComponentBuildException +from langflow.graph.graph.base import Graph from langflow.schema.schema import OutputLog from langflow.services.auth.utils import get_current_active_user from langflow.services.chat.service import ChatService @@ -161,7 +162,8 @@ async def build_vertex( flow_id=flow_id_str, session=next(get_session()), chat_service=chat_service ) else: - graph = cache.get("result") + graph: "Graph" = cache.get("result") + await graph.initialize_run() vertex = graph.get_vertex(vertex_id) try: