Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(api): type of `totalCost` on trace

Marc Klingen954e31ca4a7b
diff --git a/src/pages/api/public/traces.ts b/src/pages/api/public/traces.ts
index f2b42b3e9d..149dc3b384 100644
--- a/src/pages/api/public/traces.ts
+++ b/src/pages/api/public/traces.ts
@@ -124,7 +124,7 @@ export default async function handler(
t.release,
t.version,
t.tags,
- SUM(o.calculated_total_cost) AS "totalCost",
+ SUM(o.calculated_total_cost)::DOUBLE PRECISION AS "totalCost",
EXTRACT(EPOCH FROM COALESCE(MAX(o."end_time"), MAX(o."start_time"))) - EXTRACT(EPOCH FROM MIN(o."start_time"))::double precision AS "latency",
array_remove(array_agg(o.id), NULL) AS "observations",
array_remove(array_agg(s.id), NULL) AS "scores"