Update to latest MEAI 10.0.1 and OpenAI 2.7.0 (#2392)

This commit is contained in:
Stephen Toub
2025-11-24 13:51:27 +00:00
committed by GitHub
parent b66efcc09d
commit a116edaf5a
5 changed files with 22 additions and 22 deletions
@@ -42,7 +42,7 @@ public class AgentRunResponseUpdateTests
RawRepresentation = new object(),
ResponseId = "responseId",
Role = ChatRole.Assistant,
ContinuationToken = new object(),
ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }),
};
AgentRunResponseUpdate response = new(chatResponseUpdate);
@@ -2113,7 +2113,7 @@ public partial class ChatClientAgentTests
public async Task RunAsyncPropagatesBackgroundResponsesPropertiesToChatClientAsync(bool providePropsViaChatOptions)
{
// Arrange
object continuationToken = new();
var continuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
ChatOptions? capturedChatOptions = null;
Mock<IChatClient> mockChatClient = new();
mockChatClient
@@ -2162,8 +2162,8 @@ public partial class ChatClientAgentTests
public async Task RunAsyncPrioritizesBackgroundResponsesPropertiesFromAgentRunOptionsOverOnesFromChatOptionsAsync()
{
// Arrange
object continuationToken1 = new();
object continuationToken2 = new();
var continuationToken1 = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
var continuationToken2 = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
ChatOptions? capturedChatOptions = null;
Mock<IChatClient> mockChatClient = new();
mockChatClient
@@ -2209,7 +2209,7 @@ public partial class ChatClientAgentTests
new ChatResponseUpdate(role: ChatRole.Assistant, content: "at?"),
];
object continuationToken = new();
var continuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
ChatOptions? capturedChatOptions = null;
Mock<IChatClient> mockChatClient = new();
mockChatClient
@@ -2266,8 +2266,8 @@ public partial class ChatClientAgentTests
new ChatResponseUpdate(role: ChatRole.Assistant, content: "wh"),
];
object continuationToken1 = new();
object continuationToken2 = new();
var continuationToken1 = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
var continuationToken2 = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
ChatOptions? capturedChatOptions = null;
Mock<IChatClient> mockChatClient = new();
mockChatClient
@@ -2307,7 +2307,7 @@ public partial class ChatClientAgentTests
public async Task RunAsyncPropagatesContinuationTokenFromChatResponseToAgentRunResponseAsync()
{
// Arrange
object continuationToken = new();
var continuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
Mock<IChatClient> mockChatClient = new();
mockChatClient
.Setup(c => c.GetResponseAsync(
@@ -2332,7 +2332,7 @@ public partial class ChatClientAgentTests
public async Task RunStreamingAsyncPropagatesContinuationTokensFromUpdatesAsync()
{
// Arrange
object token1 = new();
var token1 = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 });
ChatResponseUpdate[] expectedUpdates =
[
new ChatResponseUpdate(ChatRole.Assistant, "pa") { ContinuationToken = token1 },
@@ -2372,7 +2372,7 @@ public partial class ChatClientAgentTests
ChatClientAgent agent = new(mockChatClient.Object);
AgentRunOptions runOptions = new() { ContinuationToken = new() };
AgentRunOptions runOptions = new() { ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }) };
IEnumerable<ChatMessage> inputMessages = [new ChatMessage(ChatRole.User, "test message")];
@@ -2396,7 +2396,7 @@ public partial class ChatClientAgentTests
ChatClientAgent agent = new(mockChatClient.Object);
AgentRunOptions runOptions = new() { ContinuationToken = new() };
AgentRunOptions runOptions = new() { ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }) };
IEnumerable<ChatMessage> inputMessages = [new ChatMessage(ChatRole.User, "test message")];
@@ -2459,7 +2459,7 @@ public partial class ChatClientAgentTests
AIContextProvider = mockContextProvider.Object
};
AgentRunOptions runOptions = new() { ContinuationToken = new() };
AgentRunOptions runOptions = new() { ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }) };
// Act
await agent.RunAsync([], thread, options: runOptions);
@@ -2521,7 +2521,7 @@ public partial class ChatClientAgentTests
AIContextProvider = mockContextProvider.Object
};
AgentRunOptions runOptions = new() { ContinuationToken = new() };
AgentRunOptions runOptions = new() { ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }) };
// Act
await agent.RunStreamingAsync([], thread, options: runOptions).ToListAsync();