artefactual.preprocessing.read_batch#

artefactual.preprocessing.read_batch(path)[source]#

Every line of a Batch output file, in file order.

Blank lines are skipped; a line that is not a batch record raises through pydantic, naming the field that was wrong.

A repeated custom_id raises, whether or not either line carries a completion. It is the key responses are paired to their verdicts by, so a duplicate is an ambiguous join – and the ambiguity surfaces later as a mislabelled row rather than as an error.

Return type:

list[BatchRequestOutput]