windowSize

Adds a WindowSizePreProcessor that limits messages to the most recent size entries.

This prevents unbounded prompt growth in long conversations by keeping only a sliding window of messages.

Example:

installChatMemory {
chatHistoryProvider = MyChatHistoryProvider()
windowSize(20)
}

Return

This ChatMemoryConfig instance for fluent chaining.

Parameters

size

The maximum number of recent messages to keep.