semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Bug: "GetStreamingChatMessageContentsAsync" is not working properly

Open EachShow opened this issue 1 year ago • 3 comments

Describe the bug "GetStreamingChatMessageContentsAsync" is not working properly

To Reproduce update Microsoft.SemanticKernel.Connectors to V1.15.0

Expected behavior Receive streaming output correctly

Screenshots

Platform

  • OS: Windows
  • IDE: Visual Studio
  • Language: C#, Python
  • Source: NuGet Microsoft.SemanticKernel.Connectors 1.15.0

Additional context the exception info: Method not found: 'System.String Microsoft.SemanticKernel.FunctionResultContent.get_Id()'.|System.MissingMethodException: Method not found: 'System.String Microsoft.SemanticKernel.FunctionResultContent.get_Id()'. at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetRequestMessages(ChatMessageContent message, ToolCallBehavior toolCallBehavior) at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.CreateChatCompletionsOptions(OpenAIPromptExecutionSettings executionSettings, ChatHistory chatHistory, Kernel kernel, String deploymentOrModelName) at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetStreamingChatMessageContentsAsync(ChatHistory chat, PromptExecutionSettings executionSettings, Kernel kernel, CancellationToken cancellationToken)+MoveNext() at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetStreamingChatMessageContentsAsync(ChatHistory chat, PromptExecutionSettings executionSettings, Kernel kernel, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()

EachShow avatar Jun 24 '24 11:06 EachShow

@EachShow, mind providing some pieces of the code you are using?

This is a very central API method where we have plenty of UnitTests, we need to understand what's the context of this error.

Are you using it against OpenAI/Azure OpenAI or Non-OpenAI models?

rogerbarreto avatar Jun 28 '24 23:06 rogerbarreto

@RogerBarreto I was able to reproduce this issue by also adding the Google connector package: Microsoft.SemanticKernel.Connectors.Google" Version="1.15.0-alpha" When you then try using the OpenAIChatCompletion, you will encounter the error.

DoguhanHarmanda avatar Jun 30 '24 08:06 DoguhanHarmanda

// I using it against Azure OpenAI

var chat = new AzureOpenAIChatCompletionService(....); var response = chat.GetStreamingChatMessageContentsAsync(chatHistory);

await foreach (var item in response) // the exception is occurred here { // do something }

EachShow avatar Jul 03 '24 03:07 EachShow

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Oct 02 '24 02:10 github-actions[bot]

@EachShow We had many updates to our streaming APIs regarding the latest 90 days, let me know if you still have this issue.

Thanks.

rogerbarreto avatar Oct 02 '24 10:10 rogerbarreto