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
<PackageReference Include="Universal.Operative.Sdk.AwsBedrock" Version="1.0.0" />
<PackageVersion Include="Universal.Operative.Sdk.AwsBedrock" Version="1.0.0" />
<PackageReference Include="Universal.Operative.Sdk.AwsBedrock" />
paket add Universal.Operative.Sdk.AwsBedrock --version 1.0.0
#r "nuget: Universal.Operative.Sdk.AwsBedrock, 1.0.0"
#:package Universal.Operative.Sdk.AwsBedrock@1.0.0
#addin nuget:?package=Universal.Operative.Sdk.AwsBedrock&version=1.0.0
#tool nuget:?package=Universal.Operative.Sdk.AwsBedrock&version=1.0.0
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 | Versions 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. |
-
net10.0
- AWSSDK.BedrockRuntime (>= 3.7.514.21)
- Universal.Operative.Sdk (>= 1.3.0)
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.