Introduction
In this article, you'll learn how to create a .NET console application that uses the Amazon Bedrock Converse API to interact with the Anthropic Claude 3 Sonnet model. The application will start a conversation by asking the model to create a list of songs and then continue the conversation by asking that the songs be by artists from India.
Prerequisites
- Create an AWS account and log in. Ensure the IAM user you use has sufficient permissions to make necessary AWS service calls and manage AWS resources.
- Download and install the AWS Command Line Interface (CLI).
- Configure the AWS CLI.
- Download and install Visual Studio or Visual Studio Code.
- Download and install .NET 8.0 SDK
- Access to Amazon Bedrock foundation model
Tools
- Visual Studio 2022
Steps Involved
Perform the following steps to create a .NET console application in Visual Studio 2022 to send input text, inference parameters, and additional model-specific parameters.
- Open Visual Studio 2022.
- Click File -> New -> Project.
- Select the Console App template. Click Next.
- Enter the project name and click Next.
- Select the .NET 8.0 framework. Click Create.
- Add the following NuGet packages.
- Open Program.cs and replace the code with the following.
- Press F5 to run the application. You should see the conversation output, including the list of pop songs and the subsequent message ensuring the songs are by artists from India.
Summary
This article describes how to create a .NET console application that uses the Amazon Bedrock Converse API to interact with the Anthropic Claude 3 Sonnet model.