स्ट्रक्चर्ड आउटपुट प्लेग्राउंड

मॉडल API को कॉल किए बिना स्कीमा-सीमित JSON नमूनों को सत्यापित करें और प्रदाता अनुरोध पैटर्न कॉपी करें।

स्ट्रक्चर्ड आउटपुट वर्कबेंच
उदाहरण प्रीसेट
सत्यापन परिणाम
नमूना आउटपुट लक्ष्य संरचना से मेल खाता है।
प्रदाता पैटर्न
प्रदाता-निरपेक्ष प्रॉम्प्ट
लक्ष्य JSON संरचना को कॉन्ट्रैक्ट मानें और अतिरिक्त कुंजियों को अस्वीकार करें।
Return JSON only.
Use the target JSON structure as the contract for keys, nesting, arrays, and value types.
Do not wrap the result in markdown.
Do not add extra keys.

Target structure:
{
  "priority": "high",
  "owner": {
    "name": "Jane",
    "team": "support"
  },
  "steps": [
    "reply",
    "escalate"
  ]
}
OpenAI Responses API
सीधा structured output पाने के लिए strict JSON schema के साथ text.format का उपयोग करें।
from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-5",
    input="Return the response in the required JSON shape.",
    text={
        "format": {
            "type": "json_schema",
            "name": "structured_output",
            "strict": True,
            "schema": {
              "type": "object",
              "properties": {
                "priority": {
                  "type": "string"
                },
                "owner": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "team": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "team"
                  ],
                  "additionalProperties": false
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "priority",
                "owner",
                "steps"
              ],
              "additionalProperties": false
            },
        }
    },
)

print(response.output_text)
Anthropic प्रॉम्प्ट पैटर्न
लक्ष्य संरचना को ज्यों का त्यों पेस्ट करें और मॉडल को केवल JSON में उत्तर देने का निर्देश दें।
You are returning structured data for a downstream parser.
Output JSON only.
Match the exact keys, nesting, and value types shown below.
If a field is unknown, return a valid placeholder of the same type.

Target structure:
{
  "priority": "high",
  "owner": {
    "name": "Jane",
    "team": "support"
  },
  "steps": [
    "reply",
    "escalate"
  ]
}