CCAR-F practice › Prompt Engineering & Structured Output · Question 80 of 105
Prompt Engineering & Structured Output
An invoice extractor uses tool use with a strict schema, and every response passes schema validation. Accounting still finds invoices where the extracted line items don't add up to the extracted total. What is the most effective addition?
Show answer and explanation
Answer: B — Extract calculated_total next to stated_total and flag mismatches
Totals that don't sum are a semantic error, which schema enforcement can't catch. Having the model compute calculated_total next to the stated_total turns the discrepancy into a flag, whether it's an extraction error or a genuine inconsistency in the source. Stricter schemas (a) only govern shape. Agreement between runs (c) can confirm the same mistake. A prompt instruction (d) provides no check.
Keep going
More Prompt Engineering & Structured Output questions
- Developers dismiss about 40% of an automated reviewer's findings. The team tracks the…
- Documents arrive throughout the day and must be processed within 30 hours of arrival…
- A batch of 5,000 contract extractions completes with 120 failures. Most of the failed…
- A team wants to move workloads to the Message Batches API for its 50% cost savings…
- A Claude session generates a database migration, then in the same session is asked to…