Class: SwarmSDK::Tools::Think

Inherits:
Base
  • 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

Methods inherited from Base

removable, removable?, #removable?

Instance Method Details

#execute(**kwargs) ⇒ Object



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

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

#nameObject



17
18
19
# File 'lib/swarm_sdk/tools/think.rb', line 17

def name
  "Think"
end