From aadb4c7d87c19f54dbf85af73bc8407c10713ffc Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 20 Feb 2024 13:12:49 -0300 Subject: [PATCH] Add result attribute to Vertex class --- src/backend/langflow/graph/vertex/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/langflow/graph/vertex/base.py b/src/backend/langflow/graph/vertex/base.py index 341f6097a..01d182142 100644 --- a/src/backend/langflow/graph/vertex/base.py +++ b/src/backend/langflow/graph/vertex/base.py @@ -14,6 +14,7 @@ from langflow.utils.util import sync_to_async from loguru import logger if TYPE_CHECKING: + from langflow.api.v1.schemas import ResultDict from langflow.graph.edge.base import ContractEdge from langflow.graph.graph.base import Graph @@ -49,6 +50,7 @@ class Vertex: self.parent_is_top_level = False self.layer = None self.should_run = True + self.result: Optional["ResultDict"] = None try: self.is_interface_component = InterfaceComponentTypes(self.vertex_type) except ValueError: @@ -79,6 +81,9 @@ class Vertex: ) return edge_results + def set_result(self, result: "ResultDict") -> None: + self.result = result + def get_built_result(self): # If the Vertex.type is a power component # then we need to return the built object