Skip to main content

strip_think_blocks

Function strip_think_blocks 

Source
pub fn strip_think_blocks(content: &str) -> &str
Expand description

Strip reasoning/thinking blocks emitted by various models. Handles <think>, <thinking>, <reasoning> tags (DeepSeek, QwQ, open-source variants). Returns the content after the last closing tag, or the original string if none found. Should be called at the LLM layer so all downstream consumers get clean output.