Share via


MemoryScope class

Abstract base class for all memory scopes.

Constructors

MemoryScope(string, boolean)

Initializes a new instance of the MemoryScope class.

Properties

includeInSnapshot
name

Methods

delete(DialogContext)

Deletes the backing memory for a scope.

getMemory(DialogContext)

Get the backing memory for this scope

load(DialogContext)

Loads a scopes backing memory at the start of a turn.

saveChanges(DialogContext)

Saves a scopes backing memory at the end of a turn.

setMemory(DialogContext, object)

Changes the backing object for the memory scope.

Constructor Details

MemoryScope(string, boolean)

Initializes a new instance of the MemoryScope class.

new MemoryScope(name: string, includeInSnapshot?: boolean)

Parameters

name

string

Name of the scope.

includeInSnapshot

boolean

Boolean value indicating whether this memory should be included in snapshot. Default value is true.

Property Details

includeInSnapshot

includeInSnapshot: boolean

Property Value

boolean

name

name: string

Property Value

string

Method Details

delete(DialogContext)

Deletes the backing memory for a scope.

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

Parameters

_dialogContext
DialogContext

Current dialog context.

Returns

Promise<void>

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

load(DialogContext)

Loads a scopes backing memory at the start of a turn.

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

Parameters

_dialogContext
DialogContext

Current dialog context.

Returns

Promise<void>

saveChanges(DialogContext)

Saves a scopes backing memory at the end of a turn.

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

Parameters

_dialogContext
DialogContext

Current dialog context.

Returns

Promise<void>

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 to assign