Skip to main content

shorten_page_content

Function shorten_page_content 

Source
fn shorten_page_content(content: String) -> String
Expand description

Truncates page content until its estimated token count fits the budget we are willing to hand to the LLM. Scaling the byte length by the token ratio always shrinks the content, so this terminates in a pass or two.