Share via


AppMemory interface

Interface for memory operations that provides a way to store and retrieve values by path. Allows components to persist state data during a conversation.

Methods

deleteValue(string)

Deletes a value at the specified path.

getValue<TValue>(string)

Gets a value from the specified path.

hasValue(string)

Checks if a value exists at the specified path.

setValue(string, unknown)

Sets a value at the specified path.

Method Details

deleteValue(string)

Deletes a value at the specified path.

function deleteValue(path: string)

Parameters

path

string

The path to the value to delete

getValue<TValue>(string)

Gets a value from the specified path.

function getValue<TValue>(path: string): TValue

Parameters

path

string

The path to get the value from

Returns

TValue

The value at the specified path cast to type TValue

hasValue(string)

Checks if a value exists at the specified path.

function hasValue(path: string): boolean

Parameters

path

string

The path to check

Returns

boolean

True if a value exists at the path, false otherwise

setValue(string, unknown)

Sets a value at the specified path.

function setValue(path: string, value: unknown)

Parameters

path

string

The path where the value should be stored

value

unknown

The value to store