Skip to main content

proportional_byte_keep

Function proportional_byte_keep 

Source
pub fn proportional_byte_keep(
    text: &str,
    total_tokens: u32,
    remaining: u32,
) -> usize
Expand description

Proportional byte budget for render-time truncation: keep remaining of total estimated tokens from a message whose content is text bytes long.