Bird
0
0

Identify the error in this LangGraph code snippet:

medium📝 Debug Q6 of 15
LangChain - LangGraph for Stateful Agents
Identify the error in this LangGraph code snippet:
flow.add_node(HumanNode('feedback'))
flow.add_node(AINode(name='process'))
flow.add_edge('feedback', 'process')
AHumanNode missing named argument 'name'
BAINode missing required parameters
CEdge direction is reversed
DNodes are added in wrong order
Step-by-Step Solution
Solution:
  1. Step 1: Check HumanNode instantiation

    HumanNode requires a named argument 'name', but only a positional string is given.
  2. Step 2: Verify other nodes and edges

    AINode is correctly instantiated; edge direction is valid; node order is flexible.
  3. Final Answer:

    HumanNode missing named argument 'name' -> Option A
  4. Quick Check:

    HumanNode needs name= argument [OK]
Quick Trick: Always use name='...' when creating HumanNode [OK]
Common Mistakes:
MISTAKES
  • Passing name as positional argument
  • Confusing edge direction
  • Thinking node order matters here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes