refactor: remove redundant local field to facilitate provider configuration (#858)

This commit is contained in:
yetone
2024-11-17 02:55:40 +08:00
committed by GitHub
parent 4acdcb6e8b
commit ff85b9c1e2
8 changed files with 39 additions and 40 deletions

View File

@@ -82,7 +82,7 @@ M.parse_curl_args = function(provider, code_opts)
.. "."
.. vim.version().patch,
}
if not P.env.is_local("cohere") then headers["Authorization"] = "Bearer " .. provider.parse_api_key() end
if P.env.require_api_key(base) then headers["Authorization"] = "Bearer " .. provider.parse_api_key() end
return {
url = Utils.url_join(base.endpoint, "/chat"),