import { type ModelRuntime } from "../provider/index.js"; import type { EvalAnswerGroundednessMetricOptions } from "./types.js"; type GroundednessJudge = NonNullable; type RubricJudge = (input: { rubric: string; input: unknown; output: Record; reference?: unknown; metadata: Record; }) => Promise<{ score: number; pass?: boolean; explanation?: string; }>; /** Options for the built-in general-purpose LLM rubric judge. */ export interface EvalLlmRubricJudgeOptions { /** Model id or runtime used to judge answer quality. Defaults to the runtime auto model. */ model?: string | ModelRuntime; /** Minimum score required for the judge to pass. Defaults to 0.8. */ threshold?: number; /** Maximum judge response tokens. Defaults to 800. */ maxOutputTokens?: number; /** Judge model temperature. Defaults to 0 for repeatability. */ temperature?: number; /** Provider-specific options forwarded to the model runtime. */ providerOptions?: Record; /** * What the judge is being shown. * * `"answer"` (default) grades an agent's answer to a task, and sends the * task input alongside it. `"text"` grades a standing piece of text against * the rubric with no task premise -- use it when the graded value was not * produced in response to the input, for example a stored document or a * labelled corpus, where the answer framing would read as an agent that * echoed its prompt instead of doing the work. */ framing?: "answer" | "text"; } /** Options for the built-in LLM groundedness judge. */ export interface EvalLlmGroundednessJudgeOptions { /** Model id or runtime used to judge answer grounding. Defaults to the runtime auto model. */ model?: string | ModelRuntime; /** Minimum score required for the judge to pass. Defaults to 0.8. */ threshold?: number; /** Maximum retrieved evidence characters included in the judge prompt. Defaults to 12000. */ maxEvidenceChars?: number; /** Maximum judge response tokens. Defaults to 800. */ maxOutputTokens?: number; /** Judge model temperature. Defaults to 0 for repeatability. */ temperature?: number; /** Provider-specific options forwarded to the model runtime. */ providerOptions?: Record; } declare function createLlmRubricJudge(options?: EvalLlmRubricJudgeOptions): RubricJudge; declare function createLlmGroundednessJudge(options?: EvalLlmGroundednessJudgeOptions): GroundednessJudge; /** Built-in judge factories for semantic eval metrics. */ export declare const judges: { readonly llm: { /** Create an LLM judge for `metrics.judge.rubric`. */ readonly rubric: typeof createLlmRubricJudge; /** Create an LLM judge for `metrics.answer.groundedness`. */ readonly groundedness: typeof createLlmGroundednessJudge; }; }; export {}; //# sourceMappingURL=judges.d.ts.map