Code QuizIntermediate

Sequential Prompt Chaining

Find why each stage of this prompt pipeline ignores the previous output.

Codejavascript
async function runChain(steps, input) {
  let result = input;
  for (const step of steps) {
    result = await step(input);
  }
  return result;
}

// runChain([summarize, translate, format], document)

What is the bug in this prompt chaining pipeline?