🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(dashboard): allow filtering by score value in custom dashboards (#7567)
Steffen Schmitz867f6c748402
diff --git a/web/src/features/query/dashboardUiTableToViewMapping.ts b/web/src/features/query/dashboardUiTableToViewMapping.tsindex 9bae0cd9e6..3ea8412ff5 100644--- a/web/src/features/query/dashboardUiTableToViewMapping.ts+++ b/web/src/features/query/dashboardUiTableToViewMapping.ts@@ -106,6 +106,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {uiTableName: "Score Source",viewName: "source",},+ {+ uiTableName: "Score Value",+ viewName: "value",+ },{uiTableName: "Scores Data Type",viewName: "dataType",@@ -156,6 +160,10 @@ const viewMappings: Record<z.infer<typeof views>, Record<string, string>[]> = {uiTableName: "Score Source",viewName: "source",},+ {+ uiTableName: "Score String Value",+ viewName: "stringValue",+ },{uiTableName: "Scores Data Type",viewName: "dataType",@@ -222,6 +230,18 @@ const isLegacyUiTableFilter = (clickhouseTableName: "traces",clickhouseSelect: 't."metadata"',},+ {+ uiTableName: "Score Value",+ uiTableId: "value",+ clickhouseTableName: "scores",+ clickhouseSelect: 's."value"',+ },+ {+ uiTableName: "Score String Value",+ uiTableId: "stringValue",+ clickhouseTableName: "scores",+ clickhouseSelect: 's."string_value"',+ },]).some((columnDef) => columnDef.uiTableName === filter.column);};diff --git a/web/src/features/query/dataModel.ts b/web/src/features/query/dataModel.tsindex 298be13e4c..40fd5b4c9f 100644--- a/web/src/features/query/dataModel.ts+++ b/web/src/features/query/dataModel.ts@@ -501,6 +501,11 @@ export const scoresNumericView: ViewDeclarationType = {"Scores are flexible objects that are used for evaluations. This view contains numeric scores.",dimensions: {...scoreBaseDimensions,+ value: {+ sql: "value",+ type: "number",+ description: "Value of the score.",+ },},measures: {count: {diff --git a/web/src/features/widgets/components/WidgetForm.tsx b/web/src/features/widgets/components/WidgetForm.tsxindex a833929519..147c486d76 100644--- a/web/src/features/widgets/components/WidgetForm.tsx+++ b/web/src/features/widgets/components/WidgetForm.tsx@@ -312,6 +312,22 @@ export function WidgetForm({internal: "internalValue",},];+ if (selectedView === "scores-categorical") {+ filterColumns.push({+ name: "Score String Value",+ id: "stringValue",+ type: "string",+ internal: "internalValue",+ });+ }+ if (selectedView === "scores-numeric") {+ filterColumns.push({+ name: "Score Value",+ id: "value",+ type: "number",+ internal: "internalValue",+ });+ }// When chart type does not support breakdown, wipe the breakdown dimensionuseEffect(() => {