Specify the output structure when you need to compare, copy or process an AI answer. Name the fields and define missing values. Then check both the structure and the facts inside it.

Use one source in two formats

Example notes: “Maya will draft the proposal; no due date was agreed. Leo will send the estimate by Friday.” We want two rows with action, owner and due date. Friday stays relative until the meeting context supplies a calendar date.

Extract only explicit assignments from these notes.
Return a table with columns: action, owner, due_date.
For a missing due date, use null. Preserve relative dates as written.
Then return the same two records as a JSON array using those field names.
Notes: Maya will draft the proposal; no due date was agreed.
Leo will send the estimate by Friday.

Example table

actionownerdue_date
Draft proposalMayanull
Send estimateLeoFriday

Example JSON

[
  {"action": "Draft proposal", "owner": "Maya", "due_date": null},
  {"action": "Send estimate", "owner": "Leo", "due_date": "Friday"}
]

The example uses JSON null, not the string “null.” The second date remains a string because the source gives no exact date. This is extraction from supplied notes, not a calendar-ready scheduling record.

Formatting and schema enforcement

A normal chat instruction requests a format. A supported API feature can constrain output to a defined schema. OpenAI’s Structured Outputs documentation distinguishes schema adherence from factual correctness and explains how to handle refusals and incomplete responses.

If you are building software, parse JSON with a JSON parser, validate the expected fields and allowed value types, and handle failures. A visually tidy code block is not validation. For a manual task, a table may be enough; adding JSON creates extra work unless another tool needs it.

Check content separately

  • Are there exactly two assignments?
  • Does each owner match the notes?
  • Is Maya’s due date missing rather than copied from Leo?
  • Does Friday remain relative?
  • Do table and JSON contain the same values?

A response can satisfy every schema requirement and still assign the wrong person. Keep the source next to the result. For practice, add an unassigned suggestion and verify that it does not become an invented action. Use the meeting-notes lesson for decisions, proposals and evidence columns.