Optional logger: LDLoggerOptional Private Readonly _aiPrivate Optional Readonly _loggerPrivate Readonly _runnerPrivate Readonly _sampleThe default sampling rate baked in at construction. Used by evaluate /
evaluateMessages when no per-call rate is supplied.
Private _buildPrivate _getPrivate _parseParses the structured evaluation response. Expects top-level {score, reasoning}. Returns score and reasoning, or undefined if parsing fails.
Evaluates an AI response using the judge's configuration.
The input prompt or question that was provided to the AI
The AI-generated response to be evaluated
Optional samplingRate: numberSampling rate (0-1) to determine if evaluation should be processed.
When omitted, the Judge's constructor-default rate is used. An explicit 0 overrides
the default — only undefined falls through.
Optional Promise that resolves to evaluation results
Evaluates an AI response from chat messages and a runner result.
Each message is rendered as <role>: <content> so the judge model can
distinguish speakers in the message history. Messages are joined with a
single newline.
Array of messages representing the conversation history
The runner result containing the AI-generated content to evaluate
Optional samplingRatio: numberSampling ratio (0-1). When omitted, the Judge's constructor-default rate is used.
Optional Promise that resolves to evaluation results
Returns the AI Config used by this judge.
Generated using TypeDoc
Judge implementation that handles evaluation functionality and conversation management.
According to the AIEval spec, judges are AI Configs with mode: "judge" that evaluate other AI Configs using structured output.