Zack Saadioui
8/26/2024
1
pip install boto3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import boto3 # Establishing a session aws_session = boto3.Session( aws_access_key_id='<your_access_key>', aws_secret_access_key='<your_secret_key>', region_name='us-east-1' ) bedrock_client = aws_session.client('bedrock') response = bedrock_client.invoke_model( model_id='anthropic.claude-3-5-sonnet-20240620', body={ 'input': 'Your input text here' } ) print(response['Body'].read())
Copyright © Arsturn 2024