UNPKG

@arizeai/phoenix-evals

Version:
34 lines 1.49 kB
import type { LanguageModel } from "ai"; import type { ClassificationChoicesMap, CreateClassificationEvaluatorArgs, EvaluatorFn, PromptTemplate, WithPromptTemplate } from "../types"; import type { ObjectMapping } from "../types/data"; import { LLMEvaluator } from "./LLMEvaluator"; /** * An LLM evaluator that performs evaluation via classification */ export declare class ClassificationEvaluator<RecordType extends Record<string, unknown>> extends LLMEvaluator<RecordType> implements WithPromptTemplate { readonly evaluatorFn: EvaluatorFn<RecordType>; readonly promptTemplate: PromptTemplate; /** * A dynamically computed set of prompt template variables */ private _promptTemplateVariables; /** * The model to use for classification */ readonly model: LanguageModel; /** * The choices to classify the example into */ readonly choices: ClassificationChoicesMap; constructor(args: CreateClassificationEvaluatorArgs<RecordType>); evaluate: (example: RecordType) => Promise<import("../types").EvaluationResult>; /** * List out the prompt template variables needed to perform evaluation */ get promptTemplateVariables(): string[]; /** * Binds the input mapping to the evaluator. It makes a a copy of the evaluator and returns it. */ bindInputMapping(inputMapping: ObjectMapping<RecordType>): ClassificationEvaluator<RecordType>; } //# sourceMappingURL=ClassificationEvaluator.d.ts.map