Class: AgUiProtocol::Core::Events::RunStartedEvent

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

Overview

Signals the start of an agent run.

“‘ruby

input = AgUiProtocol::Core::Types::RunAgentInput.new(

thread_id: "t1",
run_id: "r1",
state: {},
messages: [],
tools: [],
context: [],
forwarded_props: {}

)

event = AgUiProtocol::Core::Events::RunStartedEvent.new(

thread_id: "t1",
run_id: "r1",
parent_run_id: nil,
input: input

)

“‘

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:, parent_run_id: nil, input: nil, timestamp: nil, raw_event: nil) ⇒ RunStartedEvent

Returns a new instance of RunStartedEvent.



909
910
911
912
913
914
915
# File 'lib/ag_ui_protocol/core/events.rb', line 909

def initialize(thread_id:, run_id:, parent_run_id: nil, input: nil, timestamp: nil, raw_event: nil)
  super(type: EventType::RUN_STARTED, timestamp: timestamp, raw_event: raw_event)
  @thread_id = thread_id
  @run_id = run_id
  @parent_run_id = parent_run_id
  @input = input
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



891
892
893
# File 'lib/ag_ui_protocol/core/events.rb', line 891

def input
  @input
end

#parent_run_idObject (readonly)

Returns the value of attribute parent_run_id.



888
889
890
# File 'lib/ag_ui_protocol/core/events.rb', line 888

def parent_run_id
  @parent_run_id
end

#run_idObject (readonly)

Returns the value of attribute run_id.



885
886
887
# File 'lib/ag_ui_protocol/core/events.rb', line 885

def run_id
  @run_id
end

#thread_idObject (readonly)

Returns the value of attribute thread_id.



882
883
884
# File 'lib/ag_ui_protocol/core/events.rb', line 882

def thread_id
  @thread_id
end

Instance Method Details

#to_hObject



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

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