Reputation: 13
this code was working fine before, and now it raise this error when calling GooglePalm with langchain. The error:
----> 8 llm = GooglePalm(). NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases.
My code:
import google.generativeai as palm
from langchain.embeddings import GooglePalmEmbeddings
from langchain.llms import GooglePalm
palm.configure(api_key=GOOGLE_API_KEY)
llm = GooglePalm()
Upvotes: 0
Views: 456
Reputation: 31
This worked for me -
from langchain_google_genai import GoogleGenerativeAIEmbeddings
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001",google_api_key=api_key)
vector = embeddings.embed_query("hello, world!")
print(vector[:5])
What you are using right now has been updated to the above snippet. You could try downgrading like mentioned in the above answers as well.
Upvotes: 0
Reputation: 11
Please use a lower version of Langchain
langchain==0.0.284
langchain==0.0.339
and used code like
api_key = ''
llm = GooglePalm(google_api_key=api_key, temperature=0.2)
Upvotes: 0
Reputation: 13
I solved it by upgradown langchain version:
!pip uninstall langchain
!pip install langchain==0.0.339
Upvotes: 1