Class: Roast::Workflow::StepCompletionReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/workflow/step_completion_reporter.rb

Overview

Reports step completion with token consumption information

Instance Method Summary collapse

Constructor Details

#initialize(output: $stderr) ⇒ StepCompletionReporter

Returns a new instance of StepCompletionReporter.



7
8
9
# File 'lib/roast/workflow/step_completion_reporter.rb', line 7

def initialize(output: $stderr)
  @output = output
end

Instance Method Details

#report(step_name, tokens_consumed, total_tokens) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/roast/workflow/step_completion_reporter.rb', line 11

def report(step_name, tokens_consumed, total_tokens)
  formatted_consumed = number_with_delimiter(tokens_consumed)
  formatted_total = number_with_delimiter(total_tokens)

  @output.puts "✓ Complete: #{step_name} (consumed #{formatted_consumed} tokens, total #{formatted_total})"
  @output.puts
  @output.puts
end