Class: RubyCode::Views::AgentLoop::IterationHeader
- Inherits:
-
Object
- Object
- RubyCode::Views::AgentLoop::IterationHeader
- Defined in:
- lib/rubycode/views/agent_loop/iteration_header.rb
Overview
Builds iteration header with tool list
Class Method Summary collapse
Class Method Details
.build(iteration:, tool_calls:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rubycode/views/agent_loop/iteration_header.rb', line 10 def self.build(iteration:, tool_calls:) pastel = Pastel.new header = pastel.cyan("┌─ Iteration #{iteration} ─────────────────────────") tool_list = tool_calls.each_with_index.map do |tool_call, idx| tool_name = tool_call.dig("function", "name") " #{pastel.dim("#{idx + 1}.")} #{tool_name}" end [header, *tool_list].join("\n") end |