mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context The change improves the serialization and deserialization of Plan objects. ### Description Allows deserialization of Plans without a context. Adds unit tests for the Plan and ContextVariables classes, which cover various scenarios and edge cases of serializing and deserializing plans and context variables. Details: - Updates the custom converter for the ContextVariables class, which serializes and deserializes the key-value pairs as an array of objects, instead of a dictionary. This improves the efficiency and readability of the JSON format. - Add a new file PlanSerializationTests.cs to the SemanticKernel.UnitTests project, which contains unit tests for the Plan class. The tests verify that a plan can be serialized and deserialized correctly, and that the plan state is updated correctly after each step execution. The tests also check for invalid JSON strings. - Add a new file ContextVariablesConverterTests.cs to the SemanticKernel.UnitTests project, which contains unit tests for the ContextVariablesConverter class. The tests verify that the converter can correctly serialize and deserialize context variables to and from JSON, and handle null, empty, and invalid inputs.