Table of Contents

Interface IAgentState

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

Interface for managing the state of an agent.

public interface IAgentState

Methods

ReadStateAsync(CancellationToken)

Reads the current state of the agent asynchronously.

ValueTask<AgentState> ReadStateAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

ValueTask<AgentState>

A task that represents the asynchronous read operation. The task result contains the current state of the agent.

WriteStateAsync(AgentState, string, CancellationToken)

Writes the specified state of the agent asynchronously.

ValueTask<string> WriteStateAsync(AgentState state, string eTag, CancellationToken cancellationToken = default)

Parameters

state AgentState

The state to write.

eTag string

The ETag for concurrency control.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

ValueTask<string>

A task that represents the asynchronous write operation. The task result contains the ETag of the written state.