Bird
0
0

You want to create a SequentialChain that first summarizes text, then translates the summary. How should you design the chains to work correctly?

hard📝 Conceptual Q8 of 15
LangChain - Chains and LCEL
You want to create a SequentialChain that first summarizes text, then translates the summary. How should you design the chains to work correctly?
AUse unrelated keys for input and output in both chains
BMake the first chain output key 'summary' and second chain input key 'summary'
CMake the second chain output 'summary' and first chain input 'summary'
DMake both chains use the same input key 'text' without output keys
Step-by-Step Solution
Solution:
  1. Step 1: Plan data flow between chains

    The first chain summarizes text and outputs under a key, e.g., 'summary'.
  2. Step 2: Match output and input keys

    The second chain should accept input with the same key 'summary' to translate it.
  3. Final Answer:

    Make the first chain output key 'summary' and second chain input key 'summary' -> Option B
  4. Quick Check:

    Matching keys enable smooth data flow [OK]
Quick Trick: Match output and input keys for smooth chain linking [OK]
Common Mistakes:
  • Using same input key without output keys
  • Reversing input/output roles
  • Using unrelated keys causing failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes