perf_validate
Validates LLM-generated JSON against a schema, automatically repairing common violations like malformed enums, truncated arrays, and hallucinated fields. Returns compliant output or a detailed rejection.
Instructions
Validate LLM-generated JSON against a schema and auto-repair violations. Fixes malformed enums, truncated arrays, mixed types, hallucinated fields, and missing required properties. Returns valid, schema-compliant output or a detailed rejection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The LLM-generated structured output (JSON string). | |
| target_schema | Yes | JSON Schema the output must conform to. | |
| repair_mode | No | 'strict' rejects low-confidence repairs. 'best_effort' infers to fill gaps. Default: 'best_effort'. |