From 259b66bb004df0f0e87955ea57709bbfd8bd4767 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 7 Jun 2023 16:41:48 -0300 Subject: [PATCH] fix: vertex_type now comes directly from template.type_name --- src/backend/langflow/graph/vertex/base.py | 7 ++++--- src/backend/langflow/interface/loading.py | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/graph/vertex/base.py b/src/backend/langflow/graph/vertex/base.py index 04dadab85..0ea2e0779 100644 --- a/src/backend/langflow/graph/vertex/base.py +++ b/src/backend/langflow/graph/vertex/base.py @@ -48,9 +48,10 @@ class Vertex: ] template_dict = self.data["node"]["template"] - self.vertex_type = ( - self.data["type"] if "Tool" not in self.output else template_dict["_type"] - ) + # self.vertex_type = ( + # self.data["type"] if "Tool" not in self.output else template_dict["_type"] + # ) + self.vertex_type = template_dict["_type"] if self.base_type is None: for base_type, value in ALL_TYPES_DICT.items(): if self.vertex_type in value: diff --git a/src/backend/langflow/interface/loading.py b/src/backend/langflow/interface/loading.py index d0ec4b845..f8d26ffca 100644 --- a/src/backend/langflow/interface/loading.py +++ b/src/backend/langflow/interface/loading.py @@ -32,8 +32,7 @@ def instantiate_class(node_type: str, base_type: str, params: Dict) -> Any: params = convert_params_to_sets(params) params = convert_kwargs(params) if node_type in CUSTOM_AGENTS: - custom_agent = CUSTOM_AGENTS.get(node_type) - if custom_agent: + if custom_agent := CUSTOM_AGENTS.get(node_type): return custom_agent.initialize(**params) class_object = import_by_type(_type=base_type, name=node_type)