[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class AzureChatOpenAI was deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use langchain_openai.AzureChatOpenAI instead. #15674

Closed
3051360 opened this issue Jan 8, 2024 · 2 comments
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder Ɑ: models Related to LLMs or chat model modules

Comments

@3051360
Copy link
3051360 commented Jan 8, 2024

Issue with current documentation:

I created an app using AzureOpenAI, and initially, the import statement worked fine:

from langchain.chat_models import AzureChatOpenAI

My original version details were:

langchain==0.0.352
langchain-community==0.0.6
langchain-core==0.1.3
openai==1.6.1

Later, I upgraded to:

langchain==0.0.354
langchain-community==0.0.9
langchain-core==0.1.7
langchain-experimental==0.0.47
langchain-openai==0.0.2
openai==1.6.1

The upgrade led to a deprecation warning for AzureChatOpenAI. The suggestion was to use langchain_openai.AzureChatOpenAI, but trying to import it gave a ModuleNotFoundError. After some trial and error, I found that installing langchain_openai separately fixed the issue. Now, I can import AzureOpenAI, AzureOpenAIEmbeddings, and AzureChatOpenAI.

Idea or request for content:

Despite my research, I couldn't find documentation mentioning the need to install langchain_openai separately, which wasted a lot of time and created unnecessary confusion. Sharing this issue here, hope it helps others facing a similar problem. Please add this to the documentation

Copy link
dosubot bot commented Jan 8, 2024

🤖

Thank you for sharing your experience with the deprecation of AzureChatOpenAI and the need to install langchain_openai separately. Your input is valuable for improving the LangChain framework. It's great to see your proactive approach in finding a solution and your willingness to help others by suggesting an addition to the documentation. Your contribution will certainly benefit the LangChain community. Keep up the good work!


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.

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder labels Jan 8, 2024
@yontibarq
Copy link
yontibarq commented Jan 9, 2024

@baskaryan

I've seen your PR re this issue. I can see it only fixes problems with Azure, probably it is worth fixing all the OpenAI dependencies at once.

I've experienced a similar issue today. A simple upgrade of openai and langchain directly via pip did not work out. I've had to explicitly install langchain_openai to make things work, however, in my case deprecation message was about langchain_openai.OpenAIEmbeddings since I've used the old code:
from langchain.embeddings.openai import OpenAIEmbeddings

The same issue occurs on two environments: Ubuntu 20.04 and Databricks 14.2

lz-chen pushed a commit to lz-chen/langchain that referenced this issue Jan 22, 2024
@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Apr 9, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder Ɑ: models Related to LLMs or chat model modules
Projects
None yet
Development

No branches or pull requests

2 participants