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