Skip to main content

Module corpus

Module corpus 

Source
Expand description

Golden corpus loader for agent evaluation.

A golden corpus is a collection of test cases — each with an input prompt, expected output (or expected substrate/relations), and optional scoring criteria. The loader reads a simple text-based format (one case per stanza, separated by ---) and produces an in-memory corpus structure.

Format:

# case: test_name
input: <input text>
expected: <expected output or relations>
tags: tag1,tag2
---
# case: another_test
input: ...
expected: ...

Lines starting with # are comments (or case headers when prefixed with case:). The --- separator delimits cases.

Structs§

GoldenCase
A single golden test case.
GoldenCorpus
A loaded golden corpus.

Functions§

load_corpus_from_file
Load a golden corpus from a file path.
parse_corpus
Parse a golden corpus from a text string.