import { EvaluationInput, EvaluatorResult, IEvaluator } from '../types/evaluator.js'; /** * Represents a single row of input data */ export interface BatchInputRow extends EvaluationInput { id?: string; [key: string]: unknown; } /** * Represents a single evaluation result with metadata */ export interface BatchEvaluationResult { readonly rowId: string; readonly rowIndex: number; readonly input: BatchInputRow; readonly results: EvaluatorResult[]; readonly timestamp: string; readonly durationMs: number; readonly retryCount: number; readonly error?: string; } /** * Configuration for BatchEvaluator */ export interface BatchEvaluatorConfig { readonly evaluators: readonly IEvaluator[]; readonly defaultInput?: { readonly prompt?: string; readonly referenceText?: string; readonly sourceText?: string; readonly contentType?: string; readonly language?: string; readonly [key: string]: unknown; }; readonly concurrency?: number; readonly evaluatorExecutionMode?: "parallel" | "sequential"; readonly rateLimit?: { readonly maxRequestsPerMinute?: number; readonly maxRequestsPerHour?: number; }; readonly retryConfig?: { readonly maxRetries?: number; readonly retryDelay?: number; readonly exponentialBackoff?: boolean; readonly retryOnErrors?: string[]; }; readonly onProgress?: (event: ProgressEvent) => void | Promise; readonly progressInterval?: number; readonly onResult?: (result: BatchEvaluationResult) => void | Promise; readonly stopOnError?: boolean; readonly timeout?: number; } /** * Input configuration - supports either file path or in-memory data array */ export type BatchInputConfig = BatchInputFileConfig | BatchInputDataConfig; /** * File-based input configuration */ export interface BatchInputFileConfig { readonly filePath: string; readonly format?: "csv" | "json" | "auto"; readonly startIndex?: number; readonly csvOptions?: { readonly delimiter?: string; readonly quote?: string; readonly escape?: string; readonly headers?: boolean; readonly skipEmptyLines?: boolean; readonly encoding?: BufferEncoding; }; readonly jsonOptions?: { readonly arrayPath?: string; readonly encoding?: BufferEncoding; }; readonly fieldMapping?: { readonly candidateText: string; readonly referenceText?: string; readonly sourceText?: string; readonly contentType?: string; readonly language?: string; readonly id?: string; }; } /** * In-memory data input configuration */ export interface BatchInputDataConfig { readonly data: BatchInputRow[]; readonly startIndex?: number; } /** * Export configuration */ export interface BatchExportConfig { readonly format: "csv" | "json"; readonly destination: string; readonly appendToExisting?: boolean; readonly csvOptions?: { readonly delimiter?: string; readonly includeHeaders?: boolean; readonly flattenResults?: boolean; }; readonly jsonOptions?: { readonly pretty?: boolean; readonly includeMetadata?: boolean; }; readonly includeFields?: string[]; readonly excludeFields?: string[]; readonly filterCondition?: (result: BatchEvaluationResult) => boolean; } /** * Progress event types */ export type ProgressEventType = "started" | "progress" | "completed" | "error" | "retry" | "paused" | "resumed"; /** * Progress event */ export interface ProgressEvent { readonly type: ProgressEventType; readonly timestamp: string; readonly totalRows: number; readonly processedRows: number; readonly successfulRows: number; readonly failedRows: number; readonly currentRow?: number; readonly percentComplete: number; readonly estimatedTimeRemaining?: number; readonly averageProcessingTime?: number; readonly currentError?: string; readonly retryCount?: number; readonly estimatedCostUSD?: number; readonly estimatedTokensRemaining?: number; } /** * Batch execution result */ export interface BatchResult { readonly batchId: string; readonly startTime: string; readonly endTime: string; readonly durationMs: number; readonly totalRows: number; readonly successfulRows: number; readonly failedRows: number; readonly results: BatchEvaluationResult[]; readonly summary: { readonly averageProcessingTime: number; readonly totalTokensUsed?: number; readonly errorRate: number; }; } //# sourceMappingURL=types.d.ts.map