From 8015bdc295da3a87478e8c36a80909a6eb8d29a5 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Mon, 11 Mar 2024 14:46:24 +0100 Subject: [PATCH] fixed evaluation output in csv --- .../evaluationCompare/EvaluationCompare.tsx | 14 ++++++++--- .../EvaluationScenarios.tsx | 25 +++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/agenta-web/src/components/pages/evaluations/evaluationCompare/EvaluationCompare.tsx b/agenta-web/src/components/pages/evaluations/evaluationCompare/EvaluationCompare.tsx index 9df9334fdf..fedb229b0e 100644 --- a/agenta-web/src/components/pages/evaluations/evaluationCompare/EvaluationCompare.tsx +++ b/agenta-web/src/components/pages/evaluations/evaluationCompare/EvaluationCompare.tsx @@ -125,7 +125,7 @@ const EvaluationCompareMode: React.FC = () => { flex: 1, field: `variants.${vi}.output` as any, ...getFilterParams("text"), - valueGetter: (params) => { + cellRenderer: (params: any) => { return ( <> {showDiff === "show" ? ( @@ -133,7 +133,7 @@ const EvaluationCompareMode: React.FC = () => { + (item: any) => item.evaluationId === variant.evaluationId, )?.output?.result, )} @@ -143,14 +143,20 @@ const EvaluationCompareMode: React.FC = () => { ) : ( getTypedValue( params.data?.variants.find( - (item) => item.evaluationId === variant.evaluationId, + (item: any) => item.evaluationId === variant.evaluationId, )?.output?.result, ) )} ) }, - cellRenderer: LongTextCellRenderer, + valueGetter: (params) => { + return getTypedValue( + params.data?.variants.find( + (item) => item.evaluationId === variant.evaluationId, + )?.output?.result, + ) + }, }) }) diff --git a/agenta-web/src/components/pages/evaluations/evaluationScenarios/EvaluationScenarios.tsx b/agenta-web/src/components/pages/evaluations/evaluationScenarios/EvaluationScenarios.tsx index 23ac810381..ea13957b1a 100644 --- a/agenta-web/src/components/pages/evaluations/evaluationScenarios/EvaluationScenarios.tsx +++ b/agenta-web/src/components/pages/evaluations/evaluationScenarios/EvaluationScenarios.tsx @@ -92,25 +92,24 @@ const EvaluationScenarios: React.FC = () => { headerName: "Output", ...getFilterParams("text"), field: `outputs.0`, - valueGetter: (params) => { + cellRenderer: (params: any) => { const result = params.data?.outputs[index].result if (result && result.type == "error") { return `${result?.error?.message}\n${result?.error?.stacktrace}` } - return ( - <> - {showDiff === "show" ? ( - - ) : ( - result?.value - )} - + return showDiff === "show" ? ( + + ) : ( + result?.value ) }, - cellRenderer: LongTextCellRenderer, + valueGetter: (params) => { + const result = params.data?.outputs[index].result + return result?.value + }, }) }) scenarios[0]?.evaluators_configs.forEach((config, index) => {