fix: should not force to use OPENAI_API_KEY with provider azure (#20)

This commit is contained in:
Hanchin Hsieh 2024-08-16 13:47:43 +08:00 committed by GitHub
parent 78be877a3e
commit de22014785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,7 +154,7 @@ end
local function call_openai_api_stream(question, code_lang, code_content, on_chunk, on_complete)
local api_key = os.getenv("OPENAI_API_KEY")
if not api_key then
if not api_key and config.get().provider == "openai" then
error("OPENAI_API_KEY environment variable is not set")
end