Figure 10.2 Prompt chaining. A task is split into a fixed sequence of model calls, each
consuming the last one's output; between the steps sits a gate (in accent)—a
check written in ordinary code. A candidate that passes flows on; one that fails is sent
back to be retried before the next step ever sees it. The gate is what converts a chain's
greatest liability, dependent steps, into a checkpoint that stops a bad intermediate from
compounding downstream.