CompressionRule

org.llm4s.context.CompressionRule
See theCompressionRule companion object
case class CompressionRule(name: String, apply: Seq[Message] => Seq[Message])

Represents a named compression rule that transforms a sequence of messages.

Rules are applied sequentially by DeterministicCompressor until the token budget is met. Each rule is designed to be:

  • '''Idempotent''': Applying twice produces the same result
  • '''Safe''': Never removes critical semantic information
  • '''Measurable''': Token reduction can be calculated

Value parameters

apply

The transformation function

name

Identifier for logging and debugging

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product