@arizeai/phoenix-evals
Version:
A library for running evaluations for AI use cases
22 lines • 991 B
TypeScript
import { CreateClassifierArgs, EvaluatorFn } from "../types/evals.js";
export interface HallucinationEvaluatorArgs extends Omit<CreateClassifierArgs, "promptTemplate" | "choices"> {
choices?: CreateClassifierArgs["choices"];
promptTemplate?: CreateClassifierArgs["promptTemplate"];
}
/**
* An example to be evaluated by the hallucination evaluator.
*/
export type HallucinationExample = {
input: string;
output: string;
reference?: string;
context?: string;
};
/**
* Creates a function that evaluates whether an answer is factual or hallucinated based on a query and reference text.
*
* @param args - The arguments for creating the hallucination evaluator.
* @returns A function that evaluates whether an answer is factual or hallucinated based on a query and reference text.
*/
export declare function createHallucinationEvaluator(args: HallucinationEvaluatorArgs): EvaluatorFn<HallucinationExample>;
//# sourceMappingURL=createHallucinationEvaluator.d.ts.map