Does OpenAI Structured Outputs Guarantee Correct Data or Just the Required Format?

Asked 4 days ago 56 views

0

I’m using OpenAI Structured Outputs to extract invoice numbers, dates, and totals from document text. A response can match my schema perfectly but still contain a total that does not appear on the invoice.

Where does the guarantee stop?

I understand that JSON Schema validation can check field types and required properties. What I’m less clear about is whether strict schema adherence provides any assurance that the extracted values are supported by the source.

For example, if an invoice date is unreadable but my schema requires a date string, how should I represent that uncertainty without encouraging a guessed value? Should the schema allow a null value, include supporting source text, or leave that decision to a separate validation step?

I’m looking for a sensible boundary between valid output and verified extraction before these records enter our accounting workflow.

0 Answers


Write Your Answer