From the course: Claude with Amazon Bedrock by Anthropic

Accessing the API

In this module, we're going to understand how to access flawed models through AWS FedRock and use them to generate some amount of text. To get started, I want to walk you through a small example app, a straightforward, standard chatbot application. So let's imagine that you are making a web app and you want to show a chat interface to a user where a user can enter in some message and then click on Send. Whenever they do so, their expectation is that some response is going to just magically appear. But, let's examine what's going on behind the scenes to actually make this happen. Whenever a user submits some text, a request containing that text is going to be made to your server. Your server is then going to use the Bedrock Client to make a request to the AWS Bedrock Service, where the Anthropic models are actually hosted. And this request made to the Bedrock Service will include something called a user message, which contains the text the user submitted, and a model ID, which specifies which model we want to run. run. The chosen model is going to run, it's going to generate some text, and it's going to be sent back to your server inside of something called an assistant message. Your server can then take that generated text and send it back down to the browser where it can be rendered on the screen for the user to view. Now in this section of the course, we're going to be entirely focused on this communication layer between this Bedrock client and the Bedrock service. We're going to investigate how to make API requests, how to access generated text and discover some common design patterns along the way. And before we move on, I want to clarify a common point of confusion, specifically the difference between the Bedrock API and the Anthropic API. First, a very quick review. Earlier on inside this course, we discussed the Quad Sonnet and the Quad Haiku models. These models are responsible for the actual computational work that is done to generate some amount of text. The Cloud Family of Models are currently hosted through two different services, AWS Bedrock and the official Anthropic API. If you're inside this course, you're going to be using the Cloud Family of Models through the AWS Bedrock service. Now here's the point you really need to be aware of. These truly are different services. They're accessed through different SDKs. They have different sources of documentation. So whenever you are looking up documentation or trying to understand how to use a model, Just be sure that you're looking at resources specifically for AWS Bedrock. Now that we've cleared up that point of confusion, let's move on to making our first request to Bedrock in the next video.

Contents