import Decimal from 'decimal.js';
export declare class DatasetRestrictionError extends Error {
    readonly restrictionType: 'upgrade' | 'lowCredits' | 'lowWalletBalance';
    readonly showToast?: boolean | undefined;
    readonly toastMetadata?: any | undefined;
    constructor(message: string, restrictionType: 'upgrade' | 'lowCredits' | 'lowWalletBalance', showToast?: boolean | undefined, toastMetadata?: any | undefined);
}
export interface GenerateDatasetFromPromptsParams {
    promptLibraryId?: string;
    tests: any[];
    provider?: string;
    instructions: string;
    numSamples: number;
    prompt?: any;
    fields: any[];
    language?: string;
    orgId: string;
    workspaceId: string;
    datasetId?: string;
    /**
     * Optional: include recent previously-generated dataset rows to encourage variety.
     * Only used by evaluation-time generation; normal dataset generation should omit this.
     */
    previousDatasetGenerated?: any[];
}
export interface GenerateDatasetFromDocumentsParams {
    documentPaths: string[];
    includeExpectedOutput: boolean;
    numSamples: number;
    orgId: string;
    projectId: string;
}
export interface SaveDatasetRecordsParams {
    datasetId: string;
    data: any[];
    orgId: string;
    projectId: string;
    append?: boolean;
}
export interface MapTestRunToDatasetRecordsParams {
    testRunId: string;
    datasetId: string;
    datasetRecordIds: string[];
}
export declare class DatasetService {
    private applyVoiceFieldsToGeneratedDatasetRows;
    /**
     * Validate workspace restrictions for dataset generation
     * Throws DatasetRestrictionError if restrictions are not met
     */
    validateDatasetRestrictions(orgId: string): Promise<void>;
    /**
     * Generate dataset from prompts/tests using synthesis
     */
    generateDatasetFromPrompts(params: GenerateDatasetFromPromptsParams, options?: {
        skipRestrictions?: boolean;
    }): Promise<{
        testCaseVars: any[];
        totalRows: number;
        personas: string[];
        tokenUsages: {
            cost: Decimal;
            tokenUsage: {
                prompt: Decimal;
                completion: Decimal;
                total: Decimal;
                cached: Decimal;
            };
        };
    }>;
    /**
     * Save dataset records to the database
     */
    saveDatasetRecords(params: SaveDatasetRecordsParams): Promise<string[]>;
    /**
     * Map test run to dataset records
     */
    mapTestRunToDatasetRecords(params: MapTestRunToDatasetRecordsParams): Promise<void>;
    /**
     * Generate dataset for a dataset with generateOnEvaluation = true
     * This is used when a test run needs to generate a dataset on-the-fly
     * Throws DatasetRestrictionError if restrictions are not met
     */
    generateDatasetForEvaluation(params: {
        datasetId: string;
        datasetConfig: any;
        orgId: string;
        projectId: string;
        token?: string | string[];
        apiKey?: string;
        prompts?: any[];
        fieldsToGenerate?: string[];
        /** When true with maxGeneratedRows, trims rows to the conversation builder test count. */
        fromConversationBuilder?: boolean;
        maxGeneratedRows?: number;
    }): Promise<{
        datasetRecordIds: string[];
        data: any[];
    }>;
    /**
     * Get dataset records for a dataset
     */
    getDatasetRecords(datasetId: string): Promise<any[]>;
}
export declare const datasetService: DatasetService;
//# sourceMappingURL=datasetService.d.ts.map