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.