pub struct CohereCmdParser { /* private fields */ }Expand description
Cohere Command model reasoning parser.
Handles <|START_THINKING|> and <|END_THINKING|> tokens.
Unlike DeepSeek-R1, Cohere requires explicit start token (always_in_reasoning=false).
Implementations§
Trait Implementations§
Source§impl Default for CohereCmdParser
impl Default for CohereCmdParser
Source§impl ReasoningParser for CohereCmdParser
impl ReasoningParser for CohereCmdParser
Source§fn detect_and_parse_reasoning(
&mut self,
text: &str,
) -> Result<ParserResult, ParseError>
fn detect_and_parse_reasoning( &mut self, text: &str, ) -> Result<ParserResult, ParseError>
Detects and parses reasoning from the input text (one-time parsing). Read more
Source§fn parse_reasoning_streaming_incremental(
&mut self,
text: &str,
) -> Result<ParserResult, ParseError>
fn parse_reasoning_streaming_incremental( &mut self, text: &str, ) -> Result<ParserResult, ParseError>
Parses reasoning incrementally from streaming input. Read more
Source§fn model_type(&self) -> &str
fn model_type(&self) -> &str
Get the model type this parser is designed for.
Source§fn is_in_reasoning(&self) -> bool
fn is_in_reasoning(&self) -> bool
Check if the parser is currently in reasoning mode. Read more
Source§fn mark_reasoning_started(&mut self)
fn mark_reasoning_started(&mut self)
Mark that reasoning has already started (e.g.
<think> was injected in the prefill). Read moreSource§fn mark_think_start_stripped(&mut self)
fn mark_think_start_stripped(&mut self)
Mark that the
<think> start token was already consumed (in the prefill). Read moreAuto Trait Implementations§
impl Freeze for CohereCmdParser
impl RefUnwindSafe for CohereCmdParser
impl Send for CohereCmdParser
impl Sync for CohereCmdParser
impl Unpin for CohereCmdParser
impl UnsafeUnpin for CohereCmdParser
impl UnwindSafe for CohereCmdParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more