"TypeError: multiple bases have instance lay-out conflict" when Running notebook in my vscode venv

I’m following the last section of the tutorial on building a chatbot using LangChain, but I’m encountering an error that says TypeError: multiple bases have instance lay-out conflict. I’m unable to proceed because of this issue.

Error Message:

Here’s the complete error traceback for reference:
Traceback (most recent call last):
File “/Users/izzy/Desktop/LangChainAgents/chatbot.py”, line 30, in
def get_current_temperature(latitude: float, longitude: float) → dict:
File “/Users/izzy/Desktop/LangChainAgents/myenv/lib/python3.9/site-packages/langchain/tools/base.py”, line 841, in _partial
return _make_with_name(func.name)(func)
File “/Users/izzy/Desktop/LangChainAgents/myenv/lib/python3.9/site-packages/langchain/tools/base.py”, line 801, in _make_tool
return StructuredTool.from_function(
File “/Users/izzy/Desktop/LangChainAgents/myenv/lib/python3.9/site-packages/langchain/tools/base.py”, line 721, in from_function
return cls(
File “/Users/izzy/Desktop/LangChainAgents/myenv/lib/python3.9/site-packages/langchain/load/serializable.py”, line 97, in init
super().init(**kwargs)
File “/Users/izzy/Desktop/LangChainAgents/myenv/lib/python3.9/site-packages/pydantic/v1/main.py”, line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for StructuredTool
args_schema
subclass of BaseModel expected (type=type_error.subclass; expected_class=BaseModel)

Environment:

Python Version: [Python version 3.9.7]
LangChain Version: [Your LangChain version 0.0.305]
Pydantic Version: [Pydantic version, 2.4.2]

Is there a workaround this? Are there known compatibility issues?

never mind i was able to find the dependencies through the notebook, will update if I have anymore issues. I am trying to implement this method into creating my own agents.

1 Like