Skip to content

Feature/meai - #38

Merged
GarrettBeatty merged 15 commits into
devfrom
feature/meai
Aug 6, 2026
Merged

Feature/meai#38
GarrettBeatty merged 15 commits into
devfrom
feature/meai

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

GarrettBeatty and others added 12 commits August 4, 2026 16:59
Move the Microsoft.Extensions.AI integration for Amazon Bedrock from the
aws-sdk-net repository into aws-dotnet-ai, alongside AgentCore, so all .NET
AI packages share one repo and release independently.

- Add src/AWS.Extensions.Bedrock.MEAI (renamed from AWSSDK.Extensions.Bedrock.MEAI).
  Single multi-targeting csproj (net472;netstandard2.0;net8.0), signed with
  public.snk, SourceLink + symbols, packs icon/LICENSE/NOTICE/README. The public
  API (namespace Amazon.BedrockRuntime and AmazonBedrockRuntimeExtensions) is
  unchanged, so consumers only update the package reference.
- Add test/AWS.Extensions.Bedrock.MEAI.UnitTests, ported from xUnit v2 to v3
  (net472: 173 tests, net8.0: 235 tests incl. Nova Sonic realtime).
- Rename AWS.AgentCore.slnx -> AWS.DotNetAI.slnx and add the new projects.
- Register the package in .autover/autover.json and CONTRIBUTING.md; add a
  Major change file starting the package at 1.0.0.
- ci.buildspec.yml: use the new solution name and install mono-complete so the
  net472 tests execute on Linux CodeBuild.
- AWS.AgentCore.Hosting: replace the external AWSSDK.Extensions.Bedrock.MEAI
  PackageReference with an in-repo ProjectReference.
The CI runs on Amazon Linux ARM64 (yum, not apt), so the buildspec's
`apt-get install mono-complete` failed with exit 127 and could not run the
net472 test target on Linux anyway.

- Remove the Mono install step from ci.buildspec.yml.
- Retarget the test project to net8.0 only so `dotnet test` no longer
  attempts the net472 TFM. The MEAI src package still builds all three
  TFMs (net472/netstandard2.0/net8.0) for compile coverage.

Running the net472 tests (via Mono or a Windows runner) is tracked as a
follow-up. Verified locally: MEAI tests pass 235/235 on net8.0 with no
net472 execution attempt.
Per maintainer guidance, drop "Extensions" from the package name: it is no
longer an SDK extension now that it lives in aws-dotnet-ai rather than
aws-sdk-net. Rename the package everywhere first; a namespace change is a
separate follow-up.

- Rename src/ and test/ project folders and .csproj files.
- Update PackageId, InternalsVisibleTo, and ProjectReference paths.
- Update the solution, AutoVer config + change file, CONTRIBUTING project
  list, the AWS.AgentCore.Hosting ProjectReference, and the package README.

The namespace remains Amazon.BedrockRuntime for now.
Build clean; tests pass 235/235 on net8.0.
Updated Microsoft.Extensions.AI.Abstractions package version to 10.8.3.
Clean up the warnings surfaced by the xUnit v3 analyzers and stricter
nullable checks after the v2->v3 migration, and remove the xUnit1051
<NoWarn> suppression:

- xUnit1051 (160 sites): pass TestContext.Current.CancellationToken to
  async calls (GetResponseAsync, GetStreamingResponseAsync, SendAsync,
  CreateSessionAsync, GetAsyncEnumerator) via a named cancellationToken:
  argument so it binds correctly when optional params are omitted.
- xUnit1012: make [InlineData(null)] theory parameters nullable (string?).
- CS86xx nullability: mark null-initialized locals and helper/ctor
  parameters nullable, align the TestAIFunction.AdditionalProperties
  override with the base (IReadOnlyDictionary<string, object?>), and add
  null-forgiving operators where tests assert presence or pass null
  intentionally.

Build is clean (0 warnings, 0 errors); tests still pass: net472 173/173,
net8.0 235/235.
Complete the clean break from the SDK-era identity (per normj): move the
package's own types from the Amazon.BedrockRuntime namespace to
AWS.Bedrock.MEAI. This follows the package rename.

- Change the file-scoped namespace in all 9 src types and 4 test files
  (the ExperimentalAttribute polyfill stays in System.Diagnostics.CodeAnalysis).
- Add `using Amazon.BedrockRuntime;` (and `using Amazon;` where needed) to the
  moved files that reference SDK types (IAmazonBedrockRuntime, model types,
  RegionEndpoint) which were previously resolved by the file's own namespace.
- Add `using AWS.Bedrock.MEAI;` to AWS.AgentCore.Hosting's
  AgentCoreBuilderExtensions, which calls the AsIChatClient extension method.
- Update the README migration note and code sample.

The AmazonBedrockRuntimeExtensions type name and its extension methods are
unchanged. Build clean; tests pass — MEAI 235/235, Hosting 101/101.
…space

Per review feedback: because AmazonBedrockRuntimeExtensions provides
extension methods on the IAmazonBedrockRuntime service client, keep it in
the Amazon.BedrockRuntime namespace (as with other SDK extension methods)
so the AsIChatClient/AsIEmbeddingGenerator/etc. methods stay discoverable
to callers who already have 'using Amazon.BedrockRuntime;'.

The package's other types (BedrockChatClient, BedrockStructuredOutputMode,
etc.) remain in the AWS.Bedrock.MEAI namespace. Existing call sites need no
change; the redundant 'using AWS.Bedrock.MEAI;' in the AgentCore.Hosting
consumer is removed. README and changelog updated to match.
Re-add net472 to the test project, but only on Windows: the test TFMs are
net8.0 on Linux (the default CI target) and net472;net8.0 on Windows, where
net472 executes natively. Amazon Linux CI cannot run net472 without Mono, so
the Linux repo-buildspec run stays net8.0-only and green; the aws-dotnet-ai
pipeline runs this project on a Windows testing target to cover net472.

Verified: on Windows, net8.0 235/235 and net472 173/173 pass; with OS forced
non-Windows the project resolves to net8.0 only (no net472 execution attempt).
Bump the Microsoft.Extensions.AI.Abstractions package reference from 10.5.1
to 10.8.3 in both the AWS.Bedrock.MEAI package and its unit test project.
Upgrade Microsoft.Extensions.AI.Abstractions to 10.8.3
RecordInvocationDuration/Memory* assertions took the first metric point
from a process-global static Meter and asserted on its tags. Test classes
that record invoke_agent points in parallel (e.g. AgentCoreEndpointExtensionsTests,
not in the OTelIntegration collection) could add a competing point, so the
first point was not necessarily this test's. Match against all metric points
instead of assuming a single one.
test: fix flaky AgentCore metric assertions against process-global meter
@GarrettBeatty
GarrettBeatty marked this pull request as ready for review August 5, 2026 19:32
@GarrettBeatty
GarrettBeatty requested review from a team as code owners August 5, 2026 19:32
@normj

normj commented Aug 5, 2026

Copy link
Copy Markdown
Member

@stephentoub and @tarekgh letting you know as big contributors of the work for AWSSDK.Extensions.Bedrock.MEAI we are moving the code and renaming into this repo as our home for our AWS .NET AI libraries. It will also make it easier for us to iterate on the library without the weight of being in the main SDK repo.

Comment thread buildtools/ci.buildspec.yml
@tarekgh

tarekgh commented Aug 5, 2026

Copy link
Copy Markdown

@normj thanks for letting us know. I assume you are not changing the package identity. I didn't look at the changes but assume this is the case.

CC @jeffhandley

Remove Developer Preview banner from README
@normj

normj commented Aug 5, 2026

Copy link
Copy Markdown
Member

@normj thanks for letting us know. I assume you are not changing the package identity. I didn't look at the changes but assume this is the case.

CC @jeffhandley

We are going use this opportunity to rename the package to AWS.Bedrock.MEAI a simpler name then AWSSDK.Extensions.Bedrock.MEAI and we generally reserve the AWSSDK prefix for packages that come out of the main SDK repo. It also matches the naming of the other library in this repo AWS.AgentCore.Hosting and the others we hope to add to this repo.

We plan on flagging AWSSDK.Extensions.Bedrock.MEAI and pointing to AWS.Bedrock.MEAI in NuGet to make the the transition more obvious. Since the main interaction point was the extension points in the Amazon.Bedrock namespace that won't change so code migration should be very simple.

@tarekgh

tarekgh commented Aug 5, 2026

Copy link
Copy Markdown

@normj thanks for letting us know. I assume you are not changing the package identity. I didn't look at the changes but assume this is the case.
CC @jeffhandley

We are going use this opportunity to rename the package to AWS.Bedrock.MEAI a simpler name then AWSSDK.Extensions.Bedrock.MEAI and we generally reserve the AWSSDK prefix for packages that come out of the main SDK repo. It also matches the naming of the other library in this repo AWS.AgentCore.Hosting and the others we hope to add to this repo.

We plan on flagging AWSSDK.Extensions.Bedrock.MEAI and pointing to AWS.Bedrock.MEAI in NuGet to make the the transition more obvious. Since the main interaction point was the extension points in the Amazon.Bedrock namespace that won't change so code migration should be very simple.

Thanks for the details. Please let me know when the new package gets published to NuGet.

@normj

normj commented Aug 5, 2026

Copy link
Copy Markdown
Member

@GarrettBeatty can you ping here when the new package is out for @tarekgh to get notified. Our timeline is within the next week or so. We have to do some work in the SDK repo first to get it out of it's release mechanism.

@GarrettBeatty
GarrettBeatty merged commit 1c7b6ff into dev Aug 6, 2026
5 checks passed
@GarrettBeatty
GarrettBeatty deleted the feature/meai branch August 6, 2026 15:09
@GarrettBeatty

Copy link
Copy Markdown
Contributor Author

https://www.nuget.org/packages/AWS.Bedrock.MEAI @tarekgh @jeffhandley the new nuget package has been released

@tarekgh

tarekgh commented Aug 11, 2026

Copy link
Copy Markdown

Thanks @GarrettBeatty, I'll try to switch to this package in my testing. I'll let you know if I see any issue.

@tarekgh

tarekgh commented Aug 24, 2026

Copy link
Copy Markdown

@GarrettBeatty @normj Just wanted to let you know that I tested the new package with the real-time model, and it worked perfectly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants