interface GuardrailResultInput {
    application_id: string;
    project_id: string;
    guardrail_stage: 'input' | 'output' | string;
    prompt?: string | null;
    response?: string | null;
    latency?: number | null;
    pass: boolean;
    score?: number | null;
    error?: string | null;
    execution_time?: number | null;
    componentResults?: any[] | null;
    app_version?: string | null;
    environment?: string | null;
    metadata?: Record<string, any> | null;
    final_content?: string | null;
    created_at?: string | Date | null;
}
export declare class GuardRailsService {
    private static readonly GUARDRAIL_RESULTS_TABLE;
    private static dayKey;
    private static monthKey;
    private static percentile;
    /**
     * Common function to check guardrails restrictions and send notifications
     * @param params - Parameters for restriction check
     * @returns true if limit reached and should block, false otherwise
     */
    private static checkGuardrailsRestrictions;
    /**
     * Ensure ClickHouse guardrail_results table exists.
     * Safe to call multiple times (uses CREATE TABLE IF NOT EXISTS).
     */
    private static ensureGuardrailResultsTable;
    /**
     * Persist an array of guardrail results into ClickHouse.
     */
    static saveGuardrailResults(results: GuardrailResultInput[], projectId: string, workspaceId: string): Promise<void>;
    /**
     * Fetch guardrail results for an application/project within a time range.
     */
    static fetchGuardrailResults(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
    }): Promise<any[]>;
    /**
     * Aggregate dashboard metrics for Guardrails dashboard widgets.
     * Returns structures matching the mock useGuardRailsDashboard hook.
     * This is an internal helper; public methods below expose per-widget data.
     */
    private static aggregateDashboardMetrics;
    static getTotalRequestsMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        totalRequestsData: {
            timestamp: Date;
            requests: number;
            validations: number;
        }[];
    }>;
    static getLatencyMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        guardrailLatencyData: {
            timestamp: Date;
            inputAvg: number;
            inputP60: number;
            inputP90: number;
            inputP99: number;
            outputAvg: number;
            outputP60: number;
            outputP90: number;
            outputP99: number;
        }[];
    }>;
    static getLatencyHistogramMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        latencyHistogramData: {
            input: number[];
            output: number[];
        };
    }>;
    static getAnalysisMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        summaryData: {
            all: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
            input: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
            output: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
        };
        exceptionsOverTimeData: {
            date: string;
            timestamp: Date;
            input: number;
            output: number;
        }[];
        categoryFailureData: {
            failurePercentage: number;
            name: string;
            type: "input" | "output";
            validationVolume: number;
            failedVolume: number;
        }[];
    }>;
    static getRequestSummaryMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        total: number;
        errors: number;
    }>;
    /**
     * Fetch only summary metrics (totalRequests, validationChecks, exceptions) via lightweight aggregation.
     */
    static getSummaryMetricsOnly(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        summaryData: {
            all: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
            input: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
            output: {
                totalRequests: number;
                validationChecks: number;
                exceptions: number;
                exceptionsPercentage: number;
            };
        };
    }>;
    /**
     * Fetch only exceptions-over-time (by month) via lightweight aggregation.
     */
    static getExceptionsOverTimeOnly(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        exceptionsOverTimeData: {
            month: string;
            timestamp: Date;
            input: number;
            output: number;
        }[];
    }>;
    /**
     * Fetch only category failure metrics via aggregation over component_results.
     */
    static getCategoryFailureMetricsOnly(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        categoryFailureData: {
            name: string;
            type: "input" | "output";
            validationVolume: number;
            failedVolume: number;
            failurePercentage: number;
        }[];
    }>;
    static getLatencyByValidatorMetrics(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
    }): Promise<{
        latencyByValidatorData: {
            validatorName: string;
            stage: string;
            data: Array<{
                timestamp: Date;
                avg: number;
                p60: number;
                p90: number;
                p99: number;
            }>;
            averageLatency: number;
        }[];
    }>;
    static getValidationFailures(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
        search?: string;
        page?: number;
        limit?: number;
        sortBy?: 'recent' | 'oldest' | 'fast_latency' | 'low_latency';
        category?: 'regex' | 'content-safety' | 'blocklist' | string;
        stage?: 'input' | 'output' | string;
        passStatus?: 'success' | 'error' | string;
    }): Promise<{
        total: any;
        page: number;
        limit: number;
        failuresData: {
            id: any;
            created_at: any;
            guardrail_stage: any;
            prompt: any;
            response: any;
            latency: any;
            app_version: any;
            environment: any;
            final_content: any;
            component: any;
            componentResults: any[];
            failedComponents: any[];
        }[];
    }>;
    static getAllValidationFailuresForDownload(params: {
        applicationId: string;
        projectId: string;
        start: string;
        end: string;
        guardrailType?: 'all' | 'input' | 'output' | string;
        version?: string;
        environment?: string;
        search?: string;
        sortBy?: 'recent' | 'oldest' | 'fast_latency' | 'low_latency';
        category?: 'regex' | 'content-safety' | 'blocklist' | string;
        stage?: 'input' | 'output' | string;
    }): Promise<{
        id: any;
        created_at: any;
        guardrail_stage: any;
        prompt: any;
        response: any;
        latency: any;
        app_version: any;
        environment: any;
        final_content: any;
        component: any;
        componentResults: any[];
        failedComponents: any[];
    }[]>;
    static getValidationFailureDetails(params: {
        id: string;
        applicationId: string;
        projectId: string;
    }): Promise<{
        id: any;
        guardrail_stage: any;
        prompt: any;
        response: any;
        latency: any;
        app_version: any;
        environment: any;
        final_content: any;
        created_at: any;
        cost: any;
        allComponents: any[];
    } | null>;
    static getApplicationGaurdRailConfig(applicationId: string, projectId: string, name: string): Promise<{
        id: string;
        application_id: string;
        enable_guard_rails: boolean;
        input_validators: {};
        output_validators: {};
    }>;
}
export {};
//# sourceMappingURL=gaurdRailsService.d.ts.map