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
delete |
Deletes a value at the specified path. |
get |
Gets a value from the specified path. |
has |
Checks if a value exists at the specified path. |
set |
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