module Riffer::Rig::Terminal::TurnReport
Constants
- COLUMN_HEAD
- INDENT
- INTERRUPTED
- VISIBLE
Public Instance Methods
(Riffer::Rig::Terminal::TurnReport::_Turn turn, Riffer::Providers::TokenUsage? session, theme: Riffer::Rig::Terminal::Theme, width: Integer?) → String
Source
# File lib/riffer/rig/terminal/turn_report.rb, line 19 def call(turn, session, theme:, width:) closing = if turn.interrupted? theme.dim(wrap(INTERRUPTED, width)) else footer(turn.stats, session, theme: theme, width: width) end blocks = [*answer(turn.answer, theme: theme, width: width), closing] blocks.map { |block| "\n#{block}\n" }.join end
@rbs turn: Riffer::Rig::Terminal::TurnReport::_Turn @rbs session: Riffer::Providers::TokenUsage? @rbs theme: Riffer::Rig::Terminal::Theme @rbs width: Integer? @rbs return: String
(String text, Integer? width) → String
Source
# File lib/riffer/rig/terminal/turn_report.rb, line 33 def wrap(text, width) text.lines(chomp: true).map { |line| wrap_line(line, width) }.join("\n") end
@rbs text: String @rbs width: Integer? @rbs return: String