langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
92.89k stars 14.89k forks source link

AzureChatOpenAI: InvalidRequestError #6759

Closed UlrikWKoren closed 12 months ago

UlrikWKoren commented 1 year ago

System Info

Windows 11, python==3.10.5 langchain==0.0.215 openai==0.27.8 faiss-cpu==1.7.4

Who can help?

@zeke @sbusso @deepblue when run this example code: https://python.langchain.com/docs/modules/model_io/models/chat/integrations/azure_chat_openai I get the following error...

"InvalidRequestError: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again."

The code works if you downgrade langchain to 0.0.132

Information

Related Components

Reproduction

Follow the instructions in the notebook. https://python.langchain.com/docs/modules/model_io/models/chat/integrations/azure_chat_openai

Expected behavior

Get a response.

hanit-com commented 1 year ago

Note that the deployment name in your Azure account may not necessarily correspond to the standard name of the model. For instance, the model "get-35-turbo" could be deployed using the name "get-35". Make sure you are providing the Azure name.

UlrikWKoren commented 1 year ago

Note that the deployment name in your Azure account may not necessarily correspond to the standard name of the model. For instance, the model "get-35-turbo" could be deployed using the name "get-35". Make sure you are providing the Azure name.

I made sure to use the correct model name so it corresponds with the azure deployment. I know the azure deployment works since when I downgrade langchain to 0.0.132 the code works as intended.

hanit-com commented 1 year ago

I work with 0.0.215 and same openai version as you and it works... Can you share some of your code? BTW there is langchain 0.0.218 so maybe try to upgrade again.

dosubot[bot] commented 1 year ago

Hi, @UlrikWKoren! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you encountered an error when running an example code for AzureChatOpenAI. It seems that downgrading langchain to version 0.0.132 resolved the issue for you. In the comments, hanit-com suggested that the deployment name in your Azure account may not correspond to the standard name of the model. You confirmed using the correct model name and downgrading langchain resolved the issue. hanit-com also suggested trying to upgrade to langchain 0.0.218.

Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!