Bird
0
0

Given this LangGraph snippet, what will be the output if the human approves the AI result?

medium📝 component behavior Q4 of 15
LangChain - LangGraph for Stateful Agents
Given this LangGraph snippet, what will be the output if the human approves the AI result?
flow.add_node(AINode(name='generate'))
flow.add_node(HumanNode(name='approve'))
flow.add_edge('generate', 'approve')
result = flow.run()
AThe flow runs without pause and returns AI output directly
BThe flow throws an error due to missing edge
CThe flow pauses for human approval and returns approved result
DThe flow skips HumanNode and returns None
Step-by-Step Solution
Solution:
  1. Step 1: Analyze flow structure

    AI node generates output, then HumanNode waits for approval.
  2. Step 2: Understand HumanNode behavior

    HumanNode pauses flow until human input is received, then continues.
  3. Final Answer:

    The flow pauses for human approval and returns approved result -> Option C
  4. Quick Check:

    HumanNode pauses flow = approved result returned [OK]
Quick Trick: HumanNode pauses flow until human input is given [OK]
Common Mistakes:
MISTAKES
  • Assuming flow runs without pause
  • Thinking missing edges cause error here
  • Believing HumanNode is skipped automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes