From 537747951a5690d51c80e3edc6ec7e904dbc92a4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 26 Jan 2024 09:56:36 -0300 Subject: [PATCH] Fix return value for power components in Vertex class --- src/backend/langflow/graph/vertex/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/langflow/graph/vertex/base.py b/src/backend/langflow/graph/vertex/base.py index 64767577f..024017b2e 100644 --- a/src/backend/langflow/graph/vertex/base.py +++ b/src/backend/langflow/graph/vertex/base.py @@ -80,6 +80,13 @@ class Vertex: # If the Vertex.type is a power component # then we need to return the built object # instead of the result dict + if self.is_power_component and not isinstance(self._built_object, UnbuiltObject): + result = self._built_object + # if it is not a dict or a string and hasattr model_dump then + # return the model_dump + if not isinstance(result, (dict, str)) and hasattr(result, "content"): + return result.content + return result if isinstance(self._built_result, UnbuiltResult): return {}