Universal.Operative.Sdk.AwsBedrock 1.0.0

dotnet add package Universal.Operative.Sdk.AwsBedrock --version 1.0.0
                    
NuGet\Install-Package Universal.Operative.Sdk.AwsBedrock -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Universal.Operative.Sdk.AwsBedrock" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Operative.Sdk.AwsBedrock" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Operative.Sdk.AwsBedrock" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Universal.Operative.Sdk.AwsBedrock --version 1.0.0
                    
#r "nuget: Universal.Operative.Sdk.AwsBedrock, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Universal.Operative.Sdk.AwsBedrock@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Universal.Operative.Sdk.AwsBedrock&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Operative.Sdk.AwsBedrock&version=1.0.0
                    
Install as a Cake Tool

About

Universal.Operative.Sdk.AwsBedrock plugs Amazon Bedrock's Converse API into Universal.Operative.Sdk via an IModel adapter (Model) backed by the official AWSSDK.BedrockRuntime client.

Converse/ConverseStream present one provider-neutral request/response shape across every Bedrock model family that implements it — Anthropic Claude, Meta Llama, Mistral, Amazon Nova/Titan, Cohere Command, AI21 Jamba, DeepSeek, and more — so this single adapter works with any Bedrock model or cross-region inference profile. Point ModelId at whichever one you want; there's no per-family adapter to pick.

How to Use

Installation

dotnet add package Universal.Operative.Sdk.AwsBedrock

Configuration

using Universal.Operative.Sdk;
using Universal.Operative.Sdk.AwsBedrock;

// Magic credentials: resolves from the environment (AWS_ACCESS_KEY_ID /
// AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN or AWS_REGION), the shared
// credentials/config file and profile, container/instance role, SSO, etc. —
// the same default chain the AWS CLI and every other AWS SDK use.
IModel model = new Model(new Model.Options
{
    ModelId = "anthropic.claude-sonnet-4-5-20250929-v1:0",
    MaxTokens = 4096, // required by Bedrock's Converse API; defaults to 1024
});

Pass explicit credentials and/or a region when you don't want the default chain:

using Amazon.Runtime;

IModel model = new Model(new Model.Options
{
    ModelId = "us.anthropic.claude-sonnet-4-5-20250929-v1:0", // cross-region inference profile
    Region = "us-east-1",
    Credentials = new BasicAWSCredentials(accessKeyId, secretAccessKey),
});

The constructor also accepts an existing Amazon.BedrockRuntime.IAmazonBedrockRuntime in place of Options.Region/Credentials, so you can reuse a pre-built client (custom retry policy, endpoint override, assumed-role credentials, etc.) across models:

using Amazon;
using Amazon.BedrockRuntime;

IAmazonBedrockRuntime client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
IModel model = new Model(client, new Model.Options { ModelId = "meta.llama3-1-70b-instruct-v1:0" });

Usage

Drop the model into OperativeBuilder like any other IModel:

IOperative operative = OperativeBuilder.FromDefaults(model)
    .AddBaselineTools()
    .Build();

await foreach (OperativeEvent e in operative.ExecuteAsync(conversation))
{
    // handle events as usual — see Universal.Operative.Sdk's Package.md
}

Any Bedrock model

ModelId is passed through verbatim — set it to a plain model id ("anthropic.claude-3-5-sonnet-20241022-v2:0", "meta.llama3-1-70b-instruct-v1:0", "amazon.nova-pro-v1:0", "mistral.mistral-large-2407-v1:0", "cohere.command-r-plus-v1:0") or a region-prefixed cross-region inference profile id ("us.anthropic.claude-sonnet-4-5-20250929-v1:0"). Features Converse doesn't support for a given model (tool use, images, extended reasoning, ...) surface as a Bedrock ValidationException at call time — this adapter doesn't pre-validate per-model capability.

Model-specific extras

Model.Options.AdditionalModelRequestFields forwards raw JSON verbatim as Bedrock's additionalModelRequestFields — the escape hatch for knobs specific to one model family (e.g. Anthropic's thinking block when calling Claude on Bedrock) that the universal IModel surface doesn't model.

Prompt caching

Set UsePromptCaching = true to stamp a cache checkpoint on the system prompt, the tool definitions, and the last message, so repeated turns and a stable system prompt/tool set are served from Bedrock's prompt cache:

IModel model = new Model(new Model.Options
{
    ModelId = "anthropic.claude-sonnet-4-5-20250929-v1:0",
    MaxTokens = 4096,
    UsePromptCaching = true,
});

Unlike the Anthropic adapter, this defaults to false — Bedrock caching support varies by model family, and enabling it for a model that doesn't support it returns a ValidationException. Cache read/write token counts round-trip on Usage.Bedrock.CacheReadInputTokens / CacheWriteInputTokens; pass AwsBedrock.BedrockUsageExtensions.ProjectCompactionTokens as CompactionTransformer.Options.ProjectedTokensCalculator so auto-compaction accounts for them (they're additive on top of Usage.InputTokens, not included in it — the same accounting shape as Anthropic's cache counters).

License

Free for noncommercial use under the Universal.Operative Noncommercial License. Source is closed; commercial use requires a separate license from Andrew Ong.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/13/2026

Initial release.