Skip to content

Commit 6291383

Browse files
.Net: Update Amazon packages (#12607)
### Motivation and Context - Update all Amazon Related packages. - Extra bump on Analyzers - Agent + Connector Codebase IT passing. ![image](https://github.com/user-attachments/assets/2e18278e-a206-4698-9f31-10cafc9bad17) --------- Co-authored-by: SergeyMenshykh <[email protected]>
1 parent ec58e2b commit 6291383

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

dotnet/Directory.Packages.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.3.1" />
1111
<PackageVersion Include="Aspire.Hosting.Azure.CognitiveServices" Version="9.3.1" />
1212
<PackageVersion Include="Aspire.Hosting.Azure.Search" Version="9.3.1" />
13-
<PackageVersion Include="AWSSDK.BedrockAgent" Version="4.0.0-preview.13" />
14-
<PackageVersion Include="AWSSDK.BedrockAgentRuntime" Version="4.0.0-preview.13" />
15-
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="4.0.0.2" />
16-
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.3" />
17-
<PackageVersion Include="AWSSDK.Extensions.Bedrock.MEAI" Version="4.0.0-preview.16" />
18-
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.0" />
19-
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.0.2" />
13+
<PackageVersion Include="AWSSDK.BedrockAgent" Version="4.0.3.7" />
14+
<PackageVersion Include="AWSSDK.BedrockAgentRuntime" Version="4.0.4.6" />
15+
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="4.0.0.11" />
16+
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.13" />
17+
<PackageVersion Include="AWSSDK.Extensions.Bedrock.MEAI" Version="4.0.1.1" />
18+
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.2" />
19+
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.1.2" />
2020
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.0.0" />
2121
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
2222
<PackageVersion Include="Azure.AI.Inference" Version="1.0.0-beta.5" />
@@ -187,12 +187,12 @@
187187
<PrivateAssets>all</PrivateAssets>
188188
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
189189
</PackageReference>
190-
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
190+
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
191191
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
192192
<PrivateAssets>all</PrivateAssets>
193193
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
194194
</PackageReference>
195-
<PackageVersion Include="xunit.analyzers" Version="1.17.0" />
195+
<PackageVersion Include="xunit.analyzers" Version="1.22.0" />
196196
<PackageReference Include="xunit.analyzers">
197197
<PrivateAssets>all</PrivateAssets>
198198
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

dotnet/src/Connectors/Connectors.AzureOpenAI.UnitTests/Services/AzureOpenAIChatCompletionServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,12 +1362,12 @@ public async Task FunctionResultsCanBeProvidedToLLMAsManyResultsInOneChatMessage
13621362
public async Task GetChatMessageContentShouldSendMutatedChatHistoryToLLM()
13631363
{
13641364
// Arrange
1365-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
1365+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
13661366
{
13671367
// Remove the function call messages from the chat history to reduce token count.
13681368
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
13691369

1370-
next(context);
1370+
return next(context);
13711371
}
13721372

13731373
var kernel = new Kernel();
@@ -1433,12 +1433,12 @@ static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFu
14331433
public async Task GetStreamingChatMessageContentsShouldSendMutatedChatHistoryToLLM()
14341434
{
14351435
// Arrange
1436-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
1436+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
14371437
{
14381438
// Remove the function call messages from the chat history to reduce token count.
14391439
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
14401440

1441-
next(context);
1441+
return next(context);
14421442
}
14431443

14441444
var kernel = new Kernel();

dotnet/src/Connectors/Connectors.MistralAI.UnitTests/Services/MistralAIChatCompletionServiceTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ public async Task ValidateGetStreamingChatMessageContentsAsync()
7777
public async Task GetChatMessageContentShouldSendMutatedChatHistoryToLLMAsync()
7878
{
7979
// Arrange
80-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
80+
static Task MutateChatHistoryAsync(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
8181
{
8282
// Remove the function call messages from the chat history to reduce token count.
8383
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
8484

85-
next(context);
85+
return next(context);
8686
}
8787

8888
var kernel = new Kernel();
8989
kernel.ImportPluginFromFunctions("WeatherPlugin", [KernelFunctionFactory.CreateFromMethod((string location) => "rainy", "GetWeather")]);
90-
kernel.AutoFunctionInvocationFilters.Add(new AutoFunctionInvocationFilter(MutateChatHistory));
90+
kernel.AutoFunctionInvocationFilters.Add(new AutoFunctionInvocationFilter(MutateChatHistoryAsync));
9191

9292
var firstResponse = this.GetTestResponseAsBytes("chat_completions_function_call_response.json");
9393
var secondResponse = this.GetTestResponseAsBytes("chat_completions_function_called_response.json");
@@ -149,12 +149,12 @@ static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFu
149149
public async Task GetStreamingChatMessageContentsShouldSendMutatedChatHistoryToLLMAsync()
150150
{
151151
// Arrange
152-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
152+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
153153
{
154154
// Remove the function call messages from the chat history to reduce token count.
155155
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
156156

157-
next(context);
157+
return next(context);
158158
}
159159

160160
var kernel = new Kernel();

dotnet/src/Connectors/Connectors.Ollama.UnitTests/Services/OllamaChatCompletionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,12 +700,12 @@ public async Task GetChatMessageContentsWithFunctionCallMaximumAutoInvokeAttempt
700700
public async Task GetChatMessageContentShouldSendMutatedChatHistoryToLLMAsync()
701701
{
702702
// Arrange
703-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
703+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
704704
{
705705
// Remove the function call messages from the chat history to reduce token count.
706706
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
707707

708-
next(context);
708+
return next(context);
709709
}
710710

711711
var kernel = new Kernel();

dotnet/src/Connectors/Connectors.OpenAI.UnitTests/Services/OpenAIChatCompletionServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,12 +1107,12 @@ public async Task GetInvalidResponseThrowsExceptionAndIsCapturedByDiagnosticsAsy
11071107
public async Task GetChatMessageContentShouldSendMutatedChatHistoryToLLM()
11081108
{
11091109
// Arrange
1110-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
1110+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
11111111
{
11121112
// Remove the function call messages from the chat history to reduce token count.
11131113
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
11141114

1115-
next(context);
1115+
return next(context);
11161116
}
11171117

11181118
var kernel = new Kernel();
@@ -1178,12 +1178,12 @@ static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFu
11781178
public async Task GetStreamingChatMessageContentsShouldSendMutatedChatHistoryToLLM()
11791179
{
11801180
// Arrange
1181-
static void MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
1181+
static Task MutateChatHistory(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
11821182
{
11831183
// Remove the function call messages from the chat history to reduce token count.
11841184
context.ChatHistory.RemoveRange(1, 2); // Remove the `Date` function call and function result messages.
11851185

1186-
next(context);
1186+
return next(context);
11871187
}
11881188

11891189
var kernel = new Kernel();

dotnet/src/IntegrationTests/Connectors/Amazon/Bedrock/BedrockTextGenerationTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public class BedrockTextGenerationTests
1515
[InlineData("cohere.command-r-v1:0")]
1616
[InlineData("cohere.command-r-plus-v1:0")]
1717
[InlineData("ai21.jamba-instruct-v1:0")]
18-
[InlineData("ai21.j2-ultra-v1")]
19-
[InlineData("ai21.j2-mid-v1")]
2018
[InlineData("meta.llama3-70b-instruct-v1:0")]
2119
[InlineData("meta.llama3-8b-instruct-v1:0")]
2220
[InlineData("mistral.mistral-7b-instruct-v0:2")]

0 commit comments

Comments
 (0)