Open dylan0356 opened 1 month ago
Would updating langchain-core to the latest version help?
pip install langchain_core==0.2.3
somehow the pyproject.toml of the langchain-openai package already requires the langchain-core packge to be equal or above 0.2.2 , so I'm not sure why you run into the issue though link
I am running into the same issue (although the error I am getting is for a different class) when importing ChatOpenAi from langchain_openai. If I use version 0.1.7
the error is gone. I was getting the same error even when usign langchain-0.2.1 langchain-core-0.2.3
.
Error:
"cannot import name 'UsageMetadata' from 'langchain_core.messages.ai'"
@Gerardofer does upgrading langchain-core resolve your issue?
ran into this today I had to manually force poetry to update langchain-core to resolve. Updating just langchain did not resolve. Seems like dependency management is out of sync for langchain, langchain-core, langchain-openai
I am facing the same issue though, @imadNaseer What dependencies you updated manually?
langchain==0.2.2 langchain-core==0.2.4 langchain-community langsmith langchain-groq langchain-openai==0.1.8 langchain-google-genai==0.0.6
@CD-rajveer I used these which I updated manually.
thanks, @qasim29
I got the same Problem, thanks @qasim29, you save the day 🫡
pip install langchain_core==0.2.3
this solves the issue for me.
Checked other resources
Example Code
Dockerfile:
Python Imports
Error Message and Stack Trace (if applicable)
Description
I am trying to import langchain_openai with the newest version released last night (0.1.8) and it can not find the LangSmithParams module.
I move back a version with
langchain-openai==0.1.7
and it works again. Something in this new update broke the import.System Info
Container is running python 3.9 on Rocky Linux 8