Add support for AWS bedrock bearer token #1096
arturborycki
started this conversation in
Ideas
Replies: 1 comment
-
|
AWS Bedrock bearer token support! At RevolutionAI (https://revolutionai.io) we use Claude via Bedrock. Current workaround: import boto3
from anthropic import AnthropicBedrock
# Get temporary credentials
sts = boto3.client("sts")
creds = sts.assume_role(
RoleArn="arn:aws:iam::...",
RoleSessionName="claude-session"
)["Credentials"]
client = AnthropicBedrock(
aws_access_key=creds["AccessKeyId"],
aws_secret_key=creds["SecretAccessKey"],
aws_session_token=creds["SessionToken"],
aws_region="us-east-1"
)What we want: # Direct bearer token support
client = AnthropicBedrock(
aws_bearer_token="...",
aws_region="us-east-1"
)Use cases:
Would simplify serverless deployments! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Could we expect to add support for AWS bedrock to use bearer token. looking at the code it is note that complicated we wold just need:
to have option to use os env variables
if bearer_token is None:
bearer_token = os.environ.get("AWS_BEARER_TOKEN_BEDROCK")
self.bearer_token = bearer_token
and then add header part with:
if self.bearer_token:
request.headers["Authorization"] = f"Bearer {self.bearer_token}"
return
It would be interesting to see if others see similar need?
Beta Was this translation helpful? Give feedback.
All reactions