Bird
0
0

Given two chains, chain1 outputs {'text': 'Hello'}, and chain2 takes input key 'text'. What will SequentialChain(chains=[chain1, chain2]) pass to chain2?

medium📝 component behavior Q4 of 15
LangChain - Chains and LCEL
Given two chains, chain1 outputs {'text': 'Hello'}, and chain2 takes input key 'text'. What will SequentialChain(chains=[chain1, chain2]) pass to chain2?
A{'text': 'Hello'}
B{'input': 'Hello'}
C{}
D{'output': 'Hello'}
Step-by-Step Solution
Solution:
  1. Step 1: Understand output-input passing in SequentialChain

    SequentialChain passes outputs from one chain as inputs to the next using matching keys.
  2. Step 2: Match output key to input key

    chain1 outputs {'text': 'Hello'}, chain2 expects 'text' input, so it receives {'text': 'Hello'}.
  3. Final Answer:

    {'text': 'Hello'} -> Option A
  4. Quick Check:

    Output key matches input key = {'text': 'Hello'} [OK]
Quick Trick: Output keys must match next chain's input keys [OK]
Common Mistakes:
  • Assuming keys change automatically
  • Passing empty dict if keys don't match
  • Using wrong key names like 'input' or 'output'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes