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.