Partager via


AutoSaveStateMiddleware Class

Definition

Middleware to automatically persist state before the end of each turn.

public class AutoSaveStateMiddleware : Microsoft.Agents.Builder.IMiddleware
type AutoSaveStateMiddleware = class
    interface IMiddleware
Public Class AutoSaveStateMiddleware
Implements IMiddleware
Inheritance
AutoSaveStateMiddleware
Implements

Remarks

This calls SaveChangesAsync(ITurnContext, Boolean, CancellationToken) on each state object it manages.

Constructors

AutoSaveStateMiddleware(Boolean, IAgentState[])

Allows for optionally auto-loading AgentState at turn start.

AutoSaveStateMiddleware(IAgentState[])

Initializes a new instance of the AutoSaveStateMiddleware class.

AutoSaveStateMiddleware(ITurnState)

Initializes a new instance of the AutoSaveStateMiddleware class with a list of state management objects managed by this object.

Properties

TurnState

Gets or sets the list of state management objects managed by this object.

Methods

OnTurnAsync(ITurnContext, NextDelegate, CancellationToken)

Before the turn ends, calls SaveChangesAsync(ITurnContext, Boolean, CancellationToken) on each state object.

Applies to