class Riffer::StreamEvents::Interrupt
Represents an interrupt event during streaming.
Emitted when a callback interrupts the agent loop via +throw :riffer_interrupt+.
Attributes
Call ids of tool_use blocks that riffer filled with placeholder results when the interrupt fired. Populated only when Riffer.config.experimental_history_healing is on.
The reason provided with the interrupt, if any.
Public Class Methods
Source
# File lib/riffer/stream_events/interrupt.rb, line 18 def initialize(reason: nil, healed_tool_call_ids: []) super(role: :system) @reason = reason @healed_tool_call_ids = healed_tool_call_ids end
Calls superclass method
Riffer::StreamEvents::Base::new
Public Instance Methods
Source
# File lib/riffer/stream_events/interrupt.rb, line 28 def to_h h = {role: @role, interrupt: true} #: Hash[Symbol, untyped] h[:reason] = @reason if @reason h[:healed_tool_call_ids] = @healed_tool_call_ids unless @healed_tool_call_ids.empty? h end
Converts the event to a hash.