strip_think_blocks

Function strip_think_blocks 

Source
fn strip_think_blocks(s: &str) -> Option<String>
Expand description

Remove every <think>...</think> block from s.

Returns Some(new_string) when at least one block was removed, otherwise None so the caller can avoid a needless allocation. Matching is case-sensitive: each <think> is paired with the next </think> that follows it. An unclosed <think> is left intact (the upstream model is responsible for closing it).