@dooor-ai/toolkit
Version:
Guards, Evals & Observability for AI applications - works seamlessly with LangChain/LangGraph
24 lines • 770 B
TypeScript
import { Eval } from "./base";
import { EvalResult } from "../core/types";
/**
* AnswerRelevancyEval - Measures if the LLM's answer is relevant to the question
*
* Uses LLM-as-judge to score relevancy on a 0-1 scale.
*
* Example:
* ```typescript
* const eval = new AnswerRelevancyEval({ threshold: 0.7 });
* const result = await eval.evaluate(
* "What is the capital of France?",
* "The capital of France is Paris."
* );
* // result.score = 0.95, result.passed = true
* ```
*/
export declare class AnswerRelevancyEval extends Eval {
get name(): string;
evaluate(input: string, output: string, metadata?: Record<string, any>): Promise<EvalResult>;
private buildPrompt;
private parseScore;
}
//# sourceMappingURL=answer-relevancy.d.ts.map