Skip to content

readDataset()

PromptScript API


readDataset(file, options): AsyncIterable<DatasetRecord>

Defined in: eval/src/dataset/read.ts:457

Read a dataset file row by row: JSONL, CSV or YAML by the extension of the path as written. JSONL streams, so reading stops at the row limit without reading the rest. CSV cells are coerced by the contract’s input and output types; JSONL and YAML values are never coerced. Rows are built on null-prototype objects and never interpolate ${VAR}.

Parameters

file

string

Real path of the dataset, as returned by loadSuites

options

ReadDatasetOptions

Project root, row limit and prompt contract

Returns

AsyncIterable<DatasetRecord>

The rows in file order

Throws

EvalDatasetError for a parse error, a limit, a bad or duplicate id, or an empty dataset