Skip to main content

extract_thinking_content

Function extract_thinking_content 

Source
pub fn extract_thinking_content(root: &Value) -> Option<String>
Expand description

Extract thinking/reasoning content from an LLM API response.

Handles:

  • Anthropic: root-level content array with type: "thinking" blocks
  • OpenAI: choices[0].message.reasoning_content field

Returns None if no thinking content is present.