CCAR-F practice › Prompt Engineering & Structured Output · Question 76 of 105
Prompt Engineering & Structured Output
An intake pipeline has three extraction tools (invoice, receipt, contract) and doesn't know in advance which document type it will receive. With tool_choice set to "auto," about 3% of responses are prose summaries with no tool call. What change guarantees structured output?
Show answer and explanation
Answer: B — Set tool_choice to "any" so the model must call one of the extraction tools
"any" requires a tool call while letting the model pick the schema that fits the unknown document type. With "auto" (a), text replies stay possible no matter what the prompt says. Forcing one tool (c) pushes receipts and contracts through the wrong schema. A merged all-optional schema (d) loses the per-type structure.
Keep going
More Prompt Engineering & Structured Output questions
- A pipeline must run extract_metadata on each document before any enrichment tool…
- 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…