IAgentState Interface

Definition

Defines a state management object and automates the reading and writing of associated state properties to a storage layer.

public interface IAgentState
type IAgentState = interface
Public Interface IAgentState
Derived

Remarks

Each state management object defines a scope for a storage layer.

State properties are created within a state management scope, and the Agents SDK defines these scopes: ConversationState, UserState, and PrivateConversationState.

You can define additional scopes for your Agent.

Properties

Name

The scope name of the state.

Methods

ClearState()

Clears the state.

DeleteStateAsync(ITurnContext, CancellationToken)

Deletes state in storage.

DeleteValue(String)

Delete a property.

GetValue<T>(String, Func<T>)

Get a property value.

HasValue(String)

Checks for the existence of a property.

IsLoaded()

True if state has been loaded.

LoadAsync(ITurnContext, Boolean, CancellationToken)

Populates state from the storage layer.

SaveChangesAsync(ITurnContext, Boolean, CancellationToken)

Writes state to the storage layer.

SetValue<T>(String, T)

Set a property value.

Applies to

See also

  • <xref:IStorage>