@gentrace/core
Version:
Core Gentrace Node.JS library
42 lines (41 loc) • 1.98 kB
TypeScript
import { CreateDatasetV2, DatasetV2, UpdateDatasetV2 } from "../models";
/**
* Retrieves datasets from the Gentrace API.
* @async
* @param {Object} [params] - Optional parameters to filter the datasets.
* @param {string} [params.pipelineSlug] - The slug of the pipeline to filter datasets by.
* @param {string} [params.pipelineId] - The ID of the pipeline to filter datasets by.
* @param {boolean} [params.archived] - Filter datasets by archived status.
* @returns {Promise<Array<DatasetV2>>} - A promise that resolves to an array of datasets.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getDatasets: (params?: {
pipelineSlug?: string;
pipelineId?: string;
archived?: boolean;
}) => Promise<DatasetV2[]>;
/**
* Creates a new dataset in the Gentrace API.
* @async
* @param {CreateDatasetV2} payload - The dataset creation payload.
* @returns {Promise<DatasetV2>} - A promise that resolves to the created dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const createDataset: (payload: CreateDatasetV2) => Promise<DatasetV2>;
/**
* Retrieves a single dataset from the Gentrace API.
* @async
* @param {string} id - The ID of the dataset to retrieve.
* @returns {Promise<DatasetV2>} - A promise that resolves to the retrieved dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getDataset: (id: string) => Promise<DatasetV2>;
/**
* Updates a dataset in the Gentrace API.
* @async
* @param {string} id - The ID of the dataset to update.
* @param {UpdateDatasetV2} payload - The dataset update payload.
* @returns {Promise<DatasetV2>} - A promise that resolves to the updated dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const updateDataset: (id: string, payload: UpdateDatasetV2) => Promise<DatasetV2>;