-
Notifications
You must be signed in to change notification settings - Fork 867
Closed
Labels
bugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team member
Description
Describe the bug
Trying to use AWSSDK.Extensions.Bedrock.MEAI 4.0.3 fails with exceptions like:
Unhandled exception. System.TypeLoadException: Could not load type 'Amazon.BedrockRuntime.Model.CitationsDelta' from assembly 'AWSSDK.BedrockRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'.
at Amazon.BedrockRuntime.BedrockChatClient.GetStreamingResponseAsync(IEnumerable`1 messages, ChatOptions options, CancellationToken cancellationToken)+MoveNext()
at Amazon.BedrockRuntime.BedrockChatClient.GetStreamingResponseAsync(IEnumerable`1 messages, ChatOptions options, CancellationToken cancellationToken)+MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Amazon.BedrockRuntime.BedrockChatClient.GetStreamingResponseAsync(IEnumerable`1 messages, ChatOptions options, CancellationToken cancellationToken)+System.IAsyncDisposable.DisposeAsync()
4.0.2 works fine.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
Applications using the library should be able to run.
Current Behavior
Applications crash with a type load exception.
Reproduction Steps
- Add a reference to AWSSDK.Extensions.Bedrock.MEAI v4.0.3.
- Try to run code like this:
using Amazon.BedrockRuntime;
using Microsoft.Extensions.AI;
IChatClient chatClient = new AmazonBedrockRuntimeClient(
Environment.GetEnvironmentVariable("AI:Bedrock:AccessKey"!),
Environment.GetEnvironmentVariable("AI:Bedrock:SecretAccessKey")!,
Amazon.RegionEndpoint.USEast1).AsIChatClient("anthropic.claude-3-sonnet-20240229-v1:0");
await foreach (var update in chatClient.GetStreamingResponseAsync("Hello"))
{
Console.Write(update);
}
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.Extensions.Bedrock.MEAI 4.0.3
Targeted .NET Platform
.NET 9
Operating System and version
Windows 11
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team member