feat: allow overriding bedrock provider endpoint (#2540)

This commit is contained in:
Shogo Nakamoto
2025-07-31 15:15:34 +09:00
committed by GitHub
parent 72444ac217
commit ca63356a99

View File

@@ -127,11 +127,18 @@ function M:parse_curl_args(prompt_opts)
session_token = awsCreds.session_token session_token = awsCreds.session_token
end end
local endpoint = string.format( local endpoint
if provider_conf.endpoint then
-- Use custom endpoint if provided
endpoint = provider_conf.endpoint
else
-- Default to AWS Bedrock endpoint
endpoint = string.format(
"https://bedrock-runtime.%s.amazonaws.com/model/%s/invoke-with-response-stream", "https://bedrock-runtime.%s.amazonaws.com/model/%s/invoke-with-response-stream",
region, region,
provider_conf.model provider_conf.model
) )
end
local headers = { local headers = {
["Content-Type"] = "application/json", ["Content-Type"] = "application/json",