Skip to content

.Net: Bug: FinishReason, Usage is null in StreamingChatMessageContent.MetaData post upgrade #11677

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

Open
ssbhavesh opened this issue Apr 22, 2025 · 0 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@ssbhavesh
Copy link

ssbhavesh commented Apr 22, 2025

Describe the bug
FinishReason and other metadata fields are null when GetStreamingChatMessageContentsAsync is invoked, but non null when GetChatMessageContentsAsync is invoked for the same payload.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize chatCompletionService.
  2. Add some local plugins
  3. Invoke chatCompletionService.GetStreamingChatMessageContentsAsync and chatCompletionService.GetChatMessageContentsAsync
  4. response MetaData contains FinishReason field as null in case of GetStreamingChatMessageContentsAsync but "ToolCalls" in GetChatMessageContentsAsync which is correct expected value.
  5. In production we are using Microsoft.SemanticKernel 1.15 and FinishReason value is tool_calls which is expected but is null after upgrade.
  6. PromptExecutionSettings is as mentioned below:
    PromptExecutionSettings settings = new() { FunctionChoiceBehavior = Microsoft.SemanticKernel.FunctionChoiceBehavior.Auto(autoInvoke: false) };

Screenshots
GetChatMessageContentsAsync
Image

GetStreamingChatMessageContentsAsync
Image

Platform

  • Language: c#
  • Source: Microsoft.SemanticKernel (any version above 1.40)
  • AI model: [e.g. OpenAI:GPT-4o-mini(2024-07-18)]
  • IDE: [e.g. Visual Studio, VS Code]
  • OS: [e.g. Windows, Mac]

Additional context
Add any other context about the problem here.

@ssbhavesh ssbhavesh added the bug Something isn't working label Apr 22, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Apr 22, 2025
@github-actions github-actions bot changed the title Bug: FinishReason is null in StreamingChatMessageContent.MetaData post upgrade .Net: Bug: FinishReason is null in StreamingChatMessageContent.MetaData post upgrade Apr 22, 2025
@ssbhavesh ssbhavesh changed the title .Net: Bug: FinishReason is null in StreamingChatMessageContent.MetaData post upgrade .Net: Bug: FinishReason, Usage is null in StreamingChatMessageContent.MetaData post upgrade Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Bug
Development

No branches or pull requests

3 participants