Bird
0
0

Which of the following is a valid way to reference a variable named userName in LCEL?

easy📝 Conceptual Q2 of 15
LangChain - Chains and LCEL
Which of the following is a valid way to reference a variable named userName in LCEL?
A{userName}
BuserName
C$userName
D#userName
Step-by-Step Solution
Solution:
  1. Step 1: Recall LCEL variable syntax

    In LCEL, variables are referenced directly by their names without special symbols.
  2. Step 2: Evaluate other options

    The options using symbols like $, {}, or # are incorrect; LCEL does not use special symbols for variable references.
  3. Final Answer:

    userName -> Option B
  4. Quick Check:

    Variable reference = direct name [OK]
Quick Trick: Use variable names directly without symbols in LCEL [OK]
Common Mistakes:
  • Adding $ or # before variable names
  • Using curly braces around variables
  • Confusing LCEL with other templating syntaxes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes