fix: provider inherited_from (#857)

This commit is contained in:
yetone 2024-11-17 01:09:33 +08:00 committed by GitHub
parent dfc51b3247
commit 4acdcb6e8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,7 @@ M = setmetatable(M, {
local ok, module = pcall(require, "avante.providers." .. Opts.__inherited_from) local ok, module = pcall(require, "avante.providers." .. Opts.__inherited_from)
if not ok then error("Failed to load provider: " .. Opts.__inherited_from) end if not ok then error("Failed to load provider: " .. Opts.__inherited_from) end
Opts._shellenv = module.api_key_name ~= M.AVANTE_INTERNAL_KEY and module.api_key_name or nil Opts._shellenv = module.api_key_name ~= M.AVANTE_INTERNAL_KEY and module.api_key_name or nil
t[k] = vim.tbl_deep_extend("keep", BaseOpts, Opts, module) t[k] = vim.tbl_deep_extend("keep", Opts, BaseOpts, module)
else else
t[k] = Opts t[k] = Opts
end end

View File

@ -135,6 +135,9 @@ M.parse_curl_args = function(provider, code_opts)
body_opts.temperature = 1 body_opts.temperature = 1
end end
Utils.debug("endpoint", base.endpoint)
Utils.debug("model", base.model)
return { return {
url = Utils.url_join(base.endpoint, "/chat/completions"), url = Utils.url_join(base.endpoint, "/chat/completions"),
proxy = base.proxy, proxy = base.proxy,