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

AzureOpenAI is missing #10664

Closed
2 of 14 tasks
MChorfa opened this issue Sep 15, 2023 · 2 comments
Closed
2 of 14 tasks

AzureOpenAI is missing #10664

MChorfa opened this issue Sep 15, 2023 · 2 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: embeddings Related to text embedding models module Ɑ: models Related to LLMs or chat model modules

Comments

@MChorfa
Copy link

MChorfa commented Sep 15, 2023

System Info

Hello,
I noticed that the AzureOpenAI is missing from the latest release. Now we kind of have to create our own custom class. Is this the direction of the project?

Thank you

Who can help?

No response

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

from langchain.llms import AzureOpenAI

no logner availiable

no possibility to add engine or deployment id, nor the possibility to add extra headers

Expected behavior

from langchain.llms import AzureOpenAI

os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_BASE"] = "https://<your-endpoint.openai.azure.com/"
os.environ["OPENAI_API_KEY"] = "your AzureOpenAI key"
os.environ["OPENAI_API_VERSION"] = "2023-05-15"

embeddings = OpenAIEmbeddings(deployment="your-embeddings-deployment-name")

@dosubot dosubot bot added Ɑ: embeddings Related to text embedding models module Ɑ: models Related to LLMs or chat model modules 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Sep 15, 2023
@dosubot
Copy link

dosubot bot commented Sep 16, 2023

🤖

Hello,

Thank you for bringing this to our attention. The AzureOpenAI class is not missing but has been renamed to AzureChatOpenAI. This class is a wrapper for the Azure OpenAI chat completion API and is used to interact with a deployed model on Azure OpenAI.

Here is how you can use it:

from langchain.llms import AzureChatOpenAI

os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_BASE"] = "https://<your-endpoint.openai.azure.com/"
os.environ["OPENAI_API_KEY"] = "your AzureOpenAI key"
os.environ["OPENAI_API_VERSION"] = "2023-05-15"

embeddings = AzureChatOpenAI(deployment="your-embeddings-deployment-name")

Please note that users are not expected to create their own custom classes unless they have specific requirements that are not covered by the AzureChatOpenAI class. The AzureChatOpenAI class provides a comprehensive set of features for interacting with the Azure OpenAI chat completion API, including environment variable validation, default parameter generation, and response handling.

You can find more details about this class in the source code.

I hope this helps! If you have any other questions or issues, feel free to ask.

Best,
Dosu

Sources


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.

Copy link

dosubot bot commented Dec 18, 2023

Hi, @MChorfa,

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue you raised about the missing AzureOpenAI class has been resolved. The class has been renamed to AzureChatOpenAI in the latest release, and usage instructions were provided. It was also clarified that users are not expected to create their own custom classes unless they have specific requirements not covered by AzureChatOpenAI.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and cooperation.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 18, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: embeddings Related to text embedding models module Ɑ: models Related to LLMs or chat model modules
Projects
None yet
Development

No branches or pull requests

1 participant