Class: AgUiProtocol::Core::Events::RunFinishedEvent

Inherits:
BaseEvent show all
Defined in:
lib/ag_ui_protocol/core/events.rb

Overview

Signals the successful completion of an agent run.

“‘ruby

event = AgUiProtocol::Core::Events::RunFinishedEvent.new(thread_id: “t1”, run_id: “r1”, result: { “a” => 1 })

“‘

Instance Attribute Summary collapse

Attributes inherited from BaseEvent

#raw_event, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Types::Model

#as_json, #to_json

Constructor Details

#initialize(thread_id:, run_id:, result: nil, timestamp: nil, raw_event: nil) ⇒ RunFinishedEvent

Returns a new instance of RunFinishedEvent.



921
922
923
924
925
926
# File 'lib/ag_ui_protocol/core/events.rb', line 921

def initialize(thread_id:, run_id:, result: nil, timestamp: nil, raw_event: nil)
  super(type: EventType::RUN_FINISHED, timestamp: timestamp, raw_event: raw_event)
  @thread_id = thread_id
  @run_id = run_id
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



913
914
915
# File 'lib/ag_ui_protocol/core/events.rb', line 913

def result
  @result
end

#run_idObject (readonly)

Returns the value of attribute run_id.



910
911
912
# File 'lib/ag_ui_protocol/core/events.rb', line 910

def run_id
  @run_id
end

#thread_idObject (readonly)

Returns the value of attribute thread_id.



907
908
909
# File 'lib/ag_ui_protocol/core/events.rb', line 907

def thread_id
  @thread_id
end

Instance Method Details

#to_hObject



929
930
931
# File 'lib/ag_ui_protocol/core/events.rb', line 929

def to_h
  super.merge(thread_id: @thread_id, run_id: @run_id, result: @result)
end