compress_text

Function compress_text 

Source
pub fn compress_text(s: &str) -> String
Expand description

Deterministically compress prompt text to reduce tokens without an LLM: trims each line, collapses internal whitespace runs to single spaces, drops blank lines, and removes consecutive duplicate lines.