Add support for ChatVertex in _get_vertex_class() method
This commit is contained in:
parent
36ccba9b78
commit
5d7f00c5ad
1 changed files with 4 additions and 1 deletions
|
|
@ -240,10 +240,12 @@ class Graph:
|
||||||
def _get_vertex_class(self, node_type: str, node_base_type: str, node_id: str) -> Type[Vertex]:
|
def _get_vertex_class(self, node_type: str, node_base_type: str, node_id: str) -> Type[Vertex]:
|
||||||
"""Returns the node class based on the node type."""
|
"""Returns the node class based on the node type."""
|
||||||
# First we check for the node_base_type
|
# First we check for the node_base_type
|
||||||
|
node_name = node_id.split("-")[0]
|
||||||
|
if node_name in ["ChatOutput", "ChatInput"]:
|
||||||
|
return ChatVertex
|
||||||
if node_base_type in lazy_load_vertex_dict.VERTEX_TYPE_MAP:
|
if node_base_type in lazy_load_vertex_dict.VERTEX_TYPE_MAP:
|
||||||
return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_base_type]
|
return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_base_type]
|
||||||
|
|
||||||
node_name = node_id.split("-")[0]
|
|
||||||
if node_name in lazy_load_vertex_dict.VERTEX_TYPE_MAP:
|
if node_name in lazy_load_vertex_dict.VERTEX_TYPE_MAP:
|
||||||
return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_name]
|
return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_name]
|
||||||
|
|
||||||
|
|
@ -317,3 +319,4 @@ class Graph:
|
||||||
return layers
|
return layers
|
||||||
return layers
|
return layers
|
||||||
return layers
|
return layers
|
||||||
|
return layers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue