Share via


UserMemoryScope class

Memory that's scoped to the current user.

Extends

Constructors

UserMemoryScope()

Initializes a new instance of the UserMemoryScope class.

Inherited Properties

includeInSnapshot
name

Inherited Methods

delete(DialogContext)

Deletes any state in storage and the cache for this AgentState.

getMemory(DialogContext)

Get the backing memory for this scope.

load(DialogContext, boolean)

Populates the state cache for this AgentState from the storage layer.

saveChanges(DialogContext, boolean)

Writes the state cache for this AgentState to the storage layer.

setMemory(DialogContext, object)

Changes the backing object for the memory scope.

Constructor Details

UserMemoryScope()

Initializes a new instance of the UserMemoryScope class.

new UserMemoryScope()

Inherited Property Details

includeInSnapshot

includeInSnapshot: boolean

Property Value

boolean

Inherited From AgentStateMemoryScope.includeInSnapshot

name

name: string

Property Value

string

Inherited From AgentStateMemoryScope.name

Inherited Method Details

delete(DialogContext)

Deletes any state in storage and the cache for this AgentState.

function delete(_dialogContext: DialogContext): Promise<void>

Parameters

_dialogContext
DialogContext

The DialogContext object for this turn.

Returns

Promise<void>

A Promise that represents the work queued to execute.

Inherited From AgentStateMemoryScope.delete

getMemory(DialogContext)

Get the backing memory for this scope.

function getMemory(dialogContext: DialogContext): object

Parameters

dialogContext
DialogContext

current dialog context.

Returns

object

Memory for the scope.

Inherited From AgentStateMemoryScope.getMemory

load(DialogContext, boolean)

Populates the state cache for this AgentState from the storage layer.

function load(dialogContext: DialogContext, force?: boolean): Promise<void>

Parameters

dialogContext
DialogContext

The DialogContext object for this turn.

force

boolean

Optional, true to overwrite any existing state cache; or false to load state from storage only if the cache doesn't already exist.

Returns

Promise<void>

A Promise that represents the work queued to execute.

Inherited From AgentStateMemoryScope.load

saveChanges(DialogContext, boolean)

Writes the state cache for this AgentState to the storage layer.

function saveChanges(dialogContext: DialogContext, force?: boolean): Promise<void>

Parameters

dialogContext
DialogContext

The DialogContext object for this turn.

force

boolean

Optional, true to save the state cache to storage; or false to save state to storage only if a property in the cache has changed.

Returns

Promise<void>

A Promise that represents the work queued to execute.

Inherited From AgentStateMemoryScope.saveChanges

setMemory(DialogContext, object)

Changes the backing object for the memory scope.

function setMemory(dialogContext: DialogContext, _memory: object)

Parameters

dialogContext
DialogContext

current dialog context

_memory

object

memory

Inherited From AgentStateMemoryScope.setMemory