compressHistory
fun <ToolArg, ToolResult> compressHistory(strategy: HistoryCompressionStrategy = HistoryCompressionStrategy.WholeHistory, preserveMemory: Boolean = true, executorService: ExecutorService? = null)(source)
Compresses the historical data of a tool's operations using the specified compression strategy. This method is designed for optimizing memory usage by reducing the size of stored historical data.
Return
Unit
Parameters
strategy
the strategy to use for compressing the history, defaults to the whole history compression strategy
preserveMemory
a flag indicating whether to prioritize memory preservation during compression, defaults to true
executorService
an optional executor service to perform the operation asynchronously, defaults to null