From de22014785e16b91daf76feda1edddc22e598504 Mon Sep 17 00:00:00 2001 From: Hanchin Hsieh Date: Fri, 16 Aug 2024 13:47:43 +0800 Subject: [PATCH] fix: should not force to use OPENAI_API_KEY with provider azure (#20) --- lua/avante/ai_bot.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/ai_bot.lua b/lua/avante/ai_bot.lua index f0a4b3f..7d4f473 100644 --- a/lua/avante/ai_bot.lua +++ b/lua/avante/ai_bot.lua @@ -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