Skip to main content

chunk_markdown

Function chunk_markdown 

Source
pub fn chunk_markdown(markdown: &str, budget: usize) -> Option<Vec<String>>
Expand description

Split a large response into chunks that fit within a token budget. Splits at the nearest newline boundary to avoid breaking mid-syntax. Returns None if the content fits within the budget (no chunking needed).