UNPKG

llamaindex

Version:

<p align="center"> <img height="100" width="100" alt="LlamaIndex logo" src="https://ts.llamaindex.ai/square.svg" /> </p> <h1 align="center">LlamaIndex.TS</h1> <h3 align="center"> Data framework for your LLM application. </h3>

29 lines (28 loc) 821 B
import type { QueryType } from "@llamaindex/core/query-engine"; import type { EngineResponse } from "@llamaindex/core/schema"; export type EvaluationResult = { query?: QueryType; contexts?: string[]; response: string | null; score: number; scoreSecondary?: number; scoreSecondaryType?: string; meta?: any; passing: boolean; feedback: string; }; export type EvaluatorParams = { query: QueryType; response: string; contexts?: string[]; reference?: string; sleepTimeInSeconds?: number; }; export type EvaluatorResponseParams = { query: QueryType; response: EngineResponse; }; export interface BaseEvaluator { evaluate(params: EvaluatorParams): Promise<EvaluationResult>; evaluateResponse?(params: EvaluatorResponseParams): Promise<EvaluationResult>; }