Skip to content

.Net: Add Usage Metadata for ChatClientChatCompletionService Adapter #12412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

RogerBarreto
Copy link
Member

Motivation and Context

As part of Agents code-base is commong practice now to acquire Usage from the ChatMessageContent.Metadata, although is different how this is done with the new Microsoft.Extensions.AI relying on the UsageDetails or UsageContent to avoid any disruption when migrating Agents to use the IChatClient. This change was made, so old code can still function.

@RogerBarreto RogerBarreto self-assigned this Jun 6, 2025
@RogerBarreto RogerBarreto requested a review from a team as a code owner June 6, 2025 20:53
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Jun 6, 2025
@RogerBarreto RogerBarreto moved this to Sprint: In Review in Semantic Kernel Jun 6, 2025
@RogerBarreto RogerBarreto enabled auto-merge June 10, 2025 08:44
@RogerBarreto RogerBarreto added this pull request to the merge queue Jun 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 10, 2025
@markwallace-microsoft
Copy link
Member

Unrelated integration test failure

[xUnit.net 00:00:40.22]     SemanticKernel.IntegrationTests.Connectors.OpenAI.OpenAIChatCompletionNonStreamingTests.ChatCompletionWithWebSearchAsync [FAIL]
[xUnit.net 00:00:40.22]       Assert.NotEmpty() Failure: Collection was empty
[xUnit.net 00:00:40.22]       Stack Trace:
[xUnit.net 00:00:40.22]         /home/runner/work/semantic-kernel/semantic-kernel/dotnet/src/IntegrationTests/Connectors/OpenAI/OpenAIChatCompletion_NonStreamingTests.cs(162,0): at SemanticKernel.IntegrationTests.Connectors.OpenAI.OpenAIChatCompletionNonStreamingTests.ChatCompletionWithWebSearchAsync()
[xUnit.net 00:00:40.22]         --- End of stack trace from previous location ---

@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jun 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 10, 2025
@markwallace-microsoft
Copy link
Member

Unrelated integration test failure. We are seeing multiple failures related to this endpoint.

[xUnit.net 00:01:54.64]     SemanticKernel.IntegrationTests.Connectors.OpenAI.OpenAIChatCompletionNonStreamingTests.ChatCompletionWithAudioInputAndOutputAsync [FAIL]
[xUnit.net 00:01:54.64]       Microsoft.SemanticKernel.HttpOperationException : Service request failed.
[xUnit.net 00:01:54.64]       Status: 503 (Service Unavailable)
[xUnit.net 00:01:54.64]       
[xUnit.net 00:01:54.64]       ---- System.ClientModel.ClientResultException : Service request failed.
[xUnit.net 00:01:54.64]       Status: 503 (Service Unavailable)

@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jun 10, 2025
Merged via the queue into microsoft:main with commit ab0a70e Jun 10, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from Sprint: In Review to Sprint: Done in Semantic Kernel Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants