Feature/meai - #38
Conversation
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.
This reverts commit 71063b4.
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.
38aadb2 to
528812a
Compare
test: fix flaky AgentCore metric assertions against process-global meter
|
@stephentoub and @tarekgh letting you know as big contributors of the work for |
|
@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
We are going use this opportunity to rename the package to We plan on flagging |
Thanks for the details. Please let me know when the new package gets published to NuGet. |
|
@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. |
|
https://www.nuget.org/packages/AWS.Bedrock.MEAI @tarekgh @jeffhandley the new nuget package has been released |
|
Thanks @GarrettBeatty, I'll try to switch to this package in my testing. I'll let you know if I see any issue. |
|
@GarrettBeatty @normj Just wanted to let you know that I tested the new package with the real-time model, and it worked perfectly. Thanks! |
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.