Dataset providers¶
A dataset's type picks one of these; its config is the provider's
arguments, plus the templates and schemas every provider takes.
Dataset ¶
Dataset(input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=None, limit: int = None, repeat: int = 1, **kwargs)
The engine's streaming Dataset, with every hand-written schema closed at the door.
Everything is the base class': _iter_rows() to implement, the three
Jinja2 templates over a row (input_template, output_template and
tools_template, the row's own tool declarations as a Chat Completions
request carries them, with row_schema the row's shape without them),
limit, repeat, batch_size, the (x, y) batches. Two differences.
_close_objects: an input_schema or output_schema written by hand
is marked closed, object by object, before the base class reads it. And
the templates are compiled in the engine's JINJA, as RowTemplates:
each sees the whole row as row beside its columns, and has fromjson,
fromliteral, as_image and as_audio.
HuggingFaceDataset ¶
HuggingFaceDataset(path, *, name=None, split=None, revision=None, streaming=True, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1, **kwargs)
A HuggingFace datasets source: a public benchmark, or a team dataset on the Hub.
The library's own loader, behind the engine's door: the rows are what
datasets.load_dataset yields, every split in order when no split
is named, and a hand-written schema is closed before it is read. Any
other key goes to load_dataset (data_files, token, ...).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The dataset repo or builder name. |
required |
name
|
str
|
Optional. The configuration (subset). |
None
|
split
|
str
|
Optional. The split; every split in order when None. |
None
|
revision
|
str
|
Optional. A commit, branch or tag to pin the rows to. |
None
|
streaming
|
bool
|
Download the rows on demand (the default); False
downloads the dataset, which is also when its length is known
without a |
True
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
**kwargs
|
Forwarded to |
{}
|
LocalDataset ¶
LocalDataset(path, *, format=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A local file: a JSON list, JSONL, CSV or Parquet.
The format is read off the file's extension (.json, .jsonl,
.ndjson, .csv, .tsv, .parquet) unless format says. Each row
is handed to the templates as a mapping of its columns; a CSV's values
are all strings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The file. |
required |
format
|
str
|
Optional. |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
check ¶
Read the whole file and say what is wrong with it, before a run does; returns its row count.
FolderDataset ¶
FolderDataset(path, *, pattern='*', recursive=False, format=None, encoding='utf-8', input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A folder where each file is one record.
Files are read in name order. A .json, .yaml or .yml file is
parsed: a mapping's keys are the record's own fields, any other value
is handed over whole as record. A .txt or .md file, and any file
when format is text, is handed over as text. Every record also
carries _filename, _stem and _path (relative to the folder,
posix-style).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The folder. |
required |
pattern
|
str
|
The glob the files must match. Defaults to |
'*'
|
recursive
|
bool
|
Walk the subfolders too. Defaults to False. |
False
|
format
|
str
|
Optional. |
None
|
encoding
|
str
|
The files' text encoding. Defaults to |
'utf-8'
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
MLflowDataset ¶
MLflowDataset(name=None, *, dataset_id=None, tracking_uri=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit=None, repeat=1)
An MLflow evaluation dataset.
The library's own loader, behind the engine's door, read from the
arena's MLflow source server: MLFLOW_SOURCE_TRACKING_URI unless
tracking_uri says. Fields, templates and records are the library's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The dataset's name; or give |
None
|
dataset_id
|
str
|
Optional. The dataset's id, instead of its name. |
None
|
tracking_uri
|
str
|
Optional. The MLflow server to read from. |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
list_datasets
classmethod
¶
The datasets on the source server whose name holds query; see PlatformDataset.list_datasets.
LangfuseDataset ¶
LangfuseDataset(dataset_name, *, version=None, streaming=True, page_size=50, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A Langfuse dataset.
See https://langfuse.com/docs/evaluation/experiments/datasets. Each
item is handed to the templates as input, expected_output,
metadata and id. Auth comes from the environment
(LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
The Langfuse dataset name. |
required |
version
|
str | datetime
|
Optional. The UTC point in time to pin the
items to: Langfuse versions a dataset by timestamp, so an ISO 8601
string ( |
None
|
streaming
|
bool
|
Read the items page by page as the rows are
iterated (the default), or the whole dataset at once
( |
True
|
page_size
|
int
|
Items per page when streaming. Defaults to 50, the SDK's own default. |
50
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
LangSmithDataset ¶
LangSmithDataset(dataset_name, *, as_of=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A LangSmith dataset.
See https://docs.smith.langchain.com/evaluation/concepts#datasets. Each
example is handed to the templates as inputs, outputs, metadata
(each a mapping, empty when the example has none) and id. Auth comes
from the environment (LANGSMITH_API_KEY, LANGSMITH_ENDPOINT).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
The LangSmith dataset name. |
required |
as_of
|
str | datetime
|
Optional. A version tag ( |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
DatadogDataset ¶
DatadogDataset(dataset_name, *, project_name=None, version: int = None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A Datadog Agent Observability (LLM Observability) dataset.
See https://docs.datadoghq.com/llm_observability/experiments/datasets/.
Read over Datadog's REST API, no SDK: the project and the dataset are
found by name, never created, and the records are paged. Each record is
handed to the templates as input_data, expected_output, metadata
(a mapping, empty when the record has none) and id, ddtrace's names.
Auth comes from the environment: DD_API_KEY, DD_APP_KEY and
DD_SITE (datadoghq.com by default).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
The Datadog dataset name. |
required |
project_name
|
str
|
Optional. The project that holds the dataset.
Defaults to |
None
|
version
|
int
|
Optional. The dataset version to read. None reads the current one. |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Records per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
list_datasets
classmethod
¶
The datasets of the configured project (DD_LLMOBS_PROJECT_NAME, else default-project); see PlatformDataset.
OpikDataset ¶
OpikDataset(dataset_name, *, version=None, filter_string=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
An Opik (Comet) dataset.
See https://www.comet.com/docs/opik/evaluation/manage_datasets. Each
item is handed to the templates as the mapping Opik keeps: input,
expected_output, metadata, id, and any custom field added at
insertion. Auth comes from the environment (OPIK_API_KEY,
OPIK_WORKSPACE, OPIK_URL_OVERRIDE).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
The Opik dataset name. |
required |
version
|
str
|
Optional. A version name ( |
None
|
filter_string
|
str
|
Optional. An Opik OQL filter, applied on the
server ( |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
PhoenixDataset ¶
PhoenixDataset(dataset_name, *, version_id=None, splits=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
An Arize Phoenix dataset.
See https://docs.arize.com/phoenix/datasets-and-experiments. Each
example is handed to the templates as id, input, output and
metadata (each a mapping, empty when the example has none). Auth
comes from the environment (PHOENIX_API_KEY, and
PHOENIX_COLLECTOR_ENDPOINT or PHOENIX_HOST + PHOENIX_PORT).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
The Phoenix dataset name, or its id. |
required |
version_id
|
str
|
Optional. The version to read. None reads the latest. |
None
|
splits
|
list
|
Optional. The split names to keep. |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
BraintrustDataset ¶
BraintrustDataset(project=None, dataset_name=None, *, version=None, project_id=None, org_name=None, fetch_batch_size=None, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A Braintrust dataset.
See https://www.braintrust.dev/docs/guides/datasets. Each record is
handed to the templates as id, input, expected and metadata
(a mapping, empty when the record has none). Auth comes from the
environment (BRAINTRUST_API_KEY, and BRAINTRUST_APP_URL,
BRAINTRUST_ORG_NAME when needed).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
str
|
The Braintrust project name; or give |
None
|
dataset_name
|
str
|
The dataset's name within the project. |
None
|
version
|
str | int
|
Optional. A transaction id to pin the records to. None reads the latest state. |
None
|
project_id
|
str
|
Optional. The project's UUID, instead of its
name; wins over |
None
|
org_name
|
str
|
Optional. The organization, for a user in several.
Falls back to |
None
|
fetch_batch_size
|
int
|
Optional. Records per request to the API; the SDK's own default when unset. |
None
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
UnityCatalogDataset ¶
UnityCatalogDataset(table, *, version=None, as_of=None, storage_path=None, read_batch_size=10000, input_data_model=None, input_schema=None, input_template=None, output_data_model=None, output_schema=None, output_template=None, tools_template=None, batch_size=1, limit: int = None, repeat: int = 1)
A Delta or Parquet table governed by Unity Catalog (Databricks or OSS).
Each row of the table is handed to the templates as a mapping of its
columns. The table is found through the catalog's REST API (its
storage location, its version token), then read from object storage
with deltalake and pyarrow, record batch by record batch, so the
table never has to fit in memory. The catalog is reached with
UNITY_CATALOG_API_URL and UC_TOKEN; the storage with
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
(fr-par unless set) and, for an S3-compatible store, S3_ENDPOINT.
What the catalog said of the table is kept in metadata, for the run
to record where its rows came from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str
|
The table, fully qualified: |
required |
version
|
int
|
Optional. The Delta version to read. Not with
|
None
|
as_of
|
str
|
Optional. The UTC time (ISO 8601) to read the Delta
table as of. Not with |
None
|
storage_path
|
str
|
Optional. Where the table's files are
( |
None
|
read_batch_size
|
int
|
Rows per record batch read from storage.
Defaults to 10,000. Not the run's |
10000
|
input_data_model
|
DataModel
|
See |
None
|
input_schema
|
dict | str
|
See |
None
|
input_template
|
str
|
See |
None
|
output_data_model
|
DataModel
|
See |
None
|
output_schema
|
dict | str
|
See |
None
|
output_template
|
str
|
See |
None
|
tools_template
|
str
|
See |
None
|
batch_size
|
int
|
Examples per yielded batch. Defaults to 1. |
1
|
limit
|
int
|
Optional. See |
None
|
repeat
|
int
|
See |
1
|
HarborTasksDataset ¶
HarborTasksDataset(path, *, tasks=None, batch_size=1, limit: int = None, repeat: int = 1, **ignored)
Harbor task folders, one row each.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The folder holding the tasks, one sub-folder each. |
required |
tasks
|
list
|
Optional. The tasks to run, by folder name; none runs every task under |
None
|
batch_size
|
int
|
Tasks run at once. |
1
|
limit
|
int
|
Optional. At most this many tasks. |
None
|
repeat
|
int
|
Optional. Each task this many times. |
1
|