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.



877
878
879
880
881
882
883
# File 'lib/ag_ui_protocol/core/events.rb', line 877

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.



861
862
863
# File 'lib/ag_ui_protocol/core/events.rb', line 861

def input
  @input
end

#parent_run_idObject (readonly)

Returns the value of attribute parent_run_id.



858
859
860
# File 'lib/ag_ui_protocol/core/events.rb', line 858

def parent_run_id
  @parent_run_id
end

#run_idObject (readonly)

Returns the value of attribute run_id.



855
856
857
# File 'lib/ag_ui_protocol/core/events.rb', line 855

def run_id
  @run_id
end

#thread_idObject (readonly)

Returns the value of attribute thread_id.



852
853
854
# File 'lib/ag_ui_protocol/core/events.rb', line 852

def thread_id
  @thread_id
end

Instance Method Details

#to_hObject



886
887
888
889
890
891
892
893
# File 'lib/ag_ui_protocol/core/events.rb', line 886

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