Skip to content

ChatSummaryMemoryBuffer

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:11

Use Memory instead.

new ChatSummaryMemoryBuffer(options?): ChatSummaryMemoryBuffer

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:22

Partial<ChatSummaryMemoryBuffer>

ChatSummaryMemoryBuffer

BaseMemory.constructor

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: number

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:17


messages: ChatMessage[]

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:18


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

protected _tokenCountForMessages(messages): number

Defined in: .build/typescript/packages/core/src/memory/deprecated/base.ts:48

ChatMessage[]

number

BaseMemory._tokenCountForMessages


getLastSummary(): null | ChatMessage

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:82

null | ChatMessage


reset(): void

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:130

Clears all messages from the memory.

void

BaseMemory.reset


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.

ChatMessage[]

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.

Promise<ChatMessage[]>

An array of chat messages, either synchronously or as a Promise.

BaseMemory.getMessages


getAllMessages(): Promise<ChatMessage[]>

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:164

Retrieves all messages stored in the memory.

Promise<ChatMessage[]>

An array of all chat messages, either synchronously or as a Promise.

BaseMemory.getAllMessages


put(message): void

Defined in: .build/typescript/packages/core/src/memory/deprecated/summary-memory.ts:168

Adds a new message to the memory.

ChatMessage

void

BaseMemory.put