Generative AI Output Formats
Specify a machine-readable shape and validate it afterward.
How it works
A requested format makes expectations clear, but free-form generated text may still contain invalid JSON, unexpected fields or values of the wrong type. A provider structured-output feature can constrain supported schemas, yet domain rules and authorization remain separate. Start with a small explicit shape and reject malformed results rather than searching a prose response for the first convenient number.
How to use this lesson
This is an authored prompt exercise with a human-written acceptance guide. It is not a captured provider response or a promise that a model will produce the target. No provider account, API, model weights or live inference was used for the course execution review. If you try it in an external service, use an authorised environment, check its actual access and data settings, and record the product/model and run date.
Bhylu does not run a generative model or send this prompt to an AI service. Copy and download preserve the text only. External tools may require accounts, paid access or compatible inputs; this course does not promise availability or prices.
Prompt exercise
Extract this note into JSON only.
Note: The session starts at 14:00 in room 2.
Keys: start_time (HH:MM string), room (string).
Do not add fields.
Acceptance guide — not a model transcript
Reference object: {"start_time":"14:00","room":"2"}. This is a human-authored target, not a provider transcript.
A local validator later checks exact keys and valid time ranges, with negative fixtures for extra fields and invalid hours. Schema validity alone cannot prove the extracted room is correct; that comparison needs the source or independently labelled answers.