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

@@ -125,7 +125,8 @@ M.parse_curl_args = function(provider, code_opts)
local headers = {
["Content-Type"] = "application/json",
}
if not P.env.is_local("openai") 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
-- NOTE: When using "o1" set the supported parameters only
local stream = true