feat: allow overriding provider headers (#2161)

This commit is contained in:
Avinash Thakur
2025-06-07 23:34:00 +05:30
committed by GitHub
parent 86489ef2be
commit 8396cc77e4
12 changed files with 24 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
local P = require("avante.providers")
local Utils = require("avante.utils")
local Gemini = require("avante.providers.gemini")
---@class AvanteProviderFunctor
@@ -50,10 +51,10 @@ function M:parse_curl_args(prompt_opts)
return {
url = url,
headers = {
headers = Utils.tbl_override({
["Authorization"] = "Bearer " .. bearer_token,
["Content-Type"] = "application/json; charset=utf-8",
},
}, self.extra_headers),
proxy = provider_conf.proxy,
insecure = provider_conf.allow_insecure,
body = Gemini.prepare_request_body(self, prompt_opts, provider_conf, request_body),