Skip to content

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

Add commit comment

Marc Klingenebbd3f4b19a3
diff --git a/fern/client/definition/score.yml b/fern/client/definition/score.yml
index 8657923f83..b37518beea 100644
--- a/fern/client/definition/score.yml
+++ b/fern/client/definition/score.yml
@@ -19,6 +19,7 @@ types:
name: string
value: integer
observationId: optional<string>
+ comment: optional<string>
Score:
properties:
id: string
@@ -27,6 +28,7 @@ types:
value: integer
observationId: optional<string>
timestamp: datetime
+ comment: optional<string>
TraceIdType:
enum:
- LANGFUSE
diff --git a/fern/server/definition/score.yml b/fern/server/definition/score.yml
index 8657923f83..b37518beea 100644
--- a/fern/server/definition/score.yml
+++ b/fern/server/definition/score.yml
@@ -19,6 +19,7 @@ types:
name: string
value: integer
observationId: optional<string>
+ comment: optional<string>
Score:
properties:
id: string
@@ -27,6 +28,7 @@ types:
value: integer
observationId: optional<string>
timestamp: datetime
+ comment: optional<string>
TraceIdType:
enum:
- LANGFUSE
diff --git a/generated/openapi-client/openapi.yml b/generated/openapi-client/openapi.yml
index 1d26b697b7..741aaac06c 100644
--- a/generated/openapi-client/openapi.yml
+++ b/generated/openapi-client/openapi.yml
@@ -65,6 +65,8 @@ components:
type: integer
observationId:
type: string
+ comment:
+ type: string
required:
- traceId
- name
@@ -86,6 +88,8 @@ components:
timestamp:
type: string
format: date-time
+ comment:
+ type: string
required:
- id
- traceId
diff --git a/generated/openapi-server/openapi.yml b/generated/openapi-server/openapi.yml
index 63ca2f4fee..9df2d2e864 100644
--- a/generated/openapi-server/openapi.yml
+++ b/generated/openapi-server/openapi.yml
@@ -602,6 +602,9 @@ components:
observationId:
type: string
nullable: true
+ comment:
+ type: string
+ nullable: true
required:
- traceId
- name
@@ -624,6 +627,9 @@ components:
timestamp:
type: string
format: date-time
+ comment:
+ type: string
+ nullable: true
required:
- id
- traceId
diff --git a/prisma/migrations/20230710200816_scores_add_comment/migration.sql b/prisma/migrations/20230710200816_scores_add_comment/migration.sql
new file mode 100644
index 0000000000..51af4215dc
--- /dev/null
+++ b/prisma/migrations/20230710200816_scores_add_comment/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "scores" ADD COLUMN "comment" TEXT;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index e5aa74aa56..ac587a84ff 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -181,6 +181,7 @@ model Score {
timestamp DateTime @default(now())
name String
value Int
+ comment String?
traceId String @map("trace_id")
trace Trace @relation(fields: [traceId], references: [id], onDelete: Cascade)
observationId String? @map("observation_id")
diff --git a/src/pages/api/public/scores.ts b/src/pages/api/public/scores.ts
index 3a99111844..caca72fd19 100644
--- a/src/pages/api/public/scores.ts
+++ b/src/pages/api/public/scores.ts
@@ -12,6 +12,7 @@ const ScoreSchema = z.object({
traceId: z.string(),
traceIdType: z.enum(["LANGFUSE", "EXTERNAL"]).nullish(),
observationId: z.string().nullish(),
+ comment: z.string().nullish(),
});
export default async function handler(
@@ -75,6 +76,7 @@ export default async function handler(
timestamp: new Date(),
value: obj.value,
name: obj.name,
+ comment: obj.comment,
trace: { connect: { id: traceId } },
...(obj.observationId && {
observation: { connect: { id: obj.observationId } },
diff --git a/src/pages/project/[projectId]/scores.tsx b/src/pages/project/[projectId]/scores.tsx
index 8440ad8131..e0cd5b0675 100644
--- a/src/pages/project/[projectId]/scores.tsx
+++ b/src/pages/project/[projectId]/scores.tsx
@@ -17,6 +17,7 @@ type RowData = {
timestamp: string;
name: string;
value: number;
+ comment?: string;
observationId?: string;
};
@@ -100,6 +101,10 @@ export default function ScoresPage() {
accessorKey: "value",
header: "Value",
},
+ {
+ accessorKey: "comment",
+ header: "Comment",
+ },
{
accessorKey: "observationId",
header: "Observation ID",
@@ -139,6 +144,7 @@ export default function ScoresPage() {
timestamp: score.timestamp.toISOString(),
name: score.name,
value: score.value,
+ comment: score.comment ?? undefined,
observationId: score.observationId ?? undefined,
traceId: score.traceId,
};