diff --git a/agenta-web/src/components/Playground/Views/TestView.tsx b/agenta-web/src/components/Playground/Views/TestView.tsx index 5c725cb15c..95a0a72690 100644 --- a/agenta-web/src/components/Playground/Views/TestView.tsx +++ b/agenta-web/src/components/Playground/Views/TestView.tsx @@ -219,7 +219,7 @@ const BoxComponent: React.FC = ({ } }, [traceSpans]) - const activeTrace = useMemo(() => (traces ? traces[0] ?? null : null), [traces]) + const activeTrace = useMemo(() => (traces ? (traces[0] ?? null) : null), [traces]) const [selected, setSelected] = useState("") useEffect(() => { @@ -623,7 +623,7 @@ const App: React.FC = ({ const firstTraceNode = tree.nodes[0] newDataList[index] = { cost: firstTraceNode?.metrics?.acc?.costs?.total ?? null, - latency: firstTraceNode?.metrics?.acc?.duration?.total / 1000 ?? null, + latency: firstTraceNode?.metrics?.acc?.duration?.total / 1000 || null, usage: firstTraceNode?.metrics?.acc?.tokens?.total ?? null, } } diff --git a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx index 917b3848ea..eef5893e46 100644 --- a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx +++ b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx @@ -182,8 +182,8 @@ const ObservabilityDashboard = () => {
{formatLatency( record?.metrics?.acc?.duration?.total - ? record?.metrics?.acc?.duration?.total - : record?.metrics?.acc?.tokens?.total / 1000, + ? record?.metrics?.acc?.duration?.total / 1000 + : null, )}
), diff --git a/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx b/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx index 5b0c6d0adf..fab6e3e258 100644 --- a/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx +++ b/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx @@ -299,8 +299,8 @@ const TraceContent = ({activeTrace}: TraceContentProps) => { {" "} {formatLatency( activeTrace?.metrics?.acc?.duration?.total - ? activeTrace?.metrics?.acc?.duration?.total - : activeTrace?.metrics?.acc?.tokens?.total / 1000, + ? activeTrace?.metrics?.acc?.duration?.total / 1000 + : null, )} } diff --git a/agenta-web/src/components/pages/observability/drawer/TraceTree.tsx b/agenta-web/src/components/pages/observability/drawer/TraceTree.tsx index 4d4c2f76fa..2738667d14 100644 --- a/agenta-web/src/components/pages/observability/drawer/TraceTree.tsx +++ b/agenta-web/src/components/pages/observability/drawer/TraceTree.tsx @@ -98,8 +98,8 @@ const TreeContent = ({value}: {value: _AgentaRootsResponse}) => { {formatLatency( metrics?.acc?.duration?.total - ? metrics?.acc?.duration?.total - : metrics?.acc?.tokens?.total / 1000, + ? metrics?.acc?.duration?.total / 1000 + : null, )}