AI Glossary Term
What does “Output Parser” mean?
Definition
Logic that validates and converts model output into strongly typed, machine-usable structures.
How Output Parser works
Example
An app asks a model to extract an invoice's total and due date. The parser reads the reply, confirms the total is a number and the date is valid, and asks the model to try again if not.
Why it matters
Software needs predictable data, not free-form text. Parsing and validating protect downstream systems from malformed output.
Common questions
Parser vs structured output?
Structured output constrains the model while it writes. A parser checks and converts what it wrote afterward.
What happens if parsing fails?
Common responses are retrying, repairing the text, or falling back to a default.
Which formats?
JSON is common, but CSV, XML, or custom schemas also work.