Skip to main content

strip_reasoning

Function strip_reasoning 

Source
pub fn strip_reasoning(text: &str) -> String
Expand description

Strip inline reasoning so only the user-facing answer is surfaced: removes <think>…</think> spans (some local models inline their chain-of-thought there). Separate reasoning_content fields are never read into text, so they’re already excluded. Idempotent; trims surrounding whitespace.