second-opinion-ai / second-opinion

6 stars 0 forks source link

Upgrade langchain-community package to resolve deprecation warnings #38

Open branhoff opened 2 months ago

branhoff commented 2 months ago

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:

  1. Ensure you have the latest versions of the langchain-openai package installed.

  2. 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.
  3. Test the application thoroughly to ensure that the upgraded package does not introduce any breaking changes or unexpected behavior.

Additional notes: