fix(bedrock_httpx.py): support 'Auth' header as extra_header

Fixes https://github.com/BerriAI/litellm/issues/5389#issuecomment-2313677977
This commit is contained in:
Krrish Dholakia 2024-08-27 16:08:54 -07:00
parent 1b2f73c220
commit 6431af0678
4 changed files with 25 additions and 2 deletions

View file

@ -196,6 +196,11 @@ class SagemakerLLM(BaseAWSLLM):
method="POST", url=api_base, data=encoded_data, headers=headers
)
sigv4.add_auth(request)
if (
extra_headers is not None and "Authorization" in extra_headers
): # prevent sigv4 from overwriting the auth header
request.headers["Authorization"] = extra_headers["Authorization"]
prepped_request = request.prepare()
return prepped_request