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

Azure OpenAI example uses OpenAI APIs #53

Closed
alfredodeza opened this issue Oct 27, 2023 · 2 comments · Fixed by #54
Closed

Azure OpenAI example uses OpenAI APIs #53

alfredodeza opened this issue Oct 27, 2023 · 2 comments · Fixed by #54
Assignees

Comments

@alfredodeza
Copy link

alfredodeza commented Oct 27, 2023

The notebook example for Azure Open AI (https://github.com/microsoft/generative-ai-for-beginners/blob/main/07-building-chat-applications/notebook-azure-openai.ipynb) is using OpenAI APIs and does not seem to demonstrate how to use it with Azure Open AI Service as the title mentions.

So this would need to get updated to either change the title to say "OpenAI" only, or update the code examples to match Azure Open AI Service

@alfredodeza
Copy link
Author

@koreyspace thanks for the changes and the PR. This issue is related to the use of "OpenAI" language instead of "Azure OpenAI".

The ticket description didn't capture this correctly. This is an example from the notebook:

openai.api_type = "azure"
openai.api_version = os.getenv("OPENAI_API_VERSION","").strip()

API_KEY = os.getenv("OPENAI_API_KEY","").strip()
assert API_KEY, "ERROR: Azure OpenAI Key is missing"
openai.api_key = API_KEY

That should be updated to:

openai.api_type = "azure"
openai.api_version = os.getenv("AZURE_OPENAI_API_VERSION","").strip()

API_KEY = os.getenv("AZURE_OPENAI_API_KEY","").strip()
assert API_KEY, "ERROR: Azure OpenAI Key is missing"
openai.api_key = API_KEY

There are also several other places in the repository with a mix of these, and those should all be updated

@leestott leestott self-assigned this Oct 31, 2023
@leestott
Copy link
Contributor

fix #72 @koreyspace

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants