Add extra headers for OpenAI (#1615)

This commit is contained in:
Florian Engelhardt
2025-03-17 10:51:08 +01:00
committed by GitHub
parent f761e83033
commit 3b86549485
3 changed files with 8 additions and 0 deletions

View File

@@ -278,6 +278,12 @@ function M:parse_curl_args(prompt_opts)
["Content-Type"] = "application/json",
}
if provider_conf.extra_headers then
for key, value in pairs(provider_conf.extra_headers) do
headers[key] = value
end
end
if P.env.require_api_key(provider_conf) then
local api_key = self.parse_api_key()
if api_key == nil then