Optionallogger: LDLoggerThe default sampling rate baked in at construction. Used by evaluate /
evaluateMessages when no per-call rate is supplied.
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
OptionalsamplingRate: number
Sampling 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.
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
OptionalsamplingRatio: number
Sampling ratio (0-1). When omitted, the Judge's constructor-default rate is used.
Promise that resolves to evaluation results
Returns the AI Config used by this judge.
Returns the runner used by this judge.
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.