You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried going through repo to find an example as well but couldn't. Is this supported?
fromanthropicimportAnthropicBedrockclient=AnthropicBedrock(
# Authenticate by either providing the keys below or use the default AWS credential providers, such as# using ~/.aws/credentials or the "AWS_SECRET_ACCESS_KEY" and "AWS_ACCESS_KEY_ID" environment variables.aws_access_key="<access key>",
aws_secret_key="<secret key>",
# Temporary credentials can be used with aws_session_token.# Read more at https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html.aws_session_token="<session_token>",
# aws_region changes the aws region to which the request is made. By default, we read AWS_REGION,# and if that's not present, we default to us-east-1. Note that we do not read ~/.aws/config for the region.aws_region="us-west-2",
)
message=client.messages.create(
model="anthropic.claude-3-5-sonnet-20241022-v2:0",
max_tokens=256,
messages=[{"role": "user", "content": "Hello, world"}]
)
print(message.content)
The text was updated successfully, but these errors were encountered:
hey @mohitsophos looking at the Anthropic Bedrock client I can't see the Converse (Sream) Request URLs. Also there's no tests relating to those runtimes.
Not an official answer, but I'd say it's not supported. You'd be better off using Boto3 for now until these runtimes are added.
As documented here: https://docs.anthropic.com/en/api/claude-on-amazon-bedrock#making-requests,
The following internally calls the AWS bedrock invoke API (https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-runtime_example_bedrock-runtime_InvokeModel_AnthropicClaude_section.html)
AWS also supports the converse API: https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaude_section.html
I tried going through repo to find an example as well but couldn't. Is this supported?
The text was updated successfully, but these errors were encountered: