from langchain.chat_models import ChatOpenAI # Old import
Error:
LangChainDeprecationWarning: The class `ChatOpenAI` was
deprecated in LangChain 0.1.0 and will be removed in 0.3.0. Use
langchain_openai.ChatOpenAI instead.

from langchain.chat_models import ChatOpenAI # Old import
Error:
LangChainDeprecationWarning: The class `ChatOpenAI` was
deprecated in LangChain 0.1.0 and will be removed in 0.3.0. Use
langchain_openai.ChatOpenAI instead.
Fix:
pip install langchain-openai
# Update code import:
from langchain_openai import ChatOpenAI
Tell us about your project and get help tailored to your problem.
Contact usEveryone can read. Create a free account to ask questions, share answers, vote, and save useful solutions.