AdaptiveContextCompressor

class AdaptiveContextCompressor(shortThreshold: Int = 500, mediumThreshold: Int = 2000) : ContextCompressor

Hybrid compressor that uses different strategies based on text length.

  • Short text (<500 chars): No compression

  • Medium text (500-2000 chars): Sentence extraction

  • Long text (>2000 chars): Window extraction

Constructors

Link copied to clipboard
constructor(shortThreshold: Int = 500, mediumThreshold: Int = 2000)

Functions

Link copied to clipboard
open override fun compress(sourceText: String?, entityName: String): String?

Compress source text to extract relevant context for entity resolution.

Link copied to clipboard
open fun compressForAll(sourceText: String?, entityNames: List<String>): String?

Compress source text for multiple entities at once. May be more efficient than calling compress repeatedly.