GenAICerts

Claude Certified Architect – Professional (CCA-P)

Question 1 of 15
Prompt Engineering & Structured Output
Context: An architect is building a system that requires Claude to classify user input into one of five categories and return the result in a strict JSON format: `{"category": "CATEGORY_NAME"}`. Problem: Despite a well-crafted system prompt and few-shot examples, the model occasionally adds conversational preamble (e.g., "Certainly, here is the classification:") before the JSON object, which breaks the downstream JSON parser. Question: Which Messages API technique provides the strongest guarantee that the model's response will begin directly with the opening brace `{` of the JSON object?