From the course: Generative AI and Large Language Models on AWS

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Invoking Claude with Bedrock

Invoking Claude with Bedrock

- [Instructor] One of the advantages of Amazon Bedrock is the ability to toggle between lots of different foundation models with just a little bit of code. And if you see here, this is a Python example, let's go ahead and walk through it. First up I have boto3, which is the unified interface for the SDK in Python for AWS. And now here's a trick here that is important to point out, is that I'm using "us-west-2" because that's where this particular model lives. So bedrock can be rolled out in different regions depending on which models that you're looking at. And then what I do is just tweak this a little bit to take a look at listing the different foundation models. And so let's go ahead and first list the foundation models that are available. So I'll go ahead and say python and we'll say list_models, right? So this is pretty nice. It tells me that anthropic is available and, for example, 2.1, I could go ahead and use that. But what I want to do next here is actually invoke it. So…

Contents