import type { DatasetDBType, DatasetRecord, DatasetRecordOptions, DatasetVersionHistory, DatasetContent, DatasetProject, DatasetType, DatasetRow, SyntheticDatasetExtensionRequest, CreateDatasetOptions } from '../types/dataset.types'; import { RunExperimentParams } from './experiments'; import { Dataset, Datasets } from '../entities/datasets'; export { Dataset, Datasets }; /** * Creates a normalized dataset record from the provided options. * @param options - The options used to create the dataset record. * @param options.id - (Optional) The unique identifier of the record. * @param options.input - The input value to serialize into the record. * @param options.output - (Optional) The output / ground truth value. * @param options.groundTruth - (Optional) Alias for output. If both are provided, output takes precedence. * @param options.generatedOutput - (Optional) The model-generated output value. * @param options.metadata - (Optional) Additional metadata for the record as a string or object. * @returns The normalized dataset record. * @internal Used by dataset helpers; not part of the public API. */ export declare function createDatasetRecord(options: DatasetRecordOptions): DatasetRecord; /** * Deserializes a JSON string into an object, with a fallback for non-JSON values. * @param value - (Optional) The string value to deserialize. * @returns An object parsed from JSON, an object wrapping the raw value, or an empty object. */ export declare function deserializeInputFromString(value?: string): Record; /** * Converts an array of raw record objects into dataset records. * @param recordsArray - The raw records to convert. * @returns The list of dataset records created from the raw records. * @internal Used by Datasets.loadDatasetAndRecords; not part of the public API. */ export declare function getDatasetRecordsFromArray(recordsArray: Record[]): DatasetRecord[]; /** * @overload * Lists all datasets. * @returns A promise that resolves to the list of datasets. */ export declare function getDatasets(): Promise; /** * @overload * Lists datasets with optional filtering by project. * @param options - (Optional) Options for listing datasets. * @param options.limit - (Optional) The maximum number of datasets to return. * @param options.projectId - (Optional) The ID of the project that uses the datasets. * @param options.projectName - (Optional) The name of the project that uses the datasets. * @returns A promise that resolves to the list of datasets. */ export declare function getDatasets(options: { limit?: number; projectId?: string; projectName?: string; }): Promise; /** * @overload * Creates a new dataset from content and a name. * @param dataset - The dataset content as a path, object, or array. * @param name - The name of the dataset. * @returns A promise that resolves to the created dataset. */ export declare function createDataset(dataset: DatasetType, name: string): Promise; /** * @overload * Creates a new dataset from an options object. * @param options - The options used to create the dataset. * @param options.name - The name of the dataset. * @param options.content - The dataset content as a path, object, or array. * @param options.projectId - (Optional) The ID of the project that will use the dataset. * @param options.projectName - (Optional) The name of the project that will use the dataset. * @returns A promise that resolves to the created dataset. */ export declare function createDataset(options: CreateDatasetOptions): Promise; /** * Gets a dataset database record by ID or name with optional content loading and project validation. * Delegates to Datasets.get(). * @param options - The options used to locate the dataset. * @param options.id - (Optional) The ID of the dataset. * @param options.name - (Optional) The name of the dataset. * @param options.withContent - (Optional) Whether to load the dataset content. * @param options.projectId - (Optional) The ID of the project to validate against. * @param options.projectName - (Optional) The name of the project to validate against. * @returns A promise that resolves to the dataset database object. */ export declare function getDataset(options: { id?: string; name?: string; withContent?: boolean; projectId?: string; projectName?: string; }): Promise; /** * Gets dataset content for a dataset identified by ID or name. * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the rows of the dataset. */ export declare function getDatasetContent(options: { datasetId?: string; datasetName?: string; }): Promise; /** * Appends rows to a dataset identified by ID or name. * Delegates to Dataset.addRows(). * @param options - The options used to locate the dataset and rows to append. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @param options.rows - The rows to append to the dataset. * @returns A promise that resolves when the rows have been appended. */ export declare function addRowsToDataset(options: { datasetId?: string; datasetName?: string; rows: Record | null>[]; }): Promise; /** * Deletes a dataset by its unique identifier or name. * Delegates to Datasets.delete(). * @param options - The options used to locate the dataset. * @param options.id - (Optional) The ID of the dataset. * @param options.name - (Optional) The name of the dataset. * @param options.projectId - (Optional) The ID of the project to validate against. * @param options.projectName - (Optional) The name of the project to validate against. * @returns A promise that resolves when the dataset has been deleted. */ export declare function deleteDataset(options: { id?: string; name?: string; projectId?: string; projectName?: string; }): Promise; /** * Loads dataset and records based on provided parameters. * Supports flexible input types matching Python's load_dataset_and_records(). * Delegates to Datasets.loadDatasetAndRecords() static method. * * Priority order: * 1. datasetId (explicit ID) * 2. datasetName (explicit name) * 3. dataset as string (interpreted as name) * 4. dataset as Dataset object * 5. dataset as array of records * * @param options - Dataset loading options * @param options.dataset - Dataset object, array of records, or dataset name (string) * @param options.datasetId - Optional explicit dataset ID * @param options.datasetName - Optional explicit dataset name * @param options.projectName - Optional project name for dataset lookup * @returns Promise resolving to tuple of [Dataset | null, DatasetRecord[]] * @throws Error if no valid dataset information is provided */ export declare function loadDatasetAndRecords(options: { dataset?: DatasetDBType | Record[] | string; datasetId?: string; datasetName?: string; projectName?: string; }): Promise<[Dataset | null, DatasetRecord[]]>; /** * Gets dataset metadata from experiment params. * Delegates to Datasets.get() for fetching by id or name. * Supports string shortcuts (dataset as string interpreted as name). * @param params - Experiment parameters that may contain a dataset reference. * @param projectName - Project name used for dataset lookup when needed. * @returns A promise that resolves to the dataset or null if not found. */ export declare function getDatasetMetadata>(params: RunExperimentParams, projectName: string): Promise; /** * Extends a dataset with synthetically generated data based on the provided parameters. * Delegates to Datasets.extend(). * @param params - Configuration for synthetic data generation. * @returns A promise that resolves to the generated dataset rows. */ export declare function extendDataset(params: SyntheticDatasetExtensionRequest): Promise; /** * Gets the version history of a dataset. * Delegates to Datasets.getVersionHistory(). * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the version history for the dataset. */ export declare function getDatasetVersionHistory(options: { datasetId?: string; datasetName?: string; }): Promise; /** * Gets a specific version of a dataset. * Delegates to Datasets.getVersion(). * @param options - The options used to locate the dataset version. * @param options.versionIndex - The version index to retrieve. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the dataset content at the specified version. */ export declare function getDatasetVersion(options: { versionIndex: number; datasetId?: string; datasetName?: string; }): Promise; /** * Lists all projects that use a dataset. * Delegates to Datasets.listProjects(). * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @param options.limit - (Optional) The maximum number of projects to return. * @returns A promise that resolves to the list of projects that use the dataset. */ export declare function listDatasetProjects(options: { datasetId?: string; datasetName?: string; limit?: number; }): Promise; /** * Converts a dataset row to a dataset record. * @param datasetRow - The dataset row to convert. * @returns The dataset record created from the row. */ export declare function convertDatasetRowToRecord(datasetRow: DatasetRow): DatasetRecord;