Class: RubyCode::Views::ResponseHandler::MaxToolCalls

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/views/response_handler/max_tool_calls.rb

Overview

Builds max tool calls warning box

Class Method Summary collapse

Class Method Details

.build(max_tool_calls:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubycode/views/response_handler/max_tool_calls.rb', line 10

def self.build(max_tool_calls:)
  error_box = TTY::Box.frame(
    title: { top_left: " ⚠ WARNING " },
    border: :thick,
    padding: 1,
    style: {
      fg: :yellow,
      border: {
        fg: :yellow
      }
    }
  ) do
    "Reached maximum tool calls (#{max_tool_calls})\nStopping to prevent excessive operations."
  end
  "\n#{error_box}"
end