From 3cba1380dea37c6c7284653c6fb1861007c03189 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 20 Jun 2024 17:59:39 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(chat.py):=20fix=20issue=20where?= =?UTF-8?q?=20end=5Fall=5Ftraces=20method=20was=20not=20being=20called=20c?= =?UTF-8?q?orrectly=20with=20the=20required=20arguments=20=F0=9F=92=A1=20(?= =?UTF-8?q?chat.py):=20improve=20error=20handling=20by=20passing=20error?= =?UTF-8?q?=20message=20to=20end=5Fall=5Ftraces=20method=20and=20ensure=20?= =?UTF-8?q?it=20is=20called=20with=20the=20correct=20arguments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/base/langflow/api/v1/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/api/v1/chat.py b/src/backend/base/langflow/api/v1/chat.py index 3f92b8a9a..38c9ed8cc 100644 --- a/src/backend/base/langflow/api/v1/chat.py +++ b/src/backend/base/langflow/api/v1/chat.py @@ -202,7 +202,7 @@ async def build_vertex( logs = {output_label: Log(message=message, type="error")} result_data_response = ResultDataResponse(results={}, logs=logs) artifacts = {} - graph.end_all_traces(outputs=message) + background_tasks.add_task(graph.end_all_traces, error=message["errorMessage"]) # If there's an error building the vertex # we need to clear the cache await chat_service.clear_cache(flow_id_str) @@ -240,7 +240,7 @@ async def build_vertex( next_runnable_vertices = [graph.stop_vertex] if not next_runnable_vertices: - graph.end_all_traces() + background_tasks.add_task(graph.end_all_traces) build_response = VertexBuildResponse( inactivated_vertices=inactivated_vertices,