Expand description
Shared parsing for declared model reasoning protocols.
Structs§
Constants§
Functions§
- has_
unclosed_ model_ reasoning_ block - has_
unclosed_ thinking_ block - model_
reasoning_ markers - The full generated opening header and closing marker of a reasoning block. Harmony owns a separate message protocol rather than a delimited block.
- parse_
model_ reasoning_ response - Parse a cumulative generated prefix without exposing partial protocol markers. Gemma accepts only the declared thought channel; ordinary words such as “thought” remain ordinary content outside that channel.
- parse_
reasoning_ response - parse_
reasoning_ response_ for_ prompt - parse_
reasoning_ response_ started_ in_ think - Parse generated text when the rendered prompt already opened
<think>. Some reasoning templates emit only the closing tag in generated text. - should_
defer_ model_ reasoning_ stream_ delta - Hold only prefixes that can still become framing, not complete responses. Callers retain the cumulative input and parse it again when more arrives.