Class: Tools::Think
Overview
A deliberate reasoning space for the agent’s inner voice. Creates a pause between tool calls where the agent can organize thoughts, plan next steps, or make decisions without interrupting the user.
Think events bridge the gap between the analytical brain (subconscious background processing) and speech (user-facing messages). Without this tool, reasoning leaks into tool arguments as comments.
Two visibility modes control how thoughts appear in the TUI:
-
inner (default) — silent reasoning, visible only in verbose/debug
-
aloud — narration shown in all view modes with a thought bubble
Class Method Summary collapse
Instance Method Summary collapse
-
#execute(input) ⇒ String
Acknowledgement — the value is in the call, not the result.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Tools::Base
Class Method Details
.description ⇒ Object
24 |
# File 'lib/tools/think.rb', line 24 def self.description = "Think out loud or silently." |
.input_schema ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tools/think.rb', line 26 def self.input_schema { type: "object", properties: { thoughts: {type: "string"}, visibility: { type: "string", enum: ["inner", "aloud"], description: "inner (default) is silent. aloud is shown to the user." } }, required: ["thoughts"] } end |
.tool_name ⇒ Object
22 |
# File 'lib/tools/think.rb', line 22 def self.tool_name = "think" |
Instance Method Details
#execute(input) ⇒ String
Returns acknowledgement — the value is in the call, not the result.
43 44 45 46 47 48 |
# File 'lib/tools/think.rb', line 43 def execute(input) thoughts = input["thoughts"].to_s return {error: "Thoughts cannot be blank"} if thoughts.strip.empty? "OK" end |