Retrieving Bedrock model details
Continuing your work with the e-commerce startup, the development team wants to understand the specific capabilities of different AI models before choosing one for their customer service chatbot. Their tech lead asks:
"To help me choose a model, is there a way to get more detailed information about each of them?"
Demonstrate how to retrieve model details to help the team make an informed decision. The boto3 and json libraries have been pre-imported.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Introduction to Amazon Bedrock
คำแนะนำการฝึกหัด
- Use the method to get details for the model ID provided.
- Print the model's name.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
bedrock = boto3.client('bedrock', region_name='us-east-1')
model_id = 'anthropic.claude-sonnet-4-5-20250929-v1:0'
# Retrieve model details
response = bedrock.____(modelIdentifier=model_id)
model_info = response['modelDetails']
# Print model's name
print(model_info['____'])