class RubyLLM::AgUI::Protocol::RunFinishedEvent
RunFinishedEvent that accepts the cancelled outcome.
The SDK’s own RunFinishedEvent validates its outcome against the two outcomes 0.2.0 models, so it cannot carry a cancelled one. This class has the same shape and the same RUN_FINISHED type; it accepts any outcome object that serializes to a schema-valid RunFinishedOutcome, including the SDK’s success and interrupt outcomes.
Attributes
outcome[R]
result[R]
run_id[R]
thread_id[R]
usage[R]
Public Class Methods
new(thread_id:, run_id:, result: nil, outcome: nil, usage: nil, timestamp: nil, raw_event: nil)
click to toggle source
Mirrors the SDK’s own RunFinishedEvent signature.
Calls superclass method
# File lib/ruby_llm/ag_ui/protocol.rb, line 76 def initialize(thread_id:, run_id:, result: nil, outcome: nil, usage: nil, timestamp: nil, raw_event: nil) # rubocop:disable Metrics/ParameterLists if !result.nil? && !outcome.nil? raise ArgumentError, 'result and outcome are mutually exclusive; provide one or the other, not both' end super(type: ::AgUiProtocol::Core::Events::EventType::RUN_FINISHED, timestamp: timestamp, raw_event: raw_event) @thread_id = thread_id @run_id = run_id @result = result @outcome = outcome @usage = usage end
Public Instance Methods
to_h()
click to toggle source
Calls superclass method
# File lib/ruby_llm/ag_ui/protocol.rb, line 89 def to_h super.merge(thread_id: @thread_id, run_id: @run_id, result: @result, outcome: @outcome, usage: @usage) end