WEMAXA.COM Design · Development · AI · Available worldwide
Studio / Wemaxa 01
Status Active Location Worldwide Focus Web + AI Delivery Remote Response < 1 Business Day
Tutorial 073AI & Workflows10 steps4 fixes

How to Ask AI for Structured Output

A beginner-safe AI workflow for ask ai for structured output, with a copyable prompt, source boundaries, missing-information rules and line-by-line verification.

By the end: You will run a grounded AI task using real source material, verify every consequential claim, and keep a reusable prompt plus human-review process.

TARGET RESULTHow to Ask AI for Structured Output

You will run a grounded AI task using real source material, verify every consequential claim, and keep a reusable prompt plus human-review process.

Key terms before you start

These definitions make the steps easier to follow and help distinguish controls, files and concepts that can look similar at first.

PromptThe instruction and context supplied to an AI model.
ContextInformation the model needs for the task, such as source text, audience, definitions and background.
ConstraintA rule limiting the output, e.g. “use only the supplied source” or “return JSON only”.
HallucinationGenerated information that is false, fabricated or unsupported by the available evidence.
Structured outputOutput that follows a defined schema, table, list of fields or machine-readable format such as JSON.
Human reviewA deliberate check by a person who knows the source or has authority before generated content is used.

What you need before starting

  • Access to ChatGPT
  • The real source material required for the task
  • Permission to use that material
  • A person who can verify/approve consequential facts
FULL TUTORIAL

Step-by-step tutorial

Every step is shown below. Work through them in order and use each checkpoint to confirm the result before moving on.

01
STEP 01 / 10

Open a new ChatGPT conversation

Do this

Start a new chat so unrelated earlier instructions do not accidentally shape the workflow.

Why

A clean conversation makes the task/source boundary easier to audit.

ContextInformation the model needs for the task, such as source text, audience, definitions and background.
IF THIS GOES WRONGThe output cites a source that does not support the claim

Treat the claim as unsupported; open the source yourself and correct/remove it.

CHECKPOINTThe chat contains no unrelated task history.
02
STEP 02 / 10

Collect the authoritative input first

Do this

Prepare the real one or more real sample invoices/documents you are allowed to use.

Why

Do not ask the model to reconstruct private/current facts that should come from a document, database or person.

PromptThe instruction and context supplied to an AI model.
IF THIS GOES WRONGThe model invented a missing fact

Strengthen the source-only/missing-information rule, delete unsupported content, and verify the revised output. Do not keep a plausible guess.

CHECKPOINTThe source material is ready.
03
STEP 03 / 10

Define the output format

Do this

Ask for JSON with exact named fields and specify headings/fields/order.

Why

A defined structure makes comparison/review easier.

Structured outputOutput that follows a defined schema, table, list of fields or machine-readable format such as JSON.
IF THIS GOES WRONGThe answer ignores requested format

Restate the exact schema/headings and show a tiny structural example without adding fake factual values.

CHECKPOINTOutput shape is explicit.
04
STEP 04 / 10

Check every number and date

Do this

Compare numbers, dates, prices, percentages and deadlines back to the source one by one.

Why

These details are easy to alter accidentally and often consequential.

ContextInformation the model needs for the task, such as source text, audience, definitions and background.
IF THIS GOES WRONGThe output cites a source that does not support the claim

Treat the claim as unsupported; open the source yourself and correct/remove it.

CHECKPOINTAll quantitative claims match or are corrected.
05
STEP 05 / 10

Check every proper name and product/service name

Do this

Compare spelling and identity with the source.

Why

A plausible wrong name is still wrong.

ContextInformation the model needs for the task, such as source text, audience, definitions and background.
IF THIS GOES WRONGThe model invented a missing fact

Strengthen the source-only/missing-information rule, delete unsupported content, and verify the revised output. Do not keep a plausible guess.

CHECKPOINTNames match source.
06
STEP 06 / 10

Define the schema before extraction

Do this

Write the exact field names/types/null behavior your downstream process expects.

Why

Changing keys later can break imports.

Structured outputOutput that follows a defined schema, table, list of fields or machine-readable format such as JSON.
IF THIS GOES WRONGThe answer ignores requested format

Restate the exact schema/headings and show a tiny structural example without adding fake factual values.

CHECKPOINTSchema is fixed for the test.
07
STEP 07 / 10

Validate JSON syntax separately

Do this

Paste the returned JSON into a JSON validator/parser or your application test.

Why

Readable text is not necessarily valid machine-readable JSON.

Structured outputOutput that follows a defined schema, table, list of fields or machine-readable format such as JSON.
CHECKPOINTParser accepts the output.
08
STEP 08 / 10

Test an invoice with a missing field

Do this

Use a sample that genuinely lacks tax/subtotal/etc.

Why

This verifies the model uses null rather than inventing/calculating.

PromptThe instruction and context supplied to an AI model.
IF THIS GOES WRONGThe model invented a missing fact

Strengthen the source-only/missing-information rule, delete unsupported content, and verify the revised output. Do not keep a plausible guess.

CHECKPOINTMissing value is represented as specified.
09
STEP 09 / 10

Record reusable prompt only after it works

Do this

Save the prompt template plus required inputs and review checks.

Why

A repeatable workflow includes validation, not just reusable wording.

PromptThe instruction and context supplied to an AI model.
IF THIS GOES WRONGA later revision reintroduced errors

Re-run the same verification after every material revision. Human review is not a one-time step.

CHECKPOINTThe next run has a documented process.
10
STEP 10 / 10

Re-test when source/model/process changes

Do this

If the input format, policy, model or business process changes, run validation examples again.

Why

A workflow proven on one version is not permanently proven.

ContextInformation the model needs for the task, such as source text, audience, definitions and background.
IF THIS GOES WRONGThe model invented a missing fact

Strengthen the source-only/missing-information rule, delete unsupported content, and verify the revised output. Do not keep a plausible guess.

CHECKPOINTThe process remains current.
CONCRETE EXAMPLEGrounding rule

If a factual sentence cannot be traced to the allowed source, remove it or mark the information missing.

Concrete examples

Grounding ruleIf a factual sentence cannot be traced to the allowed source, remove it or mark the information missing.

Copyable example

Prompt you can paste
Extract these fields from each invoice:
- invoice_number
- invoice_date
- supplier
- currency
- subtotal
- tax
- total

Return JSON only.
Use null when a field is absent.
Do not calculate a missing subtotal or tax.
Do not add commentary.

SOURCE:
[attach/paste invoice text]

Troubleshooting

The model invented a missing fact

Strengthen the source-only/missing-information rule, delete unsupported content, and verify the revised output. Do not keep a plausible guess.

The answer ignores requested format

Restate the exact schema/headings and show a tiny structural example without adding fake factual values.

The output cites a source that does not support the claim

Treat the claim as unsupported; open the source yourself and correct/remove it.

A later revision reintroduced errors

Re-run the same verification after every material revision. Human review is not a one-time step.

FINAL CHECKRe-test when source/model/process changes

The process remains current.

Public discussion excerpts

How the topic comes up in practice

Short excerpts from public discussions that directly relate to the task. Use the source link for the complete context.

“Instead of one massive prompt, I split the task into two specialized roles.”

structured extraction ↗

Documentation and references

Use these primary and supporting sources to verify current controls, browser behavior and product-specific details.