Skip to content

parseSample()

PromptScript API


parseSample(value): EvalSampleV1 | undefined

Defined in: eval/src/import/sample.ts:121

Check one parsed JSONL line against the closed sample schema (schema/eval-sample-v1.json) and copy it. Anything the schema does not list makes the sample invalid: a feedback.comment, an assignment key, a user, session or trace id, a nested input, an unknown top-level key. The sample is rebuilt from the listed fields only, so nothing else can ride along.

Parameters

value

unknown

The parsed line

Returns

EvalSampleV1 | undefined

The sample, or undefined when the line breaks the schema or a size limit