Module: OllamaAgent::LLM::ThinkBlockStripper

Defined in:
lib/ollama_agent/llm/think_block_stripper.rb

Overview

Removes reasoning-only think blocks before downstream JSON parsing.

Constant Summary collapse

THINK_BLOCK =
%r{<think>.*?</think>}m

Class Method Summary collapse

Class Method Details

.strip(text) ⇒ Object



11
12
13
# File 'lib/ollama_agent/llm/think_block_stripper.rb', line 11

def strip(text)
  text.to_s.gsub(THINK_BLOCK, "").strip
end