From 7c93b248450be482aa138cdf47bcbb6f4ec5ea4e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 20 Feb 2024 10:03:24 -0300 Subject: [PATCH] Refactor error handling in get_vertices function --- src/backend/langflow/api/v1/chat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index 886eabf59..c3d560cc3 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -305,9 +305,10 @@ async def get_vertices( except Exception as exc: logger.error(f"IN DEVELOPMENT: Error getting vertices: {exc}") logger.exception(exc) - vertices = graph.layered_topological_sort() + vertices = graph.sort_vertices() else: - vertices = graph.layered_topological_sort() + vertices = graph.sort_vertices() + # Now vertices is a list of lists # We need to get the id of each vertex # and return the same structure but only with the ids