Describe the bug
When attempting to serialize ChatMessageContent from any object that stores it as an object?, an exception is thrown.
To Reproduce
using System.Text.Json;
using Microsoft.SemanticKernel;
var msg = new ChatMessageContent();
msg.Items.Add(new TextContent("text"));
public class A
{
public object? Message { get; set; }
};
var a = new A { Message = msg };
var dic = new Dictionary<string, object?>() { ["foo"] = msg };
JsonSerializer.Serialize(a); // Throws.
JsonSerializer.Serialize(dic); // Throws.
Describe the bug When attempting to serialize
ChatMessageContent
from any object that stores it as anobject?
, an exception is thrown.To Reproduce