compressHistory

suspend fun compressHistory(strategy: HistoryCompressionStrategy = HistoryCompressionStrategy.WholeHistory, preserveMemory: Boolean = true)(source)

Compresses the current LLM prompt (message history) into a summary, replacing messages with a TLDR.

Parameters

strategy

Determines which messages to include in compression.

preserveMemory

Specifies whether to retain message memory after compression.