13 questionsQuestion · Short answer
Prompt Engineering & Structured Output
Check the Claude API completion state before parsing a structured response. An HTTP 200 can carry stop_reason: "refusal" , which can produce text outside the schema. stop_reason: "max_tokens" can leave an incomplete result. Route a…
Prompt Engineering & Structured Output
Use output_config.format with type json_schema to constrain Claude’s response text to a JSON Schema. Set strict: true on a tool when the model-generated inputs to that tool need schema constraints. On a supported Claude Messages API…
Prompt Engineering & Structured Output
For long-document work, place the supplied documents before the task query and task-specific instructions in the prompt. Give each document a visible boundary and a stable source identifier so Claude can refer to evidence that the…
Prompt Engineering & Structured Output
Write a Claude prompt contract that states the task and audience, which inputs count as evidence, which decisions Claude may propose, what a satisfactory response contains, and when it should ask for clarification, stop, or escalate. For…
Prompt Engineering & Structured Output
Pass a validated intermediate artifact with a stable request ID, the result, evidence references, and any unresolved items or confidence indicators the next stage needs. Define each stage’s accepted inputs, output contract, owner, and…
Prompt Engineering & Structured Output
Give each Messages request a stable custom_id unique within its batch. Record the mapping to the input and source version, submit the validated records, and poll the batch ID until processing_status is ended . Retrieve the JSONL results…
Prompt Engineering & Structured Output
After a complete Claude response passes schema validation, check its meaning against the original evidence, the application’s current policy, and the proposed action. A valid value such as "priority": "high" has the expected shape. Accept…
Prompt Engineering & Structured Output
Budget the whole path from input arrival to the outcome you promise: preparation and admission, waiting for submission, batch processing, polling and download, validation, review, and any recovery. Claude Message Batches can expire after…
Prompt Engineering & Structured Output
Supply the relevant original source text and location, the failed candidate, field-specific validation errors, and the changes that are permitted. Ask Claude for another candidate under the same extraction contract, then validate it…
Prompt Engineering & Structured Output
Select verified input/output pairs that demonstrate the task's decision rules, including a plausible alternative that should receive a different answer and an appropriate missing-information outcome. Keep every example consistent with the…
Prompt Engineering & Structured Output
Give the verification pass each candidate, the exact saved artifact or revision, the accepted requirements and relevant surrounding code. Ask it to test the claim, search for guards or counterexamples, and return evidence supporting…
Prompt Engineering & Structured Output
Define a reportable defect through its required evidence, scope and exclusions, then evaluate both false alarms and missed defects. Instructions such as “be conservative” leave the reporting threshold ambiguous and can hide findings…