Open
Description
Describe the bug
Custom JsonSerializerOptions
passed to kernel plugins are not used.
To Reproduce
Steps to reproduce the behavior:
- Create and use a kernel plugin that was created with custom JSON options:
KernelPluginFactory.CreateFromType<PersonKernelPlugin>(
new JsonSerializerOptions { /* desired custom JSON settings */ },
"Person"
)
- Expect those settings to be used to serialize kernel function results
- Observe in the SK source code that this is not the case - instead, a static, immutable, inaccessible set of JSON options are used instead: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/InternalUtilities/connectors/AI/FunctionCalling/FunctionCallsProcessor.cs#L503-L515
Expected behavior
Custom JSON options are used so that my results are serialized as expected according to my customizations (custom converters, null handling, loop handling, etc).
Platform
- Language: C#
- Source: NuGet Microsoft.SemanticKernel 1.57.0
- AI model: N/A
- IDE: N/A
- OS: N/A
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Type
Projects
Status
Bug