Class: SimpleChatStore<AdditionalMessageOptions>
fixme: User could carry object references in the messages. This could lead to memory leaks if the messages are not properly cleaned up.
Type Parameters
• AdditionalMessageOptions extends object
= Record
<string
, unknown
>
Implements
BaseChatStore
<AdditionalMessageOptions
>
Constructors
new SimpleChatStore()
new SimpleChatStore<
AdditionalMessageOptions
>():SimpleChatStore
<AdditionalMessageOptions
>
Returns
SimpleChatStore
<AdditionalMessageOptions
>
Properties
store
store:
object
={}
Index Signature
[key
: string
]: ChatMessage
<AdditionalMessageOptions
>[]
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:12
Methods
addMessage()
addMessage(
key
,message
):void
Parameters
• key: string
• message: ChatMessage
<AdditionalMessageOptions
>
Returns
void
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:25
deleteLastMessage()
deleteLastMessage(
key
):null
|ChatMessage
<AdditionalMessageOptions
>
Parameters
• key: string
Returns
null
| ChatMessage
<AdditionalMessageOptions
>
Implementation of
BaseChatStore
.deleteLastMessage
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:52
deleteMessage()
deleteMessage(
key
,idx
):null
|ChatMessage
<AdditionalMessageOptions
>
Parameters
• key: string
• idx: number
Returns
null
| ChatMessage
<AdditionalMessageOptions
>
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:42
deleteMessages()
deleteMessages(
key
):null
|ChatMessage
<AdditionalMessageOptions
>[]
Parameters
• key: string
Returns
null
| ChatMessage
<AdditionalMessageOptions
>[]
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:33
getKeys()
getKeys():
string
[]
Returns
string
[]
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:62
getMessages()
getMessages(
key
):ChatMessage
<AdditionalMessageOptions
>[]
Parameters
• key: string
Returns
ChatMessage
<AdditionalMessageOptions
>[]
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:21
setMessages()
setMessages(
key
,messages
):void
Parameters
• key: string
• messages: ChatMessage
<AdditionalMessageOptions
>[]
Returns
void
Implementation of
Defined in
packages/llamaindex/src/storage/chatStore/SimpleChatStore.ts:14