MemoryScope class
Abstract base class for all memory scopes.
Constructors
| Memory |
Initializes a new instance of the MemoryScope class. |
Properties
| include |
Gets a value indicating whether this memory should be included in snapshot. |
| name | Gets or sets name of the scope |
Methods
| delete(Dialog |
Deletes the backing memory for a scope. |
| get |
Get the backing memory for this scope |
| load(Dialog |
Loads a scopes backing memory at the start of a turn. |
| save |
Saves a scopes backing memory at the end of a turn. |
| set |
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
Gets a value indicating whether this memory should be included in snapshot.
includeInSnapshot: boolean
Property Value
boolean
name
Gets or sets name of the scope
name: string
Property Value
string
Method Details
delete(DialogContext)
Deletes the backing memory for a scope.
function delete(_dc: DialogContext): Promise<void>
Parameters
- _dc
- DialogContext
Current dialog context.
Returns
Promise<void>
getMemory(DialogContext)
Get the backing memory for this scope
function getMemory(dc: DialogContext): object
Parameters
Current dialog context.
Returns
object
memory for the scope
load(DialogContext)
Loads a scopes backing memory at the start of a turn.
function load(_dc: DialogContext): Promise<void>
Parameters
- _dc
- DialogContext
Current dialog context.
Returns
Promise<void>
saveChanges(DialogContext)
Saves a scopes backing memory at the end of a turn.
function saveChanges(_dc: DialogContext): Promise<void>
Parameters
- _dc
- DialogContext
Current dialog context.
Returns
Promise<void>
setMemory(DialogContext, object)
Changes the backing object for the memory scope.
function setMemory(_dc: DialogContext, _memory: object)
Parameters
- _dc
- DialogContext
Current dialog context
- _memory
-
object
memory to assign