compress

open suspend override fun compress(llmSession: AIAgentLLMWriteSession, preserveMemory: Boolean, memoryMessages: List<Message>)(source)

Compresses the message history in the provided session according to the specified strategy.

Parameters

llmSession

The session used for writing and managing the large language model's state.

preserveMemory

If true, ensures memory messages are preserved.

memoryMessages

The list of memory messages that should be used or referenced during compression.