FactualityJudgeOptions
FactualityJudgeOptions<
TInput,TOutput,THarness> =JudgeContext<TInput,TOutput,THarness> &object
Matcher context accepted by FactualityJudge().
Type Declaration
Section titled “Type Declaration”expected?
Section titled “expected?”
optionalexpected?:FactualityJudgeExpected
Expert answer or reference facts. Overrides the judge config default.
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput = any
TOutput
Section titled “TOutput”TOutput extends JsonValue | undefined = any
THarness
Section titled “THarness”THarness extends Harness<TInput, TOutput> | undefined = any
Example
Section titled “Example”import { aiSdkJudgeHarness } from "@vitest-evals/harness-ai-sdk";import { openai } from "@ai-sdk/openai";import { expect } from "vitest";import { FactualityJudge } from "vitest-evals";
const judgeHarness = aiSdkJudgeHarness({ model: openai("gpt-4.1-mini"),});
await expect(result).toSatisfyJudge(FactualityJudge(), { expected: "Paris is the capital of France.", judgeHarness,});