A synchronous, in-memory implementation of DatasetStore backed by mutable Scala maps.
Intended for unit tests and local experimentation. All public methods are synchronized on the store instance to provide basic thread safety within a single JVM.
Obtain an instance via the companion object factory:
val store = InMemoryDatasetStore()
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Value parameters
- datasetId
-
target dataset
- input
-
model input value
- metadata
-
arbitrary string annotations
- referenceOutput
-
optional ground-truth output
- tags
-
example-level labels for filtering
Attributes
- Definition Classes
Creates a new dataset and returns its generated DatasetId.
Creates a new dataset and returns its generated DatasetId.
Value parameters
- description
-
purpose of the dataset
- inputSchema
-
optional JSON Schema for input validation
- name
-
human-readable name
- outputSchema
-
optional JSON Schema for output validation
- tags
-
dataset-level labels
Attributes
- Definition Classes
Creates an immutable snapshot of the dataset's current examples.
Creates an immutable snapshot of the dataset's current examples.
The snapshot is unaffected by subsequent calls to addExample or delete.
Attributes
- Returns
-
the SnapshotId of the newly created snapshot
- Definition Classes
Deletes the dataset along with all its examples and snapshots.
Deletes the dataset along with all its examples and snapshots.
Attributes
- Returns
-
trueif the dataset existed and was removed,falseif it was not found - Definition Classes
Exports all examples in the dataset as a JSONL iterator.
Exports all examples in the dataset as a JSONL iterator.
Each element is a compact JSON string produced by JsonlCodec.encode. The iterator reflects the dataset state at the moment this method is called; concurrent mutations are not reflected in the returned iterator.
Attributes
- Definition Classes
Returns the full Dataset record for the given ID, or None if it does not exist. The returned dataset's examples field reflects the current state of all examples.
Returns the full Dataset record for the given ID, or None if it does not exist. The returned dataset's examples field reflects the current state of all examples.
Attributes
- Definition Classes
Retrieves examples from the dataset according to the given ExampleSelector.
Retrieves examples from the dataset according to the given ExampleSelector.
Value parameters
- datasetId
-
target dataset
- selector
-
All,ByTags, orByIds— see ExampleSelector
Attributes
- Definition Classes
Retrieves a previously created DatasetSnapshot, or None if the ID is unknown (e.g. because the originating dataset was deleted).
Retrieves a previously created DatasetSnapshot, or None if the ID is unknown (e.g. because the originating dataset was deleted).
Attributes
- Definition Classes
Imports examples from a JSONL stream into the dataset.
Imports examples from a JSONL stream into the dataset.
Each line is decoded with JsonlCodec.decode; lines that fail to parse are silently skipped.
Value parameters
- datasetId
-
target dataset
- lines
-
iterator of raw JSONL strings (one JSON object per element)
Attributes
- Returns
-
(imported, skipped)counts - Definition Classes
Returns all datasets currently held in the store (examples field included).
Returns all datasets currently held in the store (examples field included).
Attributes
- Definition Classes