import type { LLMProvider } from '../types/provider/interface.js'; import type { Scorer } from './types.js'; /** * Grade an open-ended answer with a model. * * Every other scorer here is a pure function over the turn, which is what * makes them cheap and reproducible — and also what makes them unable to * say anything about whether an answer is *good*. `containsScorer` can * check that a required phrase appears; it cannot tell a correct * explanation from a fluent wrong one. That was the hole: the dimension * most worth guarding was the one with no scorer behind it. * * A judge is a network call, so this scorer can fail in ways a pure * function cannot. It throws rather than returning a low score, and the * harness files a throw as `unavailable` — a rate limit must not read as * a regression. See `Score.unavailable`. */ export interface JudgeScorerConfig { /** Defaults to `'judge'`. Give it a distinct name to run several. */ name?: string; provider: LLMProvider; model: string; /** * What "good" means, in the caller's words. REQUIRED. * * A judge asked to rate quality with no rubric rates fluency, which * correlates with almost nothing worth measuring and drifts whenever * the judge model changes. Making this optional would make the scorer * easy to use and its output meaningless, so it is not optional. */ rubric: string; /** * Highest grade on the scale. Default 4. * * An integer scale, not a 0..1 float: models place a continuous score * poorly and cluster on round numbers, while a short ordinal scale * against a written rubric is a judgement they can actually make. The * result is divided down to 0..1 for the report. * * The default is EVEN on purpose — an odd scale has a midpoint, and a * midpoint is where an uncertain judge parks. Forcing a side produces a * signal; a pile of 3-out-of-5s does not. */ scale?: number; /** * Show the judge which tools the turn called. Default false. * * Useful when the rubric is about method rather than answer, and a * needless cost otherwise — the trajectory is usually longer than the * answer it produced. */ includeTrajectory?: boolean; /** * Cap on the answer text handed to the judge. Default 20000. * * Truncation is disclosed IN the prompt. A judge shown a silently cut * answer marks it down for stopping mid-sentence, which scores our * truncation rather than the turn. */ maxOutputChars?: number; /** * Milliseconds without a judge chunk before its provider stream is * treated as stalled. Defaults to the SDK's finite provider-stream idle * bound. Set `0` only for explicit unbounded compatibility. */ streamIdleTimeoutMs?: number; } export declare function judgeScorer(config: JudgeScorerConfig): Scorer; //# sourceMappingURL=judge.d.ts.map