Replies: 9 comments 12 replies
-
🤖 That's great to hear that you've been working on resolving the deprecation warnings by updating the import statements. It's important to stay ahead of these changes to ensure smooth transitions for future releases. Your efforts to transition to If you haven't already, I would encourage you to consider creating a pull request with your changes. This would allow the maintainers of LangChain to review your proposed solution and determine if it aligns with the project's goals. Keep up the good work, and thank you for your contributions to LangChain! This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Try: langchain_openai is a separate package |
Beta Was this translation helpful? Give feedback.
-
OK, figured it out. Issue: Although I followed the instruction as the warning message suggested and the above discussion mentioned, i.e. "To use it run pip install -U langchain-openai and import as from langchain_openai import OpenAIEmbeddings.", the warning message still there when I run my langchain app. Cause of the issue: Solution: Guess langchain0.2.0 will/should resolve these inconsistent package issue. Summary: |
Beta Was this translation helpful? Give feedback.
-
Great! |
Beta Was this translation helpful? Give feedback.
-
Hi, I was facing similar warning issue and tried the solution given above. i.e. Solution: I hacked langchain 0.1.0 indexes, updated vectorstore.py to replace "from langchain_community.embeddings.openai import OpenAIEmbeddings" with "from langchain_openai import OpenAIEmbeddings But im getting below error now, can any expert help me here. site-packages/langchain/chat_models/init.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:
To install langchain-community run
To install langchain-community run
To install langchain-community run
To install langchain-community run
To install langchain-community run
To install langchain-community run For further information visit https://errors.pydantic.dev/2.6/u/import-error During handling of the above exception, another exception occurred: Traceback (most recent call last): -Thank you |
Beta Was this translation helpful? Give feedback.
-
Simiar issue cluttering the console and the QA team is furious. Any fixes is highly appreciated :) |
Beta Was this translation helpful? Give feedback.
-
Hi, @yardenmezi , yes, it is likely a bug in langchain0.1.0. Assume langchain will fix it in a next version, e.g. 0.2.0. hope so. Hi, @Ba40M , @abhishekc-bhs , both of you have the same warning message issue. To fix it, 1) follow the suggestions in the warning message, do pip install for all the new required packages, and update your code for "from.....import.." accordingly; 2) after that, you should see much less warning messages, if not zero warning message. If you still see some warning messages left, check your code to see any langchain lib code your code access may cause the warning message. Basically, while langchain reminds us/developers not to use some deprecated packages, but langchain forgets to do the same in some of its code. we have do it for langchain in its v0.1.0. Hope it is helpful. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I'm encountering same issue : " LangChainDeprecationWarning: The class I've exactly followed the steps but I'm still experincing same issues. I'm currently working with langchain-0.1.9 version and Python 3.8.10 version. Any assistance to fix this issues I'll appreciate. |
Beta Was this translation helpful? Give feedback.
-
I'm encountering an issue: I am currently working with langchain-0.3.4 and python version 3.12. I would assistance to fix my issue |
Beta Was this translation helpful? Give feedback.
-
Hey, I've been tackling these deprecation warnings, following the guidance to update the import statements. Specifically, I've transitioned to using
langchain_community.chat_models
forChatOpenAI
andlangchain_community.embeddings
forOpenAIEmbedding
. However, despite these adjustments, I'm still encountering the deprecation warnings outlined below:LangChainDeprecationWarning: The class
OpenAIEmbeddingswas deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use langchain_openai.OpenAIEmbeddings instead.
LangChainDeprecationWarning: The class
ChatOpenAIwas deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use langchain_openai.ChatOpenAI instead.
Beta Was this translation helpful? Give feedback.
All reactions