generative-ai-for-beginners icon indicating copy to clipboard operation
generative-ai-for-beginners copied to clipboard

Replace AZURE_OPENAI_KEY with AZURE_OPENAI_API_KEY (consistent naming of API keys)

Open bmerkle opened this issue 6 months ago • 1 comments

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:

  • should we use a consistent naming for API key variables ? (I think yes ;-) )
  • how can fix this this ? (each sample step by step, or a large change over all projects)

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

bmerkle avatar Jul 29 '24 08:07 bmerkle