This project is a collection of .NET demos showcasing integration with AWS Bedrock and related AI services. It is organized for clarity and maintainability, with source code under the src directory.
src/- Main source codeModels/- Data models (e.g., Movie)Services/- Service classes for Bedrock and related toolsProperties/- Project properties and launch settingsArgumentParser.cs- Command-line argument parsingProgram.cs- Main entry pointAIDemos.csproj- Project file
Authentication is handled via a .credentials file in your home directory. This file should contain your AWS credentials in the following format:
[default]
aws_access_key_id=YOUR_ACCESS_KEY
aws_secret_access_key=YOUR_SECRET_KEY
The services read these credentials to authenticate requests to AWS Bedrock. Make sure this file is present and correctly configured before running the demos.
- BedrockService: Handles basic interactions with AWS Bedrock, such as sending prompts and receiving responses.
- BedrockWithConverseToolsService: Extends BedrockService to support advanced scenarios, including tool use and multi-step conversations.
- BedrockCustomerSupportService: Demonstrates an AI-powered customer support staff using Bedrock's Converse API. Supports multi-turn, context-aware chat interactions.
- .NET 8.0 or later
- AWS credentials configured in
.credentials
dotnet buildThe main entry point is Program.cs. You can run the project with different arguments to trigger various use cases:
dotnet run --project AwsBedrockExamples -- --demo bedrock-moviedotnet run --project AwsBedrockExamples -- --demo bedrock-movie-converse-toolsdotnet run --project AwsBedrockExamples -- --demo bedrock-customer-supportThis will start an interactive chat session with an AI customer support agent. Type your questions and issues, and enter Exit Chat to end the conversation.
--demo- Runs a demo. Acceptable values are:bedrock-movie- Basic movie info demobedrock-movie-converse-tools- Structured movie info with toolsbedrock-customer-support- Interactive customer support chat demo
- Additional arguments may be supported; see
ArgumentParser.csfor details
- Ensure your
.credentialsfile is secure and not checked into version control.