Skip to main content
All AI tricks
Quick trickDevelopmentIntermediate

AI JSON: Separate Refusal, Missing Data and Incomplete Output

Design separate handling for refusals, incomplete responses and valid records with missing facts. Practise response-state decisions before passing model output downstream.

9 min practiceChatGPTUpdated · Last checked Oct 18, 2026
Jump to the lesson ↓
Three distinct trays show a stop state, an empty card and a data grid beside a ChatGPT logo.
AI-generated conceptual illustration with a provider logo used for editorial identification. Not a screenshot, product test or sponsored endorsement.

The useful result

Choose a safe next step for each response state before validating and using its data.

  • Choose a safe next step for each response state before validating and using its data.

Schema validation starts too late if your application mistakes a refusal or interrupted response for a normal empty result. OpenAI documents separate handling for these states. Practise a small decision table before connecting an action to model output. The fixtures here are normalized application examples, not a claim about an SDK’s exact raw response shape.

Select the named model only if it is available in your interface. API controls and consumer-app controls differ. You can practise the technique on the supplied fictional inputs with an available compatible assistant first. This lesson is documentation-based; examples are expected results, not a claim that we ran the named model.

Before you start

  • A test environment or paper decision table; no live API call required.
  • Four normalized fixtures: refusal, incomplete, completed missing fact, completed valid record.

Review evidence

Documentation-based review · 2026-10-18

Provider documentation checked on 18 October 2026. Examples and checks are original illustrative exercises, not recorded platform tests. Cover artwork is conceptual and does not imply provider sponsorship.

1

Separate transport state from business facts

Write the order of checks: request/error state, completion state, refusal content, parsed payload and schema validity, then factual review. Follow your API’s actual response documentation when implementing. Do not use null alone to represent every failure.

Example / expected result

Illustrative example; not a recorded model result.

Normalized cases: A refused; B incomplete; C completed with due_date=null; D completed with a source-supported due_date.

Check your result

Your design can distinguish a missing fact from a response that never completed.

2

Choose a distinct action for each case

A refusal needs an appropriate explanation or alternative; an incomplete result needs controlled recovery; a valid missing value stays unknown; a complete value still needs source checking. These decisions are outside the model’s prose.

Try this prompt
Review this application decision table without calling any API: refused → explain; incomplete → stop and recover; completed with due_date=null → retain unknown; completed with a supplied date → validate and check source. Identify any branch that wrongly treats refusal as a normal empty record.

Example / expected result

Illustrative example; not a recorded model result.

A: no downstream action. B: retain partial output privately, recover under a bounded policy. C: unknown date, request source if required. D: validate and compare to supplied evidence.

Check your result

No refused or incomplete fixture reaches the ordinary record-action path.

3

Test every branch before deployment

Use mocked responses in your own application and assert which branch executes. Include a malformed payload and a schema-valid but unsupported date. Keep retry limits explicit; a repair loop must not endlessly resubmit a refusal or silently invent a value.

Check your result

Tests demonstrate separate branches, and factual checks still reject an unsupported date.

When it goes wrong

Structured output constrains shape, not truth. Exact response envelopes and SDK helpers vary; the normalized fixtures are not copy-ready SDK code. Do not defeat a refusal by automatic retries or treat a network error as a valid “no data” answer.

Make it your own

Add a completed schema-valid date that does not appear in the source. It should pass the shape check and fail the separate evidence check.

Useful next resources

Sources and review

Last checked Oct 18, 2026. Features and account limits can change. Verify important results against your original material.

Did this help you complete your task?

Tell us what needs improving. No account or private output required.

Was this useful?
Report incorrect information or a broken link

Genius Forges Editorial

Practical AI lessons with checked sources, labelled examples and human verification.

Keep building your AI habits

Keep learning useful AI tricks

Get practical lessons and resources when we publish them.

Turn this idea into a daily skill

Practice with a small input and check the result before sharing.

We use optional cookies for analytics and referral tracking. Learn more about our privacy policy