Bird
0
0

Identify the error in this RAG chain setup:

medium📝 Debug Q14 of 15
LangChain - RAG Chain Construction
Identify the error in this RAG chain setup:
retriever = SimpleRetriever(data)
rag_chain = RetrievalQA(llm=None, retriever=retriever)
answer = rag_chain.run('Explain RAG')
AThe retriever is not defined
BThe data variable is not passed to the chain
CThe run method is missing a parameter
DThe llm (generator) is set to None, causing failure
Step-by-Step Solution
Solution:
  1. Step 1: Check components passed to RetrievalQA and their impact

    The retriever is defined, but the llm (generator) is set to None. Without a generator, the chain cannot produce answers, causing an error or failure.
  2. Final Answer:

    The llm (generator) is set to None, causing failure -> Option D
  3. Quick Check:

    llm must not be None [OK]
Quick Trick: llm must be a valid generator, not None [OK]
Common Mistakes:
  • Thinking retriever is missing
  • Assuming run needs extra parameters
  • Ignoring that llm is None

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes