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()
2

There are 2 best solutions below

0
On BEST ANSWER

I solved it by upgradown langchain version:

!pip uninstall langchain
!pip install langchain==0.0.339
0
On

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)