Created
March 8, 2025 23:40
-
-
Save leehanchung/bf7cfd43eaa7f8c23d48ef7ca2ab5668 to your computer and use it in GitHub Desktop.
testing aws bedrock seetup for claude code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
client = boto3.client('bedrock-runtime', region_name='us-east-1') | |
response = client.invoke_model( | |
modelId='us.anthropic.claude-3-7-sonnet-2025-0219-v1:0', | |
body=json.dumps({ | |
"anthropic_version": "bedrock-2023-05-31", | |
"messages": [ | |
{ | |
"role": "user", | |
"content": [{"type": "text", "text": "wassup cluade do you code"}], | |
} | |
], | |
"max_tokens": 200 | |
}) | |
) | |
print(response['body'].read().decode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment