# Datasets (*datasets*) ## Overview ### Available Operations * [getDatasets](#getdatasets) - Get datasets * [createDataset](#createdataset) - Create a dataset * [updateDataset](#updatedataset) - Update a dataset * [deleteDataset](#deletedataset) - Delete a dataset * [addDatapoints](#adddatapoints) - Add datapoints to a dataset ## getDatasets Get datasets ### Example Usage ```typescript import { HoneyHive } from "honeyhive"; const honeyHive = new HoneyHive({ bearerAuth: "", }); async function run() { const result = await honeyHive.datasets.getDatasets(""); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { HoneyHiveCore } from "honeyhive/core.js"; import { datasetsGetDatasets } from "honeyhive/funcs/datasetsGetDatasets.js"; // Use `HoneyHiveCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const honeyHive = new HoneyHiveCore({ bearerAuth: "", }); async function run() { const res = await datasetsGetDatasets(honeyHive, ""); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `project` | *string* | :heavy_check_mark: | Project Name associated with the datasets like `New Project` | | `type` | [operations.Type](../../models/operations/type.md) | :heavy_minus_sign: | Type of the dataset - "evaluation" or "fine-tuning" | | `datasetId` | *string* | :heavy_minus_sign: | Unique dataset ID for filtering specific dataset like `663876ec4611c47f4970f0c3` | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetDatasetsResponseBody](../../models/operations/getdatasetsresponsebody.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## createDataset Create a dataset ### Example Usage ```typescript import { HoneyHive } from "honeyhive"; const honeyHive = new HoneyHive({ bearerAuth: "", }); async function run() { const result = await honeyHive.datasets.createDataset({ project: "New Project", name: "test-dataset", description: "A test dataset", type: "evaluation", datapoints: [ "66369748b5773befbdc661e2", ], linkedEvals: [ ], saved: false, pipelineType: "event", metadata: { "source": "dev", }, }); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { HoneyHiveCore } from "honeyhive/core.js"; import { datasetsCreateDataset } from "honeyhive/funcs/datasetsCreateDataset.js"; // Use `HoneyHiveCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const honeyHive = new HoneyHiveCore({ bearerAuth: "", }); async function run() { const res = await datasetsCreateDataset(honeyHive, { project: "New Project", name: "test-dataset", description: "A test dataset", type: "evaluation", datapoints: [ "66369748b5773befbdc661e2", ], linkedEvals: [ ], saved: false, pipelineType: "event", metadata: { "source": "dev", }, }); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [components.CreateDatasetRequest](../../models/components/createdatasetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateDatasetResponseBody](../../models/operations/createdatasetresponsebody.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## updateDataset Update a dataset ### Example Usage ```typescript import { HoneyHive } from "honeyhive"; const honeyHive = new HoneyHive({ bearerAuth: "", }); async function run() { await honeyHive.datasets.updateDataset({ datasetId: "663876ec4611c47f4970f0c3", name: "new-dataset-name", description: "An updated dataset description", datapoints: [ "66369748b5773befbdc661e", ], linkedEvals: [ "66369748b5773befbdasdk1", ], metadata: { "updated": true, "source": "prod", }, }); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { HoneyHiveCore } from "honeyhive/core.js"; import { datasetsUpdateDataset } from "honeyhive/funcs/datasetsUpdateDataset.js"; // Use `HoneyHiveCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const honeyHive = new HoneyHiveCore({ bearerAuth: "", }); async function run() { const res = await datasetsUpdateDataset(honeyHive, { datasetId: "663876ec4611c47f4970f0c3", name: "new-dataset-name", description: "An updated dataset description", datapoints: [ "66369748b5773befbdc661e", ], linkedEvals: [ "66369748b5773befbdasdk1", ], metadata: { "updated": true, "source": "prod", }, }); if (!res.ok) { throw res.error; } const { value: result } = res; } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [components.DatasetUpdate](../../models/components/datasetupdate.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## deleteDataset Delete a dataset ### Example Usage ```typescript import { HoneyHive } from "honeyhive"; const honeyHive = new HoneyHive({ bearerAuth: "", }); async function run() { await honeyHive.datasets.deleteDataset(""); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { HoneyHiveCore } from "honeyhive/core.js"; import { datasetsDeleteDataset } from "honeyhive/funcs/datasetsDeleteDataset.js"; // Use `HoneyHiveCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const honeyHive = new HoneyHiveCore({ bearerAuth: "", }); async function run() { const res = await datasetsDeleteDataset(honeyHive, ""); if (!res.ok) { throw res.error; } const { value: result } = res; } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `datasetId` | *string* | :heavy_check_mark: | The unique identifier of the dataset to be deleted like `663876ec4611c47f4970f0c3` | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## addDatapoints Add datapoints to a dataset ### Example Usage ```typescript import { HoneyHive } from "honeyhive"; const honeyHive = new HoneyHive({ bearerAuth: "", }); async function run() { const result = await honeyHive.datasets.addDatapoints({ project: "", data: [ { "key": "", "key1": "", "key2": "", }, ], mapping: { inputs: [ ], groundTruth: [ "", "", ], history: [ ], }, }, ""); // Handle the result console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { HoneyHiveCore } from "honeyhive/core.js"; import { datasetsAddDatapoints } from "honeyhive/funcs/datasetsAddDatapoints.js"; // Use `HoneyHiveCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const honeyHive = new HoneyHiveCore({ bearerAuth: "", }); async function run() { const res = await datasetsAddDatapoints(honeyHive, { project: "", data: [ { "key": "", "key1": "", "key2": "", }, ], mapping: { inputs: [ ], groundTruth: [ "", "", ], history: [ ], }, }, ""); if (!res.ok) { throw res.error; } const { value: result } = res; // Handle the result console.log(result); } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `datasetId` | *string* | :heavy_check_mark: | The unique identifier of the dataset to add datapoints to like `663876ec4611c47f4970f0c3` | | `requestBody` | [operations.AddDatapointsRequestBody](../../models/operations/adddatapointsrequestbody.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.AddDatapointsResponseBody](../../models/operations/adddatapointsresponsebody.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* |