From daccda76faf3c8035b3507c0809d141ebbef41f2 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 30 Mar 2024 18:19:38 -0300 Subject: [PATCH] Remove unused method _validate_vertices() in Graph class --- src/backend/base/langflow/graph/graph/base.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/backend/base/langflow/graph/graph/base.py b/src/backend/base/langflow/graph/graph/base.py index 845062237..909acfa2e 100644 --- a/src/backend/base/langflow/graph/graph/base.py +++ b/src/backend/base/langflow/graph/graph/base.py @@ -603,8 +603,7 @@ class Graph: # This is a hack to make sure that the LLM vertex is sent to # the toolkit vertex self._build_vertex_params() - # remove invalid vertices - self._validate_vertices() + # Now that we have the vertices and edges # We need to map the vertices that are connected to # to ChatVertex instances @@ -631,14 +630,6 @@ class Graph: if isinstance(vertex, ToolkitVertex): vertex.params["llm"] = llm_vertex - def _validate_vertices(self) -> None: - """Check that all vertices have edges""" - if len(self.vertices) == 1: - return - for vertex in self.vertices: - if not self._validate_vertex(vertex): - raise ValueError(f"{vertex.display_name} is not connected to any other components") - def _validate_vertex(self, vertex: Vertex) -> bool: """Validates a vertex.""" # All vertices that do not have edges are invalid