reaatech/structured-output-repair
These packages give you a repair engine that takes a Zod schema and malformed LLM output, then runs it through six graduated strategies—stripping markdown fences, extracting JSON from prose, fixing syntax errors, coercing types, fuzzy-matching keys, and removing extra fields—to return valid, schema-conforming data instead of crashing. You'd adopt them to handle the common failure modes of LLM structured output generation: trailing commas, truncated streams, Python literals, hallucinated field names, and JSON buried in conversational wrappers. The most distinctive thing is the graduated pipeline approach—each strategy runs in sequence, the engine validates after each step, and it returns as soon as the data conforms, giving you detailed diagnostics including per-field errors and best-effort partial data when full repair fails.
Packages
2 packages
@reaatech/structured-repair-core
- status
- published
- published
- 1 month ago
@reaatech/structured-repair-mcp
- status
- published
- published
- 1 month ago
Comments
Sign in with GitHub to comment and vote.