Class: AgUiProtocol::Core::Events::StepStartedEvent

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

Overview

Signals the start of a step within an agent run.

“‘ruby

event = AgUiProtocol::Core::Events::StepStartedEvent.new(step_name: “s1”)

“‘

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(step_name:, timestamp: nil, raw_event: nil) ⇒ StepStartedEvent

Returns a new instance of StepStartedEvent.



984
985
986
987
# File 'lib/ag_ui_protocol/core/events.rb', line 984

def initialize(step_name:, timestamp: nil, raw_event: nil)
  super(type: EventType::STEP_STARTED, timestamp: timestamp, raw_event: raw_event)
  @step_name = step_name
end

Instance Attribute Details

#step_nameObject (readonly)

Returns the value of attribute step_name.



978
979
980
# File 'lib/ag_ui_protocol/core/events.rb', line 978

def step_name
  @step_name
end

Instance Method Details

#to_hObject



990
991
992
# File 'lib/ag_ui_protocol/core/events.rb', line 990

def to_h
  super.merge(step_name: @step_name)
end