79546683

Date: 2025-03-31 15:58:46
Score: 0.5
Natty:
Report link

The correct region to use for Claude 3 Haiku is RegionEndpoint.USWest2.

Long story short, you need to review the Regions Supported column from the table where Amazon lists all of its Supported foundation models in Amazon Bedrock.

Supported foundation models in Amazon Bedrock

Copy/Paste the string listed in the Amazon ID column and use a RegionEndpoint enum that corresponds to one listed in Regions Supported column.

enter image description here

Code

using AiChatClient.Common;
using AiChatClient.Console;
using Amazon;
using Amazon.BedrockRuntime;

var bedrockService = new BedrockService(
    new AmazonBedrockRuntimeClient(AwsCredentials.AccessKeyId, AwsCredentials.SecretAccessKey, RegionEndpoint.USWest2),
    "anthropic.claude-3-haiku-20240307-v1:0");

await foreach (var response in bedrockService.GetStreamingResponseAsync("Is this working?", new(), CancellationToken.None))
{
    Console.Write(response.Text);
}

More Information

Here's a blog post I wrote to help explain more: https://codetraveler.io/2025/03/25/introducing-awssdk-extensions-bedrock-meai-2/

Blog Post: Introducing AWSSDK.Extensions.Bedrock.MEAI

Reasons:
  • RegEx Blacklisted phrase (2): working?
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-2):
Posted by: Brandon Minnick