此代码之前工作正常,现在使用 langchain 调用 GooglePalm 时会引发此错误。 错误:
----> 8 llm = GooglePalm()。 NotImplementedError:需要确定要使用哪个默认弃用计划。之内 ??小版本发布。
我的代码:
import google.generativeai as palm
from langchain.embeddings import GooglePalmEmbeddings
from langchain.llms import GooglePalm
palm.configure(api_key=GOOGLE_API_KEY)
llm = GooglePalm()
我通过升级langchain版本解决了这个问题:
!pip uninstall langchain
!pip install langchain==0.0.339