Skip to content

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

Metrics comments on trace and observation (#52)

Marc Klingen2f326f612d56
diff --git a/src/pages/project/[projectId]/generations/[generationId].tsx b/src/pages/project/[projectId]/generations/[generationId].tsx
index fac07037ed..5eef2cbd17 100644
--- a/src/pages/project/[projectId]/generations/[generationId].tsx
+++ b/src/pages/project/[projectId]/generations/[generationId].tsx
@@ -155,7 +155,21 @@ export default function GenerationPage() {
<DescriptionList
items={obsMetrics.map((metric) => ({
label: metric.name,
- value: metric.value,
+ value: (
+ <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-5">
+ <div className="text-sm font-bold">
+ {metric.value.toString()}
+ </div>
+ {metric.comment !== null ? (
+ <div>
+ <div className="text-xs font-semibold text-gray-500">
+ Comment
+ </div>
+ <div className="text-sm">{metric.comment}</div>
+ </div>
+ ) : null}
+ </div>
+ ),
}))}
/>
),
@@ -166,7 +180,21 @@ export default function GenerationPage() {
<DescriptionList
items={traceScores.map((metric) => ({
label: metric.name,
- value: metric.value,
+ value: (
+ <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-5">
+ <div className="text-sm font-bold">
+ {metric.value.toString()}
+ </div>
+ {metric.comment !== null ? (
+ <div>
+ <div className="text-xs font-semibold text-gray-500">
+ Comment
+ </div>
+ <div className="text-sm">{metric.comment}</div>
+ </div>
+ ) : null}
+ </div>
+ ),
}))}
/>
),
diff --git a/src/pages/project/[projectId]/traces/[traceId].tsx b/src/pages/project/[projectId]/traces/[traceId].tsx
index 0b7094a8d6..51894022c8 100644
--- a/src/pages/project/[projectId]/traces/[traceId].tsx
+++ b/src/pages/project/[projectId]/traces/[traceId].tsx
@@ -52,7 +52,21 @@ export default function TracePage() {
<DescriptionList
items={trace.data.scores.map((metric) => ({
label: metric.name,
- value: metric.value.toString(),
+ value: (
+ <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-5">
+ <div className="text-sm font-bold">
+ {metric.value.toString()}
+ </div>
+ {metric.comment !== null ? (
+ <div>
+ <div className="text-xs font-semibold text-gray-500">
+ Comment
+ </div>
+ <div className="text-sm">{metric.comment}</div>
+ </div>
+ ) : null}
+ </div>
+ ),
}))}
/>
),