/**
 * @file Base class for all LLM-based scorers
 * Provides common functionality for calling LLMs and parsing responses
 */
import type { JsonObject } from "../../../types/common.js";
import type { AIProvider } from "../../../types/providers.js";
import type { LLMScorer, LLMScorerConfig, ScoreResult, ScorerInput, ScorerMetadata } from "../../../types/scorerTypes.js";
import { BaseScorer } from "../baseScorer.js";
/**
 * Default LLM scorer configuration
 */
export declare const DEFAULT_LLM_SCORER_CONFIG: LLMScorerConfig;
/**
 * Abstract base class for LLM-based scorers
 */
export declare abstract class BaseLLMScorer extends BaseScorer implements LLMScorer {
    protected _llmConfig: LLMScorerConfig;
    protected provider?: AIProvider;
    private initializationPromise;
    constructor(metadata: ScorerMetadata, config?: LLMScorerConfig);
    /**
     * Get LLM-specific configuration
     */
    get llmConfig(): LLMScorerConfig;
    /**
     * Generate the prompt for LLM scoring - must be implemented by subclasses
     */
    abstract generatePrompt(input: ScorerInput): string;
    /**
     * Parse LLM response into score result - must be implemented by subclasses
     */
    abstract parseResponse(response: string, input: ScorerInput): Partial<ScoreResult>;
    /**
     * Main scoring method
     */
    score(input: ScorerInput): Promise<ScoreResult>;
    /**
     * Initialize the AI provider
     */
    protected initializeProvider(): Promise<void>;
    /**
     * Internal method to actually initialize the provider
     */
    private _doInitializeProvider;
    /**
     * Call the LLM with the given prompt
     */
    protected callLLM(prompt: string): Promise<string>;
    /**
     * Extract JSON from LLM response
     * Handles various formats including markdown code blocks
     */
    protected extractJSON(response: string): JsonObject | null;
    /**
     * Simple template substitution for prompts
     */
    protected substituteTemplate(template: string, variables: Record<string, string | string[] | undefined>): string;
    /**
     * Handle conditional template blocks
     */
    protected processConditionals(template: string, conditions: Record<string, boolean>): string;
    /**
     * Extract a numeric score from text response
     * Safe numeric extraction without ReDoS-prone regex
     */
    protected extractNumericScore(text: string): number | null;
    /**
     * Extract a numeric score from text response with fallback
     */
    protected extractScoreFromText(text: string, min?: number, max?: number): number;
}
