parse_thinking_content

Function parse_thinking_content 

Source
pub fn parse_thinking_content(text: &str) -> ParsedThinkingContent
Expand description

Parse thinking content from a complete message.

The thinking block must appear at the very start of the text. Tags are normalised before matching, so all four formats are accepted.

use gglib_core::domain::thinking::parse_thinking_content;

let r = parse_thinking_content("<think>step 1</think>\nHello!");
assert_eq!(r.thinking.as_deref(), Some("step 1"));
assert_eq!(r.content, "Hello!");