llmflows icon indicating copy to clipboard operation
llmflows copied to clipboard

OpenAI() key default to "OPENAI_API_KEY"

Open iuiu34 opened this issue 1 year ago • 1 comments

Describe the issue:

OpenAI() has arg api_key. Why this does not default to os.environ['OPENAI_API_KEY']?

Expected behavior

OpenAI() is callable without args

Reproduce the code example:

`OpenAI()`

Error message:

No response

Context for the issue:

No response

iuiu34 avatar Dec 13 '23 19:12 iuiu34

hi @iuiu34 thanks for bringing this up. I also had some feedback that loading API keys by default can create some issues like using the wrong API key. Another concern I have is that if one model provider does that by default and the rest don't this creates inconsistencies in the API. I will keep this open until I get some more user feedback.

stoyan-stoyanov avatar Jan 23 '24 07:01 stoyan-stoyanov