Back to guide/Education & Learning

Output Format Enforcement

The examples establish the exact JSON schema, field naming conventions, and how to handle boolean values — the model follows the same pattern for any new input.

few-shot-promptingproduct_description
Edit View
Prompt
Convert the following product descriptions into structured JSON. Follow this exact format:

Example 1:
Input: "Red cotton t-shirt, size medium, $24.99, currently in stock"
Output: {"name": "Red cotton t-shirt", "material": "cotton", "size": "M", "price": 24.99, "in_stock": true}

Example 2:
Input: "Blue denim jacket, size large, $89.00, sold out"
Output: {"name": "Blue denim jacket", "material": "denim", "size": "L", "price": 89.00, "in_stock": false}

Now convert:
Input: "{{product_description}}"
Output:

Variables to customize

{{product_description}}

Why this prompt works

The examples establish the exact JSON schema, field naming conventions, and how to handle boolean values — the model follows the same pattern for any new input.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.