Skip to content

AmazonBedrock

Rasmus Wulff Jensen edited this page Jan 27, 2026 · 1 revision

NuGet README

Features

  • AgentFactory (AmazonBedrockAgentFactory)
  • AIToolsFactory integration (tools in AmazonBedrockAgentOptions.Tools)

Package

dotnet add package AgentFrameworkToolkit.AmazonBedrock

Quick start

using AgentFrameworkToolkit.AmazonBedrock;
using Amazon;
using Microsoft.Extensions.AI;

AmazonBedrockAgentFactory agentFactory = new(new AmazonBedrockConnection
{
    Region = RegionEndpoint.EUNorth1,
    ApiKey = "<your-bedrock-api-key>"
});

AmazonBedrockAgent agent = agentFactory.CreateAgent(new AmazonBedrockAgentOptions
{
    Model = "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
    Instructions = "You are a helpful assistant",
    Tools = [AIFunctionFactory.Create((string city) => "sunny", "get_weather")]
});

AgentRunResponse response = await agent.RunAsync("Hello");
Console.WriteLine(response.Text);

Connection options

  • Region (RegionEndpoint, required)
  • ApiKey (optional, bearer token)
  • NetworkTimeout (optional)

Dependency injection

builder.Services.AddAmazonBedrockAgentFactory(RegionEndpoint.EUNorth1, "<apiKey>");
builder.Services.AddAmazonBedrockAgentFactory(new AmazonBedrockConnection
{
    Region = RegionEndpoint.EUNorth1,
    ApiKey = "<apiKey>"
});

Notes

  • ApiKey is applied via the AWS_BEARER_TOKEN_BEDROCK environment variable (if not already defined).
  • See Connections for shared credential guidance and connection patterns.
  • See AgentFactories for shared agent options and middleware.
  • See AIToolsFactory and CommonTools for tool creation.

Clone this wiki locally