PrismMessageMemory constructor

PrismMessageMemory({
  1. int maxMessages = 20,
  2. void onSummarise(
    1. List<AiChatMessage> removed
    )?,
  3. bool keepSystemMessages = true,
})

Creates conversation memory.

maxMessages caps how many messages are kept. When the list exceeds this, the oldest messages are removed and passed to onSummarise (if set). keepSystemMessages prevents system messages from being removed.

Implementation

PrismMessageMemory({
  this.maxMessages = 20,
  this.onSummarise,
  this.keepSystemMessages = true,
});