Specify the fields and missing-value policy
Suppose you want to extract an event name, date, and venue from a short announcement. List the exact keys and value types, explain the date format, and decide how to represent an unknown venue. Without that contract, the model might return an empty string, a guessed location, or a differently named key.
Keep the first schema small. Ask for the fields the application actually needs and state whether additional keys are allowed. A longer schema creates more opportunities for inconsistent values, especially in a compact local model.
Separate extraction from inference
If an announcement says next Thursday but has no reference date, the calendar date is ambiguous. Tell the model to preserve that uncertainty. Do not turn a guess into a precise machine-readable value just because the output format expects one.
Ask for only the JSON object, with no Markdown fence or introduction. This improves usability, but ordinary chat prompting does not enforce the format. GPT0 does not guarantee schema-constrained output.
Extract an event from the supplied text. Return only JSON with exactly these keys: name (string or null), date (YYYY-MM-DD string or null), venue (string or null). Use null for missing or ambiguous values. Do not infer a year or location. Source: [announcement]
Validate syntax, types, and facts separately
Parse the response with your language's JSON parser and validate it against the application's schema. Then compare the extracted values with the original announcement. A parser can accept a structurally valid object containing an invented date.
Check whether null values are supported downstream and whether strings can contain unexpected whitespace. Keep raw model output separate from trusted application records until validation finishes. For real integration work, use a defined error path when parsing fails.
Repair only the failing part
When validation reports an error, provide the schema, the candidate object, and the specific problem. Ask for a corrected object without changing valid fields. Do not repeatedly request new extraction results and accept whichever one happens to parse.
Use fictional examples covering missing fields, quotation marks, and conflicting dates to evaluate the prompt. A successful sample is useful evidence for that sample, not proof of reliable extraction for every document. Review higher-impact records individually or use a purpose-built extraction workflow with appropriate controls.
Original examples are illustrative. This is AI-assisted content maintained for GPT0, not an independent product benchmark. Read our editorial approach.
Try a small task in GPT0
Start with a short prompt. Your device runs the model; WebGPU support and an initial download are required.
Open free chat