Package com.google.genkit.ai.evaluation
Class LocalFileDatasetStore
java.lang.Object
com.google.genkit.ai.evaluation.LocalFileDatasetStore
- All Implemented Interfaces:
DatasetStore
File-based implementation of DatasetStore.
Stores datasets in the .genkit/datasets directory with:
- index.json - metadata for all datasets
- {datasetId}.json - actual dataset data
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LocalFileDatasetStore using the default location.LocalFileDatasetStore(Path storeRoot) Creates a new LocalFileDatasetStore with a custom root path. -
Method Summary
Modifier and TypeMethodDescriptioncreateDataset(CreateDatasetRequest request) Creates a new dataset.voiddeleteDataset(String datasetId) Deletes a dataset.getDataset(String datasetId) Gets the data for a dataset.static LocalFileDatasetStoreGets the singleton instance of the dataset store.Lists all datasets.updateDataset(UpdateDatasetRequest request) Updates an existing dataset.
-
Constructor Details
-
LocalFileDatasetStore
public LocalFileDatasetStore()Creates a new LocalFileDatasetStore using the default location. -
LocalFileDatasetStore
Creates a new LocalFileDatasetStore with a custom root path.- Parameters:
storeRoot- the root directory for storing datasets
-
-
Method Details
-
getInstance
Gets the singleton instance of the dataset store.- Returns:
- the dataset store instance
-
createDataset
Description copied from interface:DatasetStoreCreates a new dataset.- Specified by:
createDatasetin interfaceDatasetStore- Parameters:
request- the create request containing dataset data and metadata- Returns:
- metadata about the created dataset
- Throws:
Exception- if creation fails
-
updateDataset
Description copied from interface:DatasetStoreUpdates an existing dataset.- Specified by:
updateDatasetin interfaceDatasetStore- Parameters:
request- the update request containing dataset ID and new data- Returns:
- metadata about the updated dataset
- Throws:
Exception- if update fails or dataset not found
-
getDataset
Description copied from interface:DatasetStoreGets the data for a dataset.- Specified by:
getDatasetin interfaceDatasetStore- Parameters:
datasetId- the dataset ID- Returns:
- the list of dataset samples
- Throws:
Exception- if retrieval fails or dataset not found
-
listDatasets
Description copied from interface:DatasetStoreLists all datasets.- Specified by:
listDatasetsin interfaceDatasetStore- Returns:
- list of dataset metadata
- Throws:
Exception- if listing fails
-
deleteDataset
Description copied from interface:DatasetStoreDeletes a dataset.- Specified by:
deleteDatasetin interfaceDatasetStore- Parameters:
datasetId- the dataset ID to delete- Throws:
Exception- if deletion fails
-