0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LangchainのVersion上げたらAOAIの読み込みができなくなった

Posted at

現象

LangchainのVersion上げたらエラーでた
langchain-core (0.1.8-> 0.1.19)
エラーメッセージ

ImportError: cannot import name '_signature' from 'langchain_community.chat_models.baichuan' (/usr/local/lib/python3.12/site-packages/langchain_community/chat_models/baichuan.py)

対応方法

0.1.8では下記の記述だったが、
from langchain.chat_models import AzureChatOpenAI

あるバージョンから別ライブラリlangchain_openaiに書き出されていて、そこから引っ張ってくる必要があるらしい。
https://pypi.org/project/langchain-openai/
そして、コード内の記述は次のように切り替える必要がある。
langchain_openai.llms.azure.AzureOpenAI

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?