@dooor-ai/toolkit
Version:
Guards, Evals & Observability for AI applications - works seamlessly with LangChain/LangGraph
37 lines • 1.35 kB
TypeScript
import { Eval } from "./base";
import { EvalResult, EvalConfig } from "../core/types";
export interface SummarizationConfig extends EvalConfig {
/** Original text that was summarized */
originalText?: string;
}
/**
* SummarizationEval - Evaluates quality of text summarization
*
* Checks if summary captures key points, maintains accuracy, and is concise.
*
* Example:
* ```typescript
* const eval = new SummarizationEval({
* threshold: 0.8,
* originalText: "The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower from 1887 to 1889."
* });
* const result = await eval.evaluate(
* "Summarize this text.",
* "The Eiffel Tower in Paris was designed by Gustave Eiffel and built 1887-1889."
* );
* // result.score = 0.9 (good summary), result.passed = true
* ```
*/
export declare class SummarizationEval extends Eval {
private originalText?;
constructor(config?: SummarizationConfig);
get name(): string;
/**
* Set original text dynamically
*/
setOriginalText(text: string): void;
evaluate(input: string, output: string, metadata?: Record<string, any>): Promise<EvalResult>;
private buildPrompt;
private parseScore;
}
//# sourceMappingURL=summarization.d.ts.map