mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Make serialize methods sync and rename one to match others. (#946)
* Make serialize methods sync and rename one to match others. * Remove unnecessary async postfixes. * Remove nullability of ChatMessageStore.Serialize return type, since the default JsonElement already represents an undefined json element. * Fix unit test
This commit is contained in:
@@ -121,14 +121,14 @@ public sealed class InMemoryChatMessageStore : ChatMessageStore, IList<ChatMessa
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ValueTask<JsonElement?> SerializeStateAsync(JsonSerializerOptions? jsonSerializerOptions = null, CancellationToken cancellationToken = default)
|
||||
public override JsonElement Serialize(JsonSerializerOptions? jsonSerializerOptions = null)
|
||||
{
|
||||
StoreState state = new()
|
||||
{
|
||||
Messages = this._messages,
|
||||
};
|
||||
|
||||
return new ValueTask<JsonElement?>(JsonSerializer.SerializeToElement(state, AgentAbstractionsJsonUtilities.DefaultOptions.GetTypeInfo(typeof(StoreState))));
|
||||
return JsonSerializer.SerializeToElement(state, AgentAbstractionsJsonUtilities.DefaultOptions.GetTypeInfo(typeof(StoreState)));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user