Class: SwarmSDK::Tools::Think

Inherits:
RubyLLM::Tool
  • Object
show all
Defined in:
lib/swarm_sdk/tools/think.rb

Overview

Think tool for explicit reasoning and planning

Allows the agent to write down thoughts, plans, strategies, and intermediate calculations. These thoughts become part of the conversation context, enabling better attention and reasoning through complex problems.

This is inspired by research showing that explicitly articulating reasoning steps (chain-of-thought prompting) leads to significantly better outcomes, especially for complex tasks requiring multi-step reasoning or arithmetic.

Instance Method Summary collapse

Instance Method Details

#execute(**kwargs) ⇒ Object



84
85
86
87
88
89
# File 'lib/swarm_sdk/tools/think.rb', line 84

def execute(**kwargs)
  <<~RESP
    Thought noted.
  RESP
  # <system-reminder>The user cannot see your thoughts. You MUST NOT stop without giving the user a response.</system-reminder>
end

#nameObject



15
16
17
# File 'lib/swarm_sdk/tools/think.rb', line 15

def name
  "Think"
end