Bird
0
0

You wrote this pipeline code:

medium📝 Debug Q14 of 15
Agentic AI - Real-World Agent Applications
You wrote this pipeline code:
agent = Agent()
agent.add_step('load', function=load_data)
agent.add_step('clean', function=clean_data)
result = agent.run()

But you get an error: KeyError: 'analyze'. What is the likely cause?
AThe 'load_data' function returns None
BThe 'clean_data' function has a syntax error
CMissing the 'analyze' step before running
DThe agent.run() method is called with wrong parameters
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    The error KeyError: 'analyze' means the pipeline expects an 'analyze' step.
  2. Step 2: Check pipeline steps

    The code only adds 'load' and 'clean' steps, missing 'analyze'.
  3. Final Answer:

    Missing the 'analyze' step before running -> Option C
  4. Quick Check:

    KeyError means missing step [OK]
Quick Trick: Check all required steps added before run [OK]
Common Mistakes:
  • Blaming function syntax errors without checking steps
  • Assuming run parameters cause KeyError
  • Ignoring missing step names in pipeline

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes