Bird
0
0

What is the likely cause of this error when running a ReAct agent?

medium📝 Debug Q14 of 15
LangChain - Agents
What is the likely cause of this error when running a ReAct agent?
TypeError: ReActAgent.__init__() missing 1 required positional argument: 'llm'
AThe ReActAgent does not accept an llm argument.
BThe tools list was empty, causing the error.
CThe ReActAgent was created without passing the required language model (llm) argument.
DThe run method was called with an invalid input string.
Step-by-Step Solution
Solution:
  1. Step 1: Interpret the error message

    The error says the __init__ method is missing the required 'llm' argument.
  2. Step 2: Identify correct constructor usage

    ReActAgent requires an llm parameter when created. Missing it causes this TypeError.
  3. Final Answer:

    The ReActAgent was created without passing the required language model (llm) argument. -> Option C
  4. Quick Check:

    Missing llm argument = TypeError [OK]
Quick Trick: Always pass llm when creating ReActAgent [OK]
Common Mistakes:
MISTAKES
  • Forgetting to pass llm argument
  • Confusing tools argument with llm
  • Misreading error as related to run method

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes