Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
<PackageVersion Include="CommunityToolkit.Aspire.OllamaSharp" Version="13.0.0-beta.440" />
<!-- Azure.* -->
<PackageVersion Include="Azure.AI.Projects" Version="1.2.0-beta.3" />
<PackageVersion Include="Azure.AI.Projects.OpenAI" Version="1.0.0-beta.3" />
<PackageVersion Include="Azure.AI.Projects.OpenAI" Version="1.0.0-beta.4" />
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.2.0-beta.7" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.5.0-beta.1" />
<PackageVersion Include="Azure.Identity" Version="1.17.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.4.0" />
<!-- System.* -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.0" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
<PackageVersion Include="System.ClientModel" Version="1.8.0" />
<PackageVersion Include="System.ClientModel" Version="1.8.1" />
<PackageVersion Include="System.CodeDom" Version="10.0.0" />
<PackageVersion Include="System.Collections.Immutable" Version="10.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-rc.2.25502.107" />
Expand All @@ -51,10 +51,10 @@
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.0.0" />
<!-- Microsoft.Extensions.* -->
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="10.0.0-preview.1.25559.3" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.0-preview.1.25559.3" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.1-preview.1.25571.5" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
Expand Down Expand Up @@ -95,7 +95,7 @@
<PackageVersion Include="AWSSDK.Extensions.Bedrock.MEAI" Version="4.0.4.6" />
<PackageVersion Include="Microsoft.ML.OnnxRuntimeGenAI" Version="0.10.0" />
<PackageVersion Include="OllamaSharp" Version="5.4.8" />
<PackageVersion Include="OpenAI" Version="2.6.0" />
<PackageVersion Include="OpenAI" Version="2.7.0" />
<!-- Identity -->
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.78.0" />
<!-- Workflows -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ response.RawRepresentation as ChatResponse ??
RawRepresentation = response,
ResponseId = response.ResponseId,
Usage = response.Usage,
ContinuationToken = response.ContinuationToken,
ContinuationToken = response.ContinuationToken as ResponseContinuationToken,
};
}

Expand Down Expand Up @@ -75,7 +75,7 @@ responseUpdate.RawRepresentation as ChatResponseUpdate ??
RawRepresentation = responseUpdate,
ResponseId = responseUpdate.ResponseId,
Role = responseUpdate.Role,
ContinuationToken = responseUpdate.ContinuationToken,
ContinuationToken = responseUpdate.ContinuationToken as ResponseContinuationToken,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ await thread.AIContextProvider.InvokedAsync(new(inputMessages, aiContextProvider
{
chatOptions ??= new ChatOptions();
chatOptions.AllowBackgroundResponses = agentRunOptions.AllowBackgroundResponses;
chatOptions.ContinuationToken = agentRunOptions.ContinuationToken;
chatOptions.ContinuationToken = agentRunOptions.ContinuationToken as ResponseContinuationToken;
}

return chatOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void ConstructorWithChatResponseUpdateRoundtrips()
RawRepresentation = new object(),
ResponseId = "responseId",
Role = ChatRole.Assistant,
ContinuationToken = new object(),
ContinuationToken = ResponseContinuationToken.FromBytes(new byte[] { 1, 2, 3 }),
};

AgentRunResponseUpdate response = new(chatResponseUpdate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ public void GetNewThreadUsesAIContextProviderFactoryIfProvided()
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
Expand Down Expand Up @@ -2162,8 +2162,8 @@ public async Task RunAsyncPropagatesBackgroundResponsesPropertiesToChatClientAsy
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
Expand Down Expand Up @@ -2209,7 +2209,7 @@ public async Task RunStreamingAsyncPropagatesBackgroundResponsesPropertiesToChat
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
Expand Down Expand Up @@ -2266,8 +2266,8 @@ public async Task RunStreamingAsyncPrioritizesBackgroundResponsesPropertiesFromA
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
Expand Down Expand Up @@ -2307,7 +2307,7 @@ public async Task RunStreamingAsyncPrioritizesBackgroundResponsesPropertiesFromA
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(
Expand All @@ -2332,7 +2332,7 @@ public async Task RunAsyncPropagatesContinuationTokenFromChatResponseToAgentRunR
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 },
Expand Down Expand Up @@ -2372,7 +2372,7 @@ public async Task RunAsyncThrowsWhenMessagesProvidedWithContinuationTokenAsync()

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")];

Expand All @@ -2396,7 +2396,7 @@ public async Task RunStreamingAsyncThrowsWhenMessagesProvidedWithContinuationTok

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")];

Expand Down Expand Up @@ -2459,7 +2459,7 @@ public async Task RunAsyncSkipsThreadMessagePopulationWithContinuationTokenAsync
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);
Expand Down Expand Up @@ -2521,7 +2521,7 @@ public async Task RunStreamingAsyncSkipsThreadMessagePopulationWithContinuationT
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();
Expand Down
Loading