fix(bedrock_httpx.py): Fix OIDC support.

This commit is contained in:
David Manouchehri 2024-05-16 18:57:13 +00:00
parent c301d0c5ca
commit 0ed01f430d
No known key found for this signature in database

View file

@ -275,7 +275,14 @@ class BedrockLLM(BaseLLM):
DurationSeconds=3600,
)
return sts_response["Credentials"]
session = boto3.Session(
aws_access_key_id=sts_response["Credentials"]["AccessKeyId"],
aws_secret_access_key=sts_response["Credentials"]["SecretAccessKey"],
aws_session_token=sts_response["Credentials"]["SessionToken"],
region_name=aws_region_name,
)
return session.get_credentials()
elif aws_role_name is not None and aws_session_name is not None:
sts_client = boto3.client(
"sts",