🐛 fix(types/components/index.ts): add duration field to validationStatusType to match the changes in chat.py
🐛 fix(chat.py): fix typo in variable name, change time_elapded to time_elapsed for consistency and readability 🐛 fix(chat.py): remove redundant duration information from params field in response object ✨ feat(chat.py): add duration field to response object to provide information about the time taken for the build process 🐛 fix(GenericNode/index.tsx): fix formatting issue in displaying duration and params in GenericNode component 🐛 fix(GenericNode/index.tsx): fix type annotation for line variable in map function
This commit is contained in:
parent
e3dcd9b926
commit
9770f67227
3 changed files with 6 additions and 5 deletions
|
|
@ -160,7 +160,7 @@ async def stream_build(
|
||||||
vertex = await try_running_celery_task(vertex, user_id)
|
vertex = await try_running_celery_task(vertex, user_id)
|
||||||
else:
|
else:
|
||||||
await vertex.build(user_id=user_id)
|
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()
|
params = vertex._built_object_repr()
|
||||||
valid = True
|
valid = True
|
||||||
|
|
||||||
|
|
@ -181,10 +181,10 @@ async def stream_build(
|
||||||
if vertex_id in graph.top_level_vertices:
|
if vertex_id in graph.top_level_vertices:
|
||||||
response = {
|
response = {
|
||||||
"valid": valid,
|
"valid": valid,
|
||||||
"params": f"Duration: {time_elapded}\n{params}",
|
"params": params,
|
||||||
"id": vertex_id,
|
"id": vertex_id,
|
||||||
"progress": round(i / number_of_nodes, 2),
|
"progress": round(i / number_of_nodes, 2),
|
||||||
"duration": time_elapded,
|
"duration": time_elapsed,
|
||||||
}
|
}
|
||||||
|
|
||||||
yield str(StreamData(event="message", data=response))
|
yield str(StreamData(event="message", data=response))
|
||||||
|
|
|
||||||
|
|
@ -317,9 +317,9 @@ export default function GenericNode({
|
||||||
) : (
|
) : (
|
||||||
<div className="max-h-96 overflow-auto">
|
<div className="max-h-96 overflow-auto">
|
||||||
{typeof validationStatus.params === "string"
|
{typeof validationStatus.params === "string"
|
||||||
? validationStatus.params
|
? `Duration: ${validationStatus.duration}\n${validationStatus.params}`
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.map((line: string, index: number) => (
|
.map((line, index) => (
|
||||||
<div key={index}>{line}</div>
|
<div key={index}>{line}</div>
|
||||||
))
|
))
|
||||||
: ""}
|
: ""}
|
||||||
|
|
|
||||||
|
|
@ -631,6 +631,7 @@ export type validationStatusType = {
|
||||||
params: string;
|
params: string;
|
||||||
progress: number;
|
progress: number;
|
||||||
valid: boolean;
|
valid: boolean;
|
||||||
|
duration: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ApiKey = {
|
export type ApiKey = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue