feat: support Microsoft Entra ID authentication (#1274)

Co-authored-by: Matthew Brookhart <Matthew Brookhart>
This commit is contained in:
Matthew Brookhart
2025-02-26 21:00:36 -07:00
committed by GitHub
parent ae5a86103d
commit e69e7eceeb
2 changed files with 9 additions and 1 deletions

View File

@@ -517,6 +517,7 @@ M.BASE_PROVIDER_KEYS = {
"role_map",
"__inherited_from",
"disable_tools",
"entra",
}
return M

View File

@@ -23,7 +23,14 @@ function M.parse_curl_args(provider, prompt_opts)
local headers = {
["Content-Type"] = "application/json",
}
if P.env.require_api_key(provider_conf) then headers["api-key"] = provider.parse_api_key() end
if P.env.require_api_key(provider_conf) then
if provider_conf.entra then
headers["Authorization"] = "Bearer " .. provider.parse_api_key()
else
headers["api-key"] = provider.parse_api_key()
end
end
-- NOTE: When using "o" series set the supported parameters only
if O.is_o_series_model(provider_conf.model) then