WindowSizePreProcessor

A ChatMemoryPreProcessor that limits the number of messages to a sliding window of the most recent windowSize messages.

Example usage:

installChatMemory {
chatHistoryProvider = MyChatHistoryProvider()
addPreProcessor(WindowSizePreProcessor(20))
}

Parameters

windowSize

The maximum number of recent messages to keep.

Constructors

Link copied to clipboard
constructor(windowSize: Int)

Functions

Link copied to clipboard
open override fun preprocess(messages: List<Message>): List<Message>