Expand description
Complete-message parsing and embedding of thinking content.
These functions work on full (non-streaming) messages. For streaming,
see super::ThinkingAccumulator.
Functionsยง
- embed_
thinking_ content - Embed thinking content into a message using canonical
<think>tags. - find_ci ๐
- Case-insensitive find.
- format_
thinking_ duration - Format a duration for human display.
- has_
thinking_ content - Lightweight check for whether text begins with a thinking tag.
- parse_
duration_ ๐attr - Extract the
durationattribute value from a tag attribute string. - parse_
open_ ๐tag_ attrs - Parse the attribute section of an opening
<think ...>tag. Input should be the text after<thinkand before/including>. Returns(duration_option, rest_after_closing_bracket). - parse_
thinking_ content - Parse thinking content from a complete message.
- strip_
prefix_ ๐ci - Case-insensitive prefix strip: if
textstarts withprefix(case-insensitive), returns the rest oftext(preserving original case).