CCAR-F practice › Prompt Engineering & Structured Output · Question 77 of 105
Prompt Engineering & Structured Output
A pipeline must run extract_metadata on each document before any enrichment tool, because enrichment depends on its output. Logs show the model sometimes calls an enrichment tool first. What is the most reliable fix?
Show answer and explanation
Answer: D — Force it: tool_choice {"type": "tool", "name": "extract_metadata"}
Forcing a specific tool guarantees that extraction runs before enrichment. "any" (a) guarantees a tool call but still lets the model choose an enrichment tool. Array order (b) is not a selection mechanism, and a prompt instruction (c) makes the order likely, not guaranteed.
Keep going
More Prompt Engineering & Structured Output questions
- An invoice extraction pipeline retries failed validations by sending the document, the…
- A vendor-onboarding extractor retries up to five times when tax_id is missing. These…
- An invoice extractor uses tool use with a strict schema, and every response passes…
- 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…