fix: vertex_type now comes directly from template.type_name

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-07 16:41:48 -03:00
commit 259b66bb00
2 changed files with 5 additions and 5 deletions

View file

@ -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:

View file

@ -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)