Table of Contents

Interface ISaveState

Namespace
Microsoft.AutoGen.Contracts
Assembly
Microsoft.AutoGen.Contracts.dll

Defines a contract for saving and loading the state of an object. The state must be JSON serializable.

public interface ISaveState

Methods

DefaultSaveStateAsync()

public static ValueTask<JsonElement> DefaultSaveStateAsync()

Returns

ValueTask<JsonElement>

LoadStateAsync(JsonElement)

Loads a previously saved state into the object.

ValueTask LoadStateAsync(JsonElement state)

Parameters

state JsonElement

A dictionary representing the saved state. The structure of the state is implementation-defined but must be JSON serializable.

Returns

ValueTask

A task representing the asynchronous operation.

SaveStateAsync()

Saves the current state of the object.

ValueTask<JsonElement> SaveStateAsync()

Returns

ValueTask<JsonElement>

A task representing the asynchronous operation, returning a dictionary containing the saved state. The structure of the state is implementation-defined but must be JSON serializable.