Skip to content

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

fix: fix failing eval filter (#1883)

Max Deichmannc8672b57cca6
diff --git a/packages/shared/src/tracesTable.ts b/packages/shared/src/tracesTable.ts
index c74bd59816..a2af9edac1 100644
--- a/packages/shared/src/tracesTable.ts
+++ b/packages/shared/src/tracesTable.ts
@@ -1,8 +1,13 @@
import { ObservationLevel } from "@prisma/client";
import { ColumnDefinition, OptionsDefinition } from ".";
-export const tracesTableCols: ColumnDefinition[] = [
- { name: "⭐️", id: "bookmarked", type: "boolean", internal: "t.bookmarked" },
+const tracesOnlyCols: ColumnDefinition[] = [
+ {
+ name: "⭐️",
+ id: "bookmarked",
+ type: "boolean",
+ internal: "t.bookmarked",
+ },
{ name: "ID", id: "id", type: "string", internal: "t.id" },
{
name: "Name",
@@ -24,6 +29,41 @@ export const tracesTableCols: ColumnDefinition[] = [
type: "string",
internal: 't."session_id"',
},
+ {
+ name: "Metadata",
+ id: "metadata",
+ type: "stringObject",
+ internal: 't."metadata"',
+ },
+ {
+ name: "Version",
+ id: "version",
+ type: "string",
+ internal: 't."version"',
+ },
+ {
+ name: "Release",
+ id: "release",
+ type: "string",
+ internal: 't."release"',
+ },
+ {
+ name: "Level",
+ id: "level",
+ type: "stringOptions",
+ internal: '"level"',
+ options: Object.values(ObservationLevel).map((value) => ({ value })),
+ },
+ {
+ name: "Tags",
+ id: "tags",
+ type: "arrayOptions",
+ internal: 't."tags"',
+ options: [], // to be filled in at runtime
+ },
+];
+export const tracesTableCols: ColumnDefinition[] = [
+ ...tracesOnlyCols,
{
name: "Input Tokens",
id: "inputTokens",
@@ -48,12 +88,7 @@ export const tracesTableCols: ColumnDefinition[] = [
type: "number",
internal: 'tm."totalTokens"',
},
- {
- name: "Metadata",
- id: "metadata",
- type: "stringObject",
- internal: 't."metadata"',
- },
+
{
name: "Scores",
id: "scores_avg",
@@ -84,34 +119,10 @@ export const tracesTableCols: ColumnDefinition[] = [
type: "number",
internal: '"calculatedTotalCost"',
},
- {
- name: "Version",
- id: "version",
- type: "string",
- internal: 't."version"',
- },
- {
- name: "Release",
- id: "release",
- type: "string",
- internal: 't."release"',
- },
- {
- name: "Level",
- id: "level",
- type: "stringOptions",
- internal: '"level"',
- options: Object.values(ObservationLevel).map((value) => ({ value })),
- },
- {
- name: "Tags",
- id: "tags",
- type: "arrayOptions",
- internal: 't."tags"',
- options: [], // to be filled in at runtime
- },
];
+export const evalTableCols: ColumnDefinition[] = tracesOnlyCols;
+
export type TraceOptions = {
scores_avg: Array<string>;
name: Array<OptionsDefinition>;
@@ -119,9 +130,10 @@ export type TraceOptions = {
};
export function tracesTableColsWithOptions(
- options?: TraceOptions
+ options?: TraceOptions,
+ cols: ColumnDefinition[] = tracesTableCols
): ColumnDefinition[] {
- return tracesTableCols.map((col) => {
+ return cols.map((col) => {
if (col.id === "scores_avg") {
return { ...col, keyOptions: options?.scores_avg ?? [] };
}
diff --git a/web/src/ee/features/evals/components/eval-config-form.tsx b/web/src/ee/features/evals/components/eval-config-form.tsx
index db7c9d6ba2..0609b0781c 100644
--- a/web/src/ee/features/evals/components/eval-config-form.tsx
+++ b/web/src/ee/features/evals/components/eval-config-form.tsx
@@ -22,6 +22,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
import {
tracesTableColsWithOptions,
+ evalTableCols,
singleFilter,
type JobConfiguration,
availableEvalVariables,
@@ -41,7 +42,6 @@ import { Card } from "@/src/components/ui/card";
import { JSONView } from "@/src/components/ui/CodeJsonViewer";
import { Label } from "@/src/components/ui/label";
import DocPopup from "@/src/components/layouts/doc-popup";
-import TableLink from "@/src/components/table/table-link";
const formSchema = z.object({
scoreName: z.string(),
@@ -289,6 +289,7 @@ export const InnerEvalConfigForm = (props: {
<InlineFilterBuilder
columns={tracesTableColsWithOptions(
traceFilterOptions.data,
+ evalTableCols,
)}
filterState={field.value ?? []}
onChange={(value) => field.onChange(value)}
diff --git a/web/src/pages/api/public/ingestion.ts b/web/src/pages/api/public/ingestion.ts
index 8f5ef7f17f..57f6424362 100644
--- a/web/src/pages/api/public/ingestion.ts
+++ b/web/src/pages/api/public/ingestion.ts
@@ -126,7 +126,7 @@ export default async function handler(
res,
);
} catch (error: unknown) {
- console.error(error);
+ console.error("error handling ingestion event", error);
if (error instanceof BaseError) {
return res.status(error.httpCode).json({
diff --git a/worker/src/eval-service.ts b/worker/src/eval-service.ts
index 22aed87018..b881f0f770 100644
--- a/worker/src/eval-service.ts
+++ b/worker/src/eval-service.ts
@@ -19,6 +19,7 @@ import {
ForbiddenError,
ValidationError,
ApiError,
+ evalTableCols,
} from "@langfuse/shared";
import { Prisma } from "@langfuse/shared";
import { decrypt } from "@langfuse/shared/encryption";
@@ -60,7 +61,7 @@ export const createEvalJobs = async ({
const condition = tableColumnsToSqlFilterAndPrefix(
validatedFilter,
- tracesTableCols,
+ evalTableCols,
"traces"
);