Description:
The project is currently using deprecated classes from the langchain-community package, specifically ChatOpenAI and OpenAIEmbeddings. These classes have been moved to the langchain-openai package and will be removed in future versions of langchain-community.
To resolve the deprecation warnings and ensure compatibility with future versions of langchain, the following steps should be taken:
Ensure you have the latest versions of the langchain-openai package installed.
Update the import statements in the codebase:
Replace from langchain_community.chat_models.openai import ChatOpenAI with from langchain_openai import ChatOpenAI.
Replace from langchain_community.embeddings.openai import OpenAIEmbeddings with from langchain_openai import OpenAIEmbeddings.
Test the application thoroughly to ensure that the upgraded package does not introduce any breaking changes or unexpected behavior.
Additional notes:
The warning message also mentions that the __call__ function in LangChain has been deprecated and will be removed in version 0.2.0. The recommended replacement is the invoke function. This should also be addressed as part of the upgrade process.
Description: The project is currently using deprecated classes from the
langchain-community
package, specificallyChatOpenAI
andOpenAIEmbeddings
. These classes have been moved to thelangchain-openai
package and will be removed in future versions oflangchain-community
.To resolve the deprecation warnings and ensure compatibility with future versions of langchain, the following steps should be taken:
Ensure you have the latest versions of the langchain-openai package installed.
Update the import statements in the codebase:
from langchain_community.chat_models.openai import ChatOpenAI
withfrom langchain_openai import ChatOpenAI
.from langchain_community.embeddings.openai import OpenAIEmbeddings
withfrom langchain_openai import OpenAIEmbeddings
.Test the application thoroughly to ensure that the upgraded package does not introduce any breaking changes or unexpected behavior.
Additional notes:
__call__
function in LangChain has been deprecated and will be removed in version 0.2.0. The recommended replacement is theinvoke
function. This should also be addressed as part of the upgrade process.