compressHistory
suspend fun AIAgentFunctionalContext.compressHistory(strategy: HistoryCompressionStrategy = HistoryCompressionStrategy.WholeHistory, preserveMemory: Boolean = true)(source)
Compresses the current LLM prompt (message history) into a summary, replacing messages with a TLDR.
Return
The input value, unchanged.
Parameters
input
The input value that will be returned unchanged after compression.
strategy
Determines which messages to include in compression.
preserveMemory
Specifies whether to retain message memory after compression.