Get startedGet started for free

Retrieving Bedrock model details

Once your Bedrock client is set up, you can explore model details before making API calls. This can help check details about the model in advance, such as the name, identification code, and model provider.

The boto3 and json libraries have been pre-imported.

This exercise is part of the course

Introduction to Amazon Bedrock

View Course

Exercise instructions

  • Use the method to get details for the model ID provided.
  • Print the model's name.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

bedrock = boto3.client('bedrock', region_name='us-east-1')

model_id = 'anthropic.claude-3-5-sonnet-20240620-v1:0'

# Retrieve model details
response = bedrock.____(modelIdentifier=model_id)

model_info = response['modelDetails']

# Print model's name
print(model_info['____'])
Edit and Run Code