import { Judge, JudgeContext } from './types.js'; import { StructuredOutputScorerConfig, StructuredOutputScorerOptions } from '../internal/structuredOutputScorer.js'; import { HarnessMetadata } from '../harness.js'; import './judgeHarness.js'; import '@vitest-evals/core'; import '../internal/scoring.js'; import '../internal/matchers.js'; /** * Expected structured fields accepted by `StructuredOutputJudge()`. * * @example * ```ts * const expected: StructuredOutputJudgeExpected = { * status: "approved", * risk: "low", * }; * ``` */ type StructuredOutputJudgeExpected = Record; /** * Matcher context accepted by `StructuredOutputJudge()`. * * @example * ```ts * await expect(result).toSatisfyJudge(StructuredOutputJudge(), { * expected: { status: "approved" }, * }); * ``` */ interface StructuredOutputJudgeOptions extends JudgeContext, Omit { expected?: StructuredOutputJudgeExpected; } /** * Configuration for the deterministic structured-output judge. * * @example * ```ts * const judge = StructuredOutputJudge({ * match: "fuzzy", * fuzzyOptions: { caseInsensitive: true }, * }); * ``` */ interface StructuredOutputJudgeConfig extends StructuredOutputScorerConfig { } /** * Creates a deterministic judge that compares structured output fields. * * @param config - Matching behavior shared by every assessment from this judge. * * @example * ```ts * describeEval("refund agent", { * harness: refundHarness, * judges: [StructuredOutputJudge()], * }, (it) => { * it("returns the expected decision", async ({ run }) => { * await run("Refund invoice inv_123", { * metadata: { * expected: { status: "approved" }, * }, * }); * }); * }); * ``` */ declare function StructuredOutputJudge(config?: StructuredOutputJudgeConfig): Judge; export { StructuredOutputJudge, type StructuredOutputJudgeConfig, type StructuredOutputJudgeExpected, type StructuredOutputJudgeOptions };