Preparing search index...
The search index is not available
llmclient
llmclient
Memory
Class Memory
A memory class to store ai interactions
Export
Implements
AIMemory
Index
Constructors
constructor
Properties
data
limit
sdata
Methods
add
add
Result
get
history
peek
reset
Constructors
constructor
new
Memory
(
limit
?
)
:
Memory
Parameters
limit
:
number
= 50
Returns
Memory
Properties
Private
data
data
:
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
= []
Private
limit
limit
:
number
Private
sdata
sdata
:
Map
<
string
,
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
>
= ...
Methods
add
add
(
value
,
sessionId
?
)
:
void
Parameters
value
:
Readonly
<
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
|
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
(
...
)
|
(
...
)
|
(
...
)
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
>
Optional
sessionId
:
string
Returns
void
add
Result
add
Result
(
result
,
sessionId
?
)
:
void
Parameters
result
:
Readonly
<
TextResponseResult
>
Optional
sessionId
:
string
Returns
void
Private
get
get
(
sessionId
?
)
:
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
Parameters
Optional
sessionId
:
string
Returns
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
history
history
(
sessionId
?
)
:
readonly
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
Parameters
Optional
sessionId
:
string
Returns
readonly
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
peek
peek
(
sessionId
?
)
:
readonly
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
Parameters
Optional
sessionId
:
string
Returns
readonly
Readonly
<
{
content
:
string
;
role
:
"system"
;
}
|
{
content
:
string
;
name
?:
string
;
role
:
"user"
;
}
|
{
content
:
null
|
string
;
functionCalls
?:
{
function
:
{
arguments
?:
string
|
object
;
name
:
string
;
}
;
id
:
string
;
type
:
"function"
;
}
[]
;
name
?:
string
;
role
:
"assistant"
;
}
|
{
content
:
string
;
functionId
:
string
;
role
:
"function"
;
}
>
[]
reset
reset
(
sessionId
?
)
:
void
Parameters
Optional
sessionId
:
string
Returns
void
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
On This Page
constructor
data
limit
sdata
add
add
Result
get
history
peek
reset
llmclient
Loading...
A memory class to store ai interactions
Export