fix: handle null/undefined evaluator object in scenario runs
- Make evaluator field nullable in TypeScript interface - Add optional chaining for run.evaluator?.verdict - Add optional chaining for run.evaluator?.model - Prevents TypeError when evaluator object is missing
This commit is contained in:
parent
2d939ea11b
commit
8964e0c237
1 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ interface ScenarioRun {
|
|||
model: string | null;
|
||||
verdict: string | null;
|
||||
reason: string | null;
|
||||
};
|
||||
} | null;
|
||||
assertions: { passed: string[]; failed: string[] } | null;
|
||||
usage: {
|
||||
inputTokens: number | null;
|
||||
|
|
@ -383,7 +383,7 @@ export default function CollectionScenarioDetailPage(): React.ReactElement {
|
|||
<div className="px-4 pb-4 border-t border-border/50">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
|
||||
{/* Evaluator */}
|
||||
{run.evaluator.verdict && (
|
||||
{run.evaluator?.verdict && (
|
||||
<div className="p-3 bg-surface-secondary rounded-lg">
|
||||
<h4 className="text-xs font-semibold text-foreground-secondary uppercase tracking-wide mb-2">
|
||||
LLM Evaluation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue