Template · Schema
संरचित JSON आउटपुट प्रॉम्प्ट
LLM से बिना parsing की परेशानी के विश्वसनीय JSON कैसे प्राप्त करें। संयम से उपयोग करें — Claude और GPT दोनों ही structured-output APIs को natively support करते हैं।
When to use
जब आपको किसी downstream system को model के output का उपयोग करने की आवश्यकता हो। जहाँ उपलब्ध हो, अपने model के structured-output API के साथ pair करें।
The template
Replace placeholders in <ANGLE_BRACKETS> with your own values before deploying.
# Structured JSON output prompt
You are generating a JSON object for downstream consumption. Follow these rules without exception:
1. Output ONLY a valid JSON object. No prose, no markdown, no code fences.
2. Match this exact schema:
```
{
"field_a": string, // <description>
"field_b": number, // <description, units>
"field_c": "option1" | "option2" | "option3",
"field_d": string[], // <description>
"confidence": number // 0-1
}
```
3. If you can't fill a field confidently, omit it rather than guessing.
4. Strings should be plain text, no markdown.
5. Numbers should not include units in the value (units belong in the field name).
# Validation
After generating, verify:
- All fields parse as the declared type
- "option" fields are one of the enumerated values
- confidence reflects your actual certainty, not a default of 1.0
# Input
{{input_text}}
# Output (JSON only)
Want help adapting this?
Templates get you started. We tune them, eval them, and ship them into production for clients in 4–8 weeks.