Skip to content

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

fix(evals): hide code evaluator variable mappings (#16527)

Tobias Wochinger42d308d6f6af
diff --git a/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.stories.tsx b/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.stories.tsx
index 600db43bb6..ba13433db9 100644
--- a/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.stories.tsx
+++ b/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.stories.tsx
@@ -30,6 +30,21 @@ const store = createRuleSetupStore({
},
],
});
+const codeEvaluatorId = "exact-match";
+const codeEvaluatorStore = createRuleSetupStore({
+ name: "Experiment evaluators",
+ filter: [],
+ sampling: 1,
+ assignments: [
+ {
+ evaluatorId: codeEvaluatorId,
+ evaluatorName: "Exact Match",
+ evaluatorType: "CODE",
+ defaultVariableMapping,
+ variableMapping: null,
+ },
+ ],
+});
const meta = preview.meta({ component: EvaluatorMappingRow });
@@ -44,3 +59,18 @@ export const FullyMapped = meta.story({
costEstimate: null,
},
});
+
+export const CodeEvaluator = meta.story({
+ args: {
+ evaluatorId: codeEvaluatorId,
+ evaluatorName: "Exact Match",
+ evaluatorType: "CODE",
+ defaultVariableMapping,
+ store: codeEvaluatorStore,
+ sampleObject: {
+ input: "What is the capital of Germany?",
+ output: "Berlin",
+ },
+ costEstimate: null,
+ },
+});
diff --git a/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.tsx b/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.tsx
index 2d8622f69c..54105a9d04 100644
--- a/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.tsx
+++ b/web/src/features/evals/v2/components/Rules/EvaluatorMappingRow/EvaluatorMappingRow.tsx
@@ -156,11 +156,15 @@ export const EvaluatorMappingRow = memo(function EvaluatorMappingRow({
</Button>
</div>
<CollapsibleContent className="border-t p-3">
- {mapping.length === 0 ? (
+ {isCodeEvaluator ? (
<p className="text-muted-foreground text-sm">
- {isCodeEvaluator
- ? "Observation data is available directly in code evaluators, so no variable mapping is required."
- : "No variable mapping is required because this evaluator does not define prompt variables."}
+ Observation data is available directly in code evaluators, so no
+ variable mapping is required.
+ </p>
+ ) : mapping.length === 0 ? (
+ <p className="text-muted-foreground text-sm">
+ No variable mapping is required because this evaluator does not
+ define prompt variables.
</p>
) : (
<VariableMapping