Structured Output with JSON Schema
Independent PiSkill directory guide. The original prompt remains hosted by OpenAI Cookbook.
What does this prompt do?
Demonstrates how to require API responses that conform to an explicit JSON schema.
Primary use case
Produce reliable machine-readable output for downstream code.
Expected output
A response conforming to the supplied JSON schema.
Inputs or variables
- input
- JSON schema
Related prompts
Data Extraction and Transformation
Extracts structured fields from source documents and transforms them into a target data representation.
Long-Document Entity Extraction
Extracts defined entities from long documents through structured chunking, grounded outputs, reconciliation, and checks that preserve traceability to source material.
AI-Assisted Data Science
Uses Gemini to explore a data question, inspect a dataset, develop analysis steps, produce code, and explain findings with assumptions and validation checks.
Gemini and Document AI Entity Extraction
Combines Document AI and Gemini to extract defined entities, reconcile OCR context, and assess whether structured results match the underlying document.
Gemini Controlled JSON Output
Uses controlled generation to produce responses that conform to a declared JSON schema.
Gemini Document Processing
Processes documents with Gemini by defining the target schema, extracting grounded information, handling multiple formats, and validating outputs against source evidence.