Structured JSON Output
GPT-4o is highly reliable at structured JSON output when given an exact schema. Adding confidence scores and source text spans makes the extraction auditable. The 'never fabricate' rule with null fallback prevents hallucinated data in extraction tasks.
Extract structured data from the following {{inputType}}: <input> {{inputContent}} </input> **Output as JSON matching this exact schema:** \`\`\`json {{jsonSchema}} \`\`\` **Extraction rules:** - If a field is not found in the input, use null (never fabricate data) - For {{ambiguousField}}: {{disambiguationRule}} - Normalize {{fieldsToNormalize}} to {{normalizationFormat}} - If multiple values exist for a single field, return as array **Validation:** - {{validationRules}} - Include a "_confidence" field (0.0-1.0) for each extracted value - Include a "_source" field with the exact text span used for extraction Return ONLY the JSON object. No markdown, no explanation.
Variables to customize
Why this prompt works
GPT-4o is highly reliable at structured JSON output when given an exact schema. Adding confidence scores and source text spans makes the extraction auditable. The 'never fabricate' rule with null fallback prevents hallucinated data in extraction tasks.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.