Closed AkashBais closed 4 months ago
cc @ccurme
Can you confirm the kernel that is raising the error has langchain-core==0.2.22
, as you specify in your package information?
I cannot reproduce this error in a fresh environment:
pip install --upgrade langchain_google_genai -i https://pypi.org/simple
pip freeze | grep langchain
langchain-core==0.2.22
langchain-google-genai==1.0.8
restart kernel
The issue was due to version conflicts within environments. Thanks for your responces
The issue was due to version conflicts within environments. Thanks for your responses
Can you specify what was the conflict?
ImportError: cannot import name 'LangSmithParams' from 'langchain_core.language_models.chat_models' (/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py)
This happened to me when I tried:
pip install ragatouille
Then fixed it with:
pip install --upgrade langchain langchain-community langchain-core
When the driver connects to “mongodb+srv://” connection strings it must perform SRV and TXT lookups via DNS. If those lookups consistently time out that indicates a DNS misconfiguration in the network; perhaps there’s some throttling going on or these DNS queries are being dropped/blocked.
One option that’s always available to workaround these issues is to switch to using the old-style “mongodb://” connection string. You can find this in the Atlas cluster UI, https://www.mongodb.com/docs/guides/atlas/connection-string/ 144, going to “connect your application” and then choosing the oldest driver version (choosing the newer driver version will give you a “mongodb+srv://” connection string).
Go to my Mongodb >> Clusters >> Connect >> Drivers >> Then choose : "python.3.4" and update your Atlas_connection_string with the new one (same old username and password)
Checked other resources
Example Code
import langchain_google_genai raise ImportError
Error Message and Stack Trace (if applicable)
ImportError Traceback (most recent call last) in <cell line: 6>()
4 # !pip install --upgrade langchain
5 # from langchain_google_genai import GoogleGenerativeAI
----> 6 import langchain_google_genai# import GoogleGenerativeAI
7
8 # llm = ChatGoogleGenerativeAI(model="gemini-pro")
1 frames /usr/local/lib/python3.10/dist-packages/langchain_google_genai/init.py in
57
58 from langchain_google_genai._enums import HarmBlockThreshold, HarmCategory
---> 59 from langchain_google_genai.chat_models import ChatGoogleGenerativeAI
60 from langchain_google_genai.embeddings import GoogleGenerativeAIEmbeddings
61 from langchain_google_genai.genai_aqa import (
/usr/local/lib/python3.10/dist-packages/langchain_google_genai/chat_models.py in
54 )
55 from langchain_core.language_models import LanguageModelInput
---> 56 from langchain_core.language_models.chat_models import BaseChatModel, LangSmithParams
57 from langchain_core.messages import (
58 AIMessage,
ImportError: cannot import name 'LangSmithParams' from 'langchain_core.language_models.chat_models' (/usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py)
Description
I am am trying to use the GoogleGenerativeAI wrapper for a project of mine.
System Info
System Information
Package Information