karenina.benchmark.verification.utils.schema_builder¶
schema_builder
¶
Build JSON schemas for the judge LLM, filtering out verification metadata.
Two filtering operations: 1. Remove trace fields (judge should not parse these) 2. Strip verification metadata (judge must not see ground truth)
Classes¶
Functions¶
build_parsing_schema
¶
build_parsing_schema(
answer_class: type[BaseAnswer],
) -> dict[str, Any]
Build JSON schema for the judge, filtering out trace fields and metadata.
Handles Pydantic v2 schema shapes including $defs and allOf references.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[BaseAnswer]
|
The Answer class to generate a schema for. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Filtered JSON schema dict safe to send to the judge LLM. |