Internal
Creates a new DatasetManager instance.
Configuration object containing the API client
Retrieves a dataset by name along with all its items.
This method automatically handles pagination to fetch all dataset items
and enhances each item with a link
function for easy experiment tracking.
The name of the dataset to retrieve
Optional
options: { fetchItemsPageSize: number }Optional configuration for fetching
Number of items to fetch per page (default: 50)
Promise that resolves to the dataset with enhanced items
const dataset = await langfuse.dataset.get("my-dataset");
for (const item of dataset.items) {
// Use the item data for your experiment
const result = await processItem(item.input);
// Link the result to the dataset item
await item.link(
{ otelSpan: currentSpan },
"experiment-run-1",
{ description: "Testing new model" }
);
}
Manager for dataset operations in Langfuse.
Provides methods to retrieve datasets and their items, with automatic pagination handling and convenient linking functionality for experiments.