Skip to main content
The data loader module provides a standard way to feed evaluation data into tests. Use it to:
  • Build reusable input sources (adapters, files, generators)
  • Parameterize datasets with clear variant labeling
  • Preprocess inputs consistently (e.g., expand multi-turn data)

Components

DynamicDataLoader

Uses callables that return lists of EvaluationRow. Each callable becomes a labeled variant.

InlineDataLoader

Use when you have rows or raw messages inline.

Preprocessing

All loaders support an optional preprocess_fn applied before returning rows. For example, expand multi-turn traces into multiple test cases:

Using with evaluation_test

Metadata and Variants

Each loader emits one or more variants. For each variant, Eval Protocol stores metadata on every row under row.input_metadata.dataset_info:
  • data_loader_type: loader class (e.g., DynamicDataLoader)
  • data_loader_variant_id: callable name or inline id
  • data_loader_variant_description: docstring/description
  • data_loader_num_rows: original count before preprocessing
  • data_loader_num_rows_after_preprocessing: final count
This enables clear tracking of which inputs produced which results in the UI.

Example with an Adapter

API Reference

DynamicDataLoader

InlineDataLoader

EvaluationDataLoader

Source Code

See the Python source for full details: eval_protocol/data_loader/models.py