ChatSummaryMemoryBuffer
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:11
Deprecated
Section titled “Deprecated”Use Memory instead.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ChatSummaryMemoryBuffer(
options?
):ChatSummaryMemoryBuffer
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:22
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial
<ChatSummaryMemoryBuffer
>
Returns
Section titled “Returns”ChatSummaryMemoryBuffer
Overrides
Section titled “Overrides”Properties
Section titled “Properties”tokenizer
Section titled “tokenizer”tokenizer:
Tokenizer
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:16
Tokenizer function that converts text to tokens, this is used to calculate the number of tokens in a message.
tokensToSummarize
Section titled “tokensToSummarize”tokensToSummarize:
number
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:17
messages
Section titled “messages”messages:
ChatMessage
[]
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:18
summaryPrompt
Section titled “summaryPrompt”summaryPrompt:
SummaryPrompt
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:19
llm:
LLM
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:20
Methods
Section titled “Methods”_tokenCountForMessages()
Section titled “_tokenCountForMessages()”
protected
_tokenCountForMessages(messages
):number
Defined in: .build/typescript/packages/core/src/memory/deprecated/base.ts:48
Parameters
Section titled “Parameters”messages
Section titled “messages”Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”BaseMemory
._tokenCountForMessages
getLastSummary()
Section titled “getLastSummary()”getLastSummary():
null
|ChatMessage
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:82
Returns
Section titled “Returns”null
| ChatMessage
reset()
Section titled “reset()”reset():
void
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:130
Clears all messages from the memory.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”getMessages()
Section titled “getMessages()”getMessages(
transientMessages?
):Promise
<ChatMessage
[]>
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:134
Retrieves messages from the memory, optionally including transient messages. Compared to getAllMessages, this method a) allows for transient messages to be included in the retrieval and b) may return a subset of the total messages by applying a token limit.
Parameters
Section titled “Parameters”transientMessages?
Section titled “transientMessages?”Optional array of temporary messages to be included in the retrieval. These messages are not stored in the memory but are considered for the current interaction.
Returns
Section titled “Returns”Promise
<ChatMessage
[]>
An array of chat messages, either synchronously or as a Promise.
Overrides
Section titled “Overrides”getAllMessages()
Section titled “getAllMessages()”getAllMessages():
Promise
<ChatMessage
[]>
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:164
Retrieves all messages stored in the memory.
Returns
Section titled “Returns”Promise
<ChatMessage
[]>
An array of all chat messages, either synchronously or as a Promise.
Overrides
Section titled “Overrides”put(
message
):void
Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:168
Adds a new message to the memory.
Parameters
Section titled “Parameters”message
Section titled “message”Returns
Section titled “Returns”void