fix(openai): 修复无法 XML 序列化派生类的问题

This commit is contained in:
Fu Diwei
2022-11-21 13:55:13 +08:00
parent 508ef1f72a
commit 154eea7ac2
2 changed files with 22 additions and 0 deletions

View File

@@ -60,6 +60,11 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities
return Serialize(typeof(T), obj);
}
public static string Serialize(object obj)
{
return Serialize(obj.GetType(), obj);
}
public static object Deserialize(Type type, string xml)
{
using var reader = new StringReader(xml);