diff --git a/lua/avante/providers/init.lua b/lua/avante/providers/init.lua index 38689e650..4a00131f7 100644 --- a/lua/avante/providers/init.lua +++ b/lua/avante/providers/init.lua @@ -161,6 +161,8 @@ end ---@param opts {refresh: boolean, provider: AvanteProviderFunctor} ---@private E.setup = function(opts) + opts.provider.setup() + local var = opts.provider.api_key_name if var == nil or var == "" then @@ -168,8 +170,6 @@ E.setup = function(opts) return end - opts.provider.setup() - -- check if var is a all caps string if type(var) == "table" or var:match("^cmd:(.*)") then return end