pub trait ReasoningParser: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn start_tag(&self) -> &str;
fn end_tag(&self) -> &str;
fn extract_thinking(
&self,
text: &str,
enable_thinking: bool,
) -> (Option<String>, String);
// Provided method
fn end_token_id(&self, tokenizer: &ChatTokenizer) -> Option<u32> { ... }
}Expand description
2026-09-26: Splits reasoning blocks out of completed model output.
Required Methods§
Sourcefn start_tag(&self) -> &str
fn start_tag(&self) -> &str
2026-09-26: Opening delimiter (e.g. "<think>", "[THINK]", "<|channel>").
Provided Methods§
Sourcefn end_token_id(&self, tokenizer: &ChatTokenizer) -> Option<u32>
fn end_token_id(&self, tokenizer: &ChatTokenizer) -> Option<u32>
2026-09-26: The end tag’s token id, or None unless the tag encodes to
exactly one token.