Class: ToolCallDecorator
- Inherits:
-
EventDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- EventDecorator
- ToolCallDecorator
- Defined in:
- app/decorators/tool_call_decorator.rb
Overview
Decorates tool_call events for display in the TUI. Hidden in basic mode — tool activity is represented by the aggregated tool counter instead. Verbose mode returns tool name and a formatted preview of the input arguments. Debug mode shows full untruncated input as pretty-printed JSON with tool_use_id.
Constant Summary
Constants inherited from EventDecorator
EventDecorator::ERROR_ICON, EventDecorator::RETURN_ARROW, EventDecorator::TOOL_ICON
Instance Method Summary collapse
-
#render_basic ⇒ nil
Tool calls are hidden in basic mode.
-
#render_debug ⇒ Hash
Full tool call data with untruncated input and tool_use_id ‘:tool_call, tool: String, input: String, tool_use_id: String|nil, timestamp: Integer|nil`.
-
#render_verbose ⇒ Hash
Structured tool call data ‘:tool_call, tool: String, input: String, timestamp: Integer|nil`.
Methods inherited from EventDecorator
Instance Method Details
#render_basic ⇒ nil
Returns tool calls are hidden in basic mode.
10 11 12 |
# File 'app/decorators/tool_call_decorator.rb', line 10 def render_basic nil end |
#render_debug ⇒ Hash
Returns full tool call data with untruncated input and tool_use_id ‘:tool_call, tool: String, input: String, tool_use_id: String|nil, timestamp: Integer|nil`.
22 23 24 25 26 27 28 29 30 |
# File 'app/decorators/tool_call_decorator.rb', line 22 def render_debug { role: :tool_call, tool: payload["tool_name"], input: JSON.pretty_generate(payload["tool_input"] || {}), tool_use_id: payload["tool_use_id"], timestamp: } end |
#render_verbose ⇒ Hash
Returns structured tool call data ‘:tool_call, tool: String, input: String, timestamp: Integer|nil`.
16 17 18 |
# File 'app/decorators/tool_call_decorator.rb', line 16 def render_verbose {role: :tool_call, tool: payload["tool_name"], input: format_input, timestamp: } end |