
Introducing AWSSDK.Extensions.Bedrock.MEAI
The easiest way to implement GenAI into our .NET apps
AWSSDK.Extensions.Bedrock.MEAI
makes it easy. Microsoft Extensions AI
a new library that is now the recommended approach for all us .NET developers to integrate GenAI into our apps going forward. AWSSDK.Extensions.Bedrock.MEAI
! AWSSDK.Extensions.Bedrock.MEAI
NuGet Package to our app. If you're unfamiliar with adding NuGet Packages, you can find more information here. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
using AiChatClient;
using Amazon;
using Amazon.BedrockRuntime;
using Microsoft.Extensions.AI;
IAmazonBedrockRuntime runtime = new AmazonBedrockRuntimeClient("Insert AwsCredentials AccessKeyId", "Insert AwsCredentials SecretAccessKey", RegionEndpoint.USEast1);
IChatClient client = runtime.AsChatClient(); // Abstraction provided by Microsoft.Extensions.AI
var chatMessage = new ChatMessage { Text = "Is this working?" };
await foreach (var response in client.GetStreamingResponseAsync(chatMessage, new() { ModelId = "anthropic.claude-v2" }))
{
Console.Write(response.Text);
}
AWSSDK.Extensions.Bedrock.MEAI
, AWSSDK.Extensions.Bedrock.MEAI
+ .NET MAUI. Make sure to subscribe to this blog and to watch this GitHub repo for the latest updates! Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.