Skip to content

Commit

Permalink
Merge pull request #1433 from Agenta-AI/Fix/-evaluation-results-outpu…
Browse files Browse the repository at this point in the history
…t-in-csv

[FIX]: Evaluation output in CSV file
  • Loading branch information
aakrem authored Mar 11, 2024
2 parents 773a740 + 8015bdc commit 1b5bf91
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const EvaluationCompareMode: React.FC<Props> = () => {
flex: 1,
field: `variants.${vi}.output` as any,
...getFilterParams("text"),
valueGetter: (params) => {
cellRenderer: (params: any) => {
return (
<>
{showDiff === "show" ? (
<span>
<CompareOutputDiff
variantOutput={getTypedValue(
params.data?.variants.find(
(item) =>
(item: any) =>
item.evaluationId === variant.evaluationId,
)?.output?.result,
)}
Expand All @@ -143,14 +143,20 @@ const EvaluationCompareMode: React.FC<Props> = () => {
) : (
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,
)
},
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,24 @@ const EvaluationScenarios: React.FC<Props> = () => {
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" ? (
<CompareOutputDiff
variantOutput={result?.value}
expectedOutput={params.data?.correct_answer}
/>
) : (
result?.value
)}
</>
return showDiff === "show" ? (
<CompareOutputDiff
variantOutput={result?.value}
expectedOutput={params.data?.correct_answer}
/>
) : (
result?.value
)
},
cellRenderer: LongTextCellRenderer,
valueGetter: (params) => {
const result = params.data?.outputs[index].result
return result?.value
},
})
})
scenarios[0]?.evaluators_configs.forEach((config, index) => {
Expand Down

0 comments on commit 1b5bf91

Please sign in to comment.