Skip to content

Instantly share code, notes, and snippets.

@leehanchung
Created March 8, 2025 23:40
Show Gist options
  • Save leehanchung/bf7cfd43eaa7f8c23d48ef7ca2ab5668 to your computer and use it in GitHub Desktop.
Save leehanchung/bf7cfd43eaa7f8c23d48ef7ca2ab5668 to your computer and use it in GitHub Desktop.
testing aws bedrock seetup for claude code
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