microsoft / generative-ai-for-beginners

18 Lessons, Get Started Building with Generative AI 🔗 https://microsoft.github.io/generative-ai-for-beginners/
https://microsoft.github.io/generative-ai-for-beginners/
MIT License
61.75k stars 31.42k forks source link

Replace AZURE_OPENAI_KEY with AZURE_OPENAI_API_KEY (consistent naming of API keys) #540

Open bmerkle opened 1 month ago

bmerkle commented 1 month ago

Describe the bug Currently there are two different naming conventions for env variables for API key: one with API and one without API in the name example: OPENAI_API_KEY: This is the authorization key for using the service for non-Azure OpenAI endpoints AZURE_OPENAI_KEY: This is the authorization key for using that service (in Azure OpenAI)

I would like to rename the env variable AZURE_OPENAI_KEY into AZURE_OPENAI_API_KEY to make in more consistent regarding the naming of API keys. It should always include API_KEY if it is an API_KEY.

There are also currently already some places where the renaming happened e.g. in commit #4783eb8 this has been fixed for [04-prompt-engineering-fundamentals/python/aoai-assignment.ipynb] Also the GOOGLE_DEVELOPER_API_KEY follows this naming convention. The only exception is AZURE_OPENAI_KEY, which should be AZURE_OPENAI_API_KEY in my opinion.

My question:

I would contribute a patch for all projects or several patches for each sample step by step.

To Reproduce Different naming for API key env variables. For OPENAI we use API_KEY in the name For AZURE_OPENAI we only use KEY in the name This is somewhat inconsistent

Expected behavior Use a consistent name for all API_KEY: instead of AZURE_OPENAI_KEY better use AZURE_OPENAI_API_KEY

github-actions[bot] commented 1 month ago

👋 Thanks for contributing @bmerkle! We will review the issue and get back to you soon.

koreyspace commented 1 week ago

Hey @bmerkle , yes, I agree. Consistent naming would improve the learner experience and should include API_KEY