What does “Output Parser” mean?
Logic that validates and converts model output into strongly typed, machine-usable structures.
How Output Parser Works
Model reply text
Output parser
Check against schema
Typed data: name, date, amount
Retry if invalid.
Practical 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 About Output Parser
Q: Parser vs structured output?
Structured output constrains the model while it writes. A parser checks and converts what it wrote afterward.
Q: What happens if parsing fails?
Common responses are retrying, repairing the text, or falling back to a default.
Q: Which formats?
JSON is common, but CSV, XML, or custom schemas also work.