class RubyLLM::AgUI::Redemption
The result of redeeming an interrupt.
A caller cannot tell a fresh decision from a replay by the interrupt alone: both come back approved. The distinction is exactly what decides whether the tool may run, so the store returns it explicitly. Only the call that recorded the decision may execute the tool; a replay reports the answer already given and must not run anything again.
Attributes
interrupt[R]
The stored interrupt, with its decision.
Public Class Methods
new(interrupt:, replayed:)
click to toggle source
# File lib/ruby_llm/ag_ui/redemption.rb, line 16 def initialize(interrupt:, replayed:) @interrupt = interrupt @replayed = replayed freeze end
Public Instance Methods
approved?()
click to toggle source
Whether the stored decision is an approval.
# File lib/ruby_llm/ag_ui/redemption.rb, line 38 def approved? interrupt.approved? end
cancelled?()
click to toggle source
Whether the stored decision abandons the interrupt.
# File lib/ruby_llm/ag_ui/redemption.rb, line 48 def cancelled? interrupt.cancelled? end
denied?()
click to toggle source
Whether the stored decision is a refusal.
# File lib/ruby_llm/ag_ui/redemption.rb, line 43 def denied? interrupt.denied? end
recorded?()
click to toggle source
Whether this call recorded the decision.
# File lib/ruby_llm/ag_ui/redemption.rb, line 23 def recorded? !@replayed end
replayed?()
click to toggle source
Whether the decision was already recorded by an earlier call.
# File lib/ruby_llm/ag_ui/redemption.rb, line 28 def replayed? @replayed end
status()
click to toggle source
The interrupt’s status: :approved, :denied or :cancelled.
# File lib/ruby_llm/ag_ui/redemption.rb, line 33 def status interrupt.status end
to_h()
click to toggle source
# File lib/ruby_llm/ag_ui/redemption.rb, line 57 def to_h { 'interruptId' => interrupt.id, 'status' => status.to_s, 'replayed' => replayed? } end
tool_call_id()
click to toggle source
The tool call the decision concerns.
# File lib/ruby_llm/ag_ui/redemption.rb, line 53 def tool_call_id interrupt.tool_call_id end