Anthropic · Topic 3 of 5
Structured Output and Prompt Techniques
Getting reliable machine-readable output: JSON via tool_use schemas, required vs optional/nullable fields to prevent fabrication, enums with escape hatches, few-shot examples, prefills, and validation with retry-on-feedback.
5 lessons257 questions
What this topic covers
- 01Reliable JSON with tool_use Schemas360m
- 02Required, Optional, and Nullable Fields300m
- 03Enums, Escape Hatches, and Normalization300m
- 04Few-shot Examples and Prefills for Format300m
- 05Validation and Retry-with-feedback300m