Dataset
type Dataset = {
id: string;
createdAt: string;
name?: Maybe<string>;
description?: Maybe<string>;
metadata: Record<string, any>;
items?: Maybe<DatasetItem[]>;
}
The unique identifier of the dataset. This is an immutable field generated when the dataset is created.
The date and time when the dataset was created, expressed in ISO 8601 format.
A dictionary containing additional data associated with the dataset. This can include user-defined key-value pairs that provide more context or details about the dataset.
An optional name for the dataset. This can be used to give a descriptive, human-readable title to the dataset for easier identification.
An optional description field that can provide more detailed information about the dataset, such as its purpose, contents, or specific characteristics.
An optional list of items contained within the dataset. Each item in the list is a dictionary representing a specific data entry in the dataset.
Create a dataset
const dataset = await client.api.createDataset({
name: "Foo",
description: "A dataset to store samples.",
metadata: { isDemo: true },
});
Params
A partial representation of a dataset.
An optional name for the dataset. This can be used to give a descriptive, human-readable title to the dataset for easier identification.
An optional description field that can provide more detailed information about the dataset, such as its purpose, contents, or specific characteristics.
dataset.metadata
Maybe<Record<string, any>>
A dictionary containing additional data associated with the dataset. This can include user-defined key-value pairs that provide more context or details about the dataset.
Response
Update a dataset
const dataset = await client.api.updateDataset("dataset_id", {
name: "Baz",
});
Params
The unique identifier of the dataset. This is an immutable field generated when the dataset is created.
A partial representation of a dataset.
An optional name for the dataset. This can be used to give a descriptive, human-readable title to the dataset for easier identification.
An optional description field that can provide more detailed information about the dataset, such as its purpose, contents, or specific characteristics.
dataset.metadata
Maybe<Record<string, any>>
A dictionary containing additional data associated with the dataset. This can include user-defined key-value pairs that provide more context or details about the dataset.
Response
Get a dataset
const dataset = await client.api.getDataset("dataset_id")
Params
The unique identifier of the dataset. This is an immutable field generated when the dataset is created.
Response
Delete a dataset
await client.api.deleteDataset("dataset_id")
Params
The unique identifier of the dataset. This is an immutable field generated when the dataset is created.
Response
DatasetItem
type DatasetItem = {
id: string;
createdAt: string;
datasetId: string;
metadata: Record<string, any>;
input: Record<string, any>;
expectedOutput?: Maybe<Record<string, any>>;
intermediarySteps: Record<string, any>[];
}
The unique identifier of the dataset item. Each item within a dataset has its own unique ID.
The date and time when the dataset item was created, expressed in ISO 8601 format.
The identifier of the dataset to which this item belongs. Links the item to its parent dataset.
A dictionary containing additional data associated with this dataset item. This can include specific details relevant to the item.
The input data for this dataset item. Typically contains the parameters or information that forms the LLM request.
expectedOutput
Maybe<Record<string, any>>
The optional output data for this dataset item. Represents the result or outcome associated with the item’s input.
An optional list of intermediary steps involved in the output. This can include any processing steps or intermediate results. They are automatically generated when using “steps” to build a dataset.
Create a dataset item
const datasetItem = await client.api.createDatasetItem("dataset_id", {
input: { content: "What is Literal?" },
expectedOutput: { content: "Literal is an observability solution." },
});
# Or directly through a Dataset
const datasetItem = await dataset.createDatasetItem("dataset_id", {
input: { content: "What is Literal?" },
expectedOutput: { content: "Literal is an observability solution." },
});
Params
The identifier of the dataset to which this item belongs.
A partial representation of a dataset item.
The input data for this dataset item. Typically contains the parameters or information that forms the LLM request.
datasetItem.expectedOutput
Maybe<Record<string, any>>
The optional output data for this dataset item. Represents the result or outcome associated with the item’s input.
datasetItem.metadata
Maybe<Record<string, any>>
A dictionary containing additional data associated with this dataset item. This can include specific details relevant to the item.
Response
Add a step to a dataset
const datasetItem = await client.api.addStepToDataset("dataset_id", "step_id");
# Or directly through a Dataset
const datasetItem = await dataset.addStepToDataset("dataset_id", "step_id");
Params
The identifier of the dataset to which this item belongs.
The identifier of the step created beforehand.
metadata
Maybe<Record<string, any>>
A dictionary containing additional data associated with this dataset item. This can include specific details relevant to the item.
Response
Get a dataset item
const datasetItem = await client.api.getDatasetItem("dataset_item_id");
Params
The unique identifier of the dataset item. Each item within a dataset has its own unique ID.
Response
Delete a dataset item
await client.api.deleteDatasetItem("dataset_item_id");
# Or directly through a Dataset
await dataset.deleteDatasetItem("dataset_item_id");
Params
The unique identifier of the dataset item. Each item within a dataset has its own unique ID.
Response