From 9770f672278605cc78a750672ba5ce05551a62b5 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 12 Dec 2023 13:28:49 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types/components/index.ts):?= =?UTF-8?q?=20add=20duration=20field=20to=20validationStatusType=20to=20ma?= =?UTF-8?q?tch=20the=20changes=20in=20chat.py=20=F0=9F=90=9B=20fix(chat.py?= =?UTF-8?q?):=20fix=20typo=20in=20variable=20name,=20change=20time=5Felapd?= =?UTF-8?q?ed=20to=20time=5Felapsed=20for=20consistency=20and=20readabilit?= =?UTF-8?q?y=20=F0=9F=90=9B=20fix(chat.py):=20remove=20redundant=20duratio?= =?UTF-8?q?n=20information=20from=20params=20field=20in=20response=20objec?= =?UTF-8?q?t=20=E2=9C=A8=20feat(chat.py):=20add=20duration=20field=20to=20?= =?UTF-8?q?response=20object=20to=20provide=20information=20about=20the=20?= =?UTF-8?q?time=20taken=20for=20the=20build=20process=20=F0=9F=90=9B=20fix?= =?UTF-8?q?(GenericNode/index.tsx):=20fix=20formatting=20issue=20in=20disp?= =?UTF-8?q?laying=20duration=20and=20params=20in=20GenericNode=20component?= =?UTF-8?q?=20=F0=9F=90=9B=20fix(GenericNode/index.tsx):=20fix=20type=20an?= =?UTF-8?q?notation=20for=20line=20variable=20in=20map=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/api/v1/chat.py | 6 +++--- src/frontend/src/CustomNodes/GenericNode/index.tsx | 4 ++-- src/frontend/src/types/components/index.ts | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index 61db84769..26765623a 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -160,7 +160,7 @@ async def stream_build( vertex = await try_running_celery_task(vertex, user_id) else: await vertex.build(user_id=user_id) - time_elapded = format_elapsed_time(time.perf_counter() - start_time) + time_elapsed = format_elapsed_time(time.perf_counter() - start_time) params = vertex._built_object_repr() valid = True @@ -181,10 +181,10 @@ async def stream_build( if vertex_id in graph.top_level_vertices: response = { "valid": valid, - "params": f"Duration: {time_elapded}\n{params}", + "params": params, "id": vertex_id, "progress": round(i / number_of_nodes, 2), - "duration": time_elapded, + "duration": time_elapsed, } yield str(StreamData(event="message", data=response)) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 032349cfd..eef1f64b9 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -317,9 +317,9 @@ export default function GenericNode({ ) : (
{typeof validationStatus.params === "string" - ? validationStatus.params + ? `Duration: ${validationStatus.duration}\n${validationStatus.params}` .split("\n") - .map((line: string, index: number) => ( + .map((line, index) => (
{line}
)) : ""} diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 739e69cf0..314150b4a 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -631,6 +631,7 @@ export type validationStatusType = { params: string; progress: number; valid: boolean; + duration: string; }; export type ApiKey = {