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:
@@ -67,11 +67,10 @@ public abstract class InMemoryAgentThread : AgentThread
|
||||
/// Serializes the current object's state to a <see cref="JsonElement"/> using the specified serialization options.
|
||||
/// </summary>
|
||||
/// <param name="jsonSerializerOptions">The JSON serialization options to use.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <returns>A <see cref="JsonElement"/> representation of the object's state.</returns>
|
||||
public override async Task<JsonElement> SerializeAsync(JsonSerializerOptions? jsonSerializerOptions = null, CancellationToken cancellationToken = default)
|
||||
public override JsonElement Serialize(JsonSerializerOptions? jsonSerializerOptions = null)
|
||||
{
|
||||
var storeState = await this.MessageStore.SerializeStateAsync(jsonSerializerOptions, cancellationToken).ConfigureAwait(false);
|
||||
var storeState = this.MessageStore.Serialize(jsonSerializerOptions);
|
||||
|
||||
var state = new InMemoryAgentThreadState
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user