Hey Vinod S ,
Thank you for reaching out on the Microsoft Q&A .
Try these steps to get your Azure OpenAI flows working again:
- Double-check environment variables: Ensure that AZURE_OPENAI_ENDPOINT (e.g., https://your-resource.azure.openai.com/) and OPENAI_API_VERSION (e.g., "2023-05-15") are set correctly.
- Match deployment names: Make sure the deployment_name in your code exactly matches the "Model deployment name" in the Azure portal. Remember, this is case-sensitive!
- Verify authentication: Confirm that your AZURE_OPENAI_API_KEY and, if applicable, AZURE_OPENAI_AD_TOKEN (for Azure AD) are set up properly for authentication.
- Install the openai package: Verify that you have the openai package installed by running pip install openai. This package is essential for communicating with the Azure OpenAI service.
- Check API version compatibility: Ensure that the openai_api_version you are using is supported by both the openai package and the Azure OpenAI service. Check the official documentation to confirm that your version (e.g., 2024-02-15-preview) is compatible.
- Consider package upgrades: There is a known issue with openai==1.2.3 and langchain==0.0.335. The langchain-openai package requires openai version 1.10.0 or higher. Upgrade your packages if necessary.
Reference: GitHub issue.
Note: Some people have resolved similar issues by using the API version 2024-02-15-preview instead of the model version displayed in the Azure table (0613). Try it out.
I hope this helps! If you have any further questions, feel free to ask.
If the information is useful, please accept the answer and upvote it to assist other community members.