You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that JsonSerializerIsReflectionEnabledByDefault is required to be enabled when using Streaming chat completion with ASP.net Core minimal Api. Is it an expected behavior of using SK?
SK is Aot Compatible, why should we still enable JsonSerializerIsReflectionEnabledByDefault explicitly.
Streaming chat completion
To use streaming chat completion, you can use the following code to generate a response from the AI agent.
CopyChatHistory history =[];history.AddUserMessage("Hello, how are you?");varresponse=chatCompletionService.GetStreamingChatMessageContentsAsync(chatHistory:history,kernel:kernel);//OpenAI.ModelSerializationExtensions' threw an exception. ---> System.InvalidOperationException: //Reflection-based serialization has been disabled for this application. //Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' propertyawaitforeach(varchunkinresponse){yieldreturnchunk.Content??string.Empty;}
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Json serialization issue when using SK Streaming chat completion in ASP.net Core minimal Api
.Net: Json serialization issue when using SK Streaming chat completion in ASP.net Core minimal Api
Dec 11, 2024
Hi @HeKeHenryZhang, I presume you don't use the ONNX AI connector, right? At the moment, we have only three Native-AOT packages: Abstractions, Core, and the ONNX AI connector, but we have plans to make more SK packages AOT-friendly.
Tasks to make {Azure} OpenAI AI connectors AOT compatible - #9972
Hi @HeKeHenryZhang, I presume you don't use the ONNX AI connector, right? At the moment, we have only three Native-AOT packages: Abstractions, Core, and the ONNX AI connector, but we have plans to make more SK packages AOT-friendly.
Tasks to make {Azure} OpenAI AI connectors AOT compatible - #9972
I find that JsonSerializerIsReflectionEnabledByDefault is required to be enabled when using Streaming chat completion with ASP.net Core minimal Api. Is it an expected behavior of using SK?
SK is Aot Compatible, why should we still enable JsonSerializerIsReflectionEnabledByDefault explicitly.
Streaming chat completion
To use streaming chat completion, you can use the following code to generate a response from the AI agent.
The text was updated successfully, but these errors were encountered: