> ## Content Index
> Fetch the complete content index at: https://codetraveler.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Introducing AWSSDK.Extensions.Bedrock.MEAI
- URL: https://codetraveler.io/2025/03/25/introducing-awssdk-extensions-bedrock-meai-2/
- Published: 2025-03-25T21:54:13.000Z
- Updated: 2025-03-25T21:55:51.000Z
- Author: Brandon Minnick

Are you looking to add GenAI functionality to your .NET app? [AWSSDK.Extensions.Bedrock.MEAI](https://www.nuget.org/packages/AWSSDK.Extensions.Bedrock.MEAI/?ref=codetraveler.io) makes it easy. 

Let's define what some of these words mean, then check out how to use this NuGet Package in our apps! You're also welcome to skip the definitions and jump directly to the code below.

### What is MEAI?

"MEAI" in the package name is an acronym for [Microsoft Extensions AI](https://www.nuget.org/packages/Microsoft.Extensions.AI/?ref=codetraveler.io) a new library that is now the recommended approach for all us .NET developers to integrate GenAI into our apps going forward. 

Under the hood, MEAI provides an abstraction layer that allows us to easily swap GenAI tools and models while keeping the code in our business logic and unit tests exactly the same. If you're not already using [Microsoft AI Extensions for .NET](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/?ref=codetraveler.io), I HIGHLY recommend implementing it; your future self will thank you. 💯

### What is Bedrock?

"Bedrock" in the package name refers to [Amazon Bedrock](https://aws.amazon.com/bedrock?trk=26a307dd-f6c6-4133-a99f-0388d1304aef&sc%5Fchannel=el&ref=codetraveler.io), an [AWS](https://aws.amazon.com/?trk=26a307dd-f6c6-4133-a99f-0388d1304aef&sc%5Fchannel=el&ref=codetraveler.io) service that provides us [access to over 40+ foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html?trk=26a307dd-f6c6-4133-a99f-0388d1304aef&sc%5Fchannel=el&ref=codetraveler.io) from popular providers such as Anthropic, Meta, Mistral, DeepSeek and more.

Just for fun, let's ask the recently released [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html?trk=26a307dd-f6c6-4133-a99f-0388d1304aef&sc%5Fchannel=el&ref=codetraveler.io), to get a better explanation:

![](https://storage.ghost.io/c/dc/c2/dcc2e43e-24f8-46bb-a899-9c446f3ef794/content/images/2025/03/ScreenFlow-2.gif)

## Code

Now that we have those pesky definitions out of the way, let's create a .NET Console app that uses `AWSSDK.Extensions.Bedrock.MEAI`! 

You can find the completed code sample here: [https://github.com/TheCodeTraveler/Bedrock-MEAI-Sample](https://github.com/TheCodeTraveler/Bedrock-MEAI-Sample?ref=codetraveler.io)

Let's first create a [File -> New Console App in Visual Studio](https://learn.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio?ref=codetraveler.io).

Next, add the [AWSSDK.Extensions.Bedrock.MEAI NuGet Package](https://www.nuget.org/packages/AWSSDK.Extensions.Bedrock.MEAI?ref=codetraveler.io) to our app. If you're unfamiliar with adding NuGet Packages, you can find more information [here](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio?ref=codetraveler.io#find-and-install-a-package). 

Now we can finally write some code! 

```cs
 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.1" }))
 {
 	Console.Write(response.Text);
 } 
```

Now let's click **Run** and see what happens 👀

![](https://storage.ghost.io/c/dc/c2/dcc2e43e-24f8-46bb-a899-9c446f3ef794/content/images/2025/03/ScreenFlow-1.gif)

It works! And the crazy part is it only took a couple lines of code!

You can find the completed code sample here: [https://github.com/TheCodeTraveler/Bedrock-MEAI-Sample](https://github.com/TheCodeTraveler/Bedrock-MEAI-Sample?ref=codetraveler.io)

## Conclusion

As .NET developers, we should all be leveraging the [Microsoft AI Extensions for .NET](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/?ref=codetraveler.io) when adding GenAI to our apps. 

As new LLMs debut and as new GenAI services, like [Amazon Bedrock](https://aws.amazon.com/bedrock?trk=26a307dd-f6c6-4133-a99f-0388d1304aef&sc%5Fchannel=el&ref=codetraveler.io) continue to grow, we are all but guaranteed that we'll be swapping models and services in our production apps for the foreseeable future. But thanks to tools like [AWSSDK.Extensions.Bedrock.MEAI](https://www.nuget.org/packages/AWSSDK.Extensions.Bedrock.MEAI?ref=codetraveler.io), 

Next, I'll be exploring how to use this to build a ChatGPT clone using `AWSSDK.Extensions.Bedrock.MEAI` \+ .NET MAUI. Make sure to subscribe to this blog and to watch this GitHub repo for the latest updates! 👇

[GitHub - TheCodeTraveler/Bedrock-MEAI-Sample: A sample application demonstrating AWSSDK.Extensions.Bedrock.MEAIA sample application demonstrating AWSSDK.Extensions.Bedrock.MEAI - TheCodeTraveler/Bedrock-MEAI-Sample![](https://storage.ghost.io/c/dc/c2/dcc2e43e-24f8-46bb-a899-9c446f3ef794/content/images/icon/pinned-octocat-093da3e6fa40-15.svg)GitHubTheCodeTraveler![](https://storage.ghost.io/c/dc/c2/dcc2e43e-24f8-46bb-a899-9c446f3ef794/content/images/thumbnail/Bedrock-MEAI-Sample)](https://github.com/TheCodeTraveler/Bedrock-MEAI-Sample?ref=codetraveler.io)