Class: AgUiProtocol::Core::Events::BaseEvent
- Inherits:
-
Types::Model
- Object
- Types::Model
- AgUiProtocol::Core::Events::BaseEvent
- Extended by:
- T::Sig
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
All events inherit from the ‘BaseEvent` class, which provides common properties shared across all event types. “`ruby
event = AgUiProtocol::Core::Events::BaseEvent.new(
type: AgUiProtocol::Core::Events::EventType::RAW,
timestamp: nil,
raw_event: nil
)
“‘
Direct Known Subclasses
ActivityDeltaEvent, ActivitySnapshotEvent, CustomEvent, MessagesSnapshotEvent, RawEvent, RunErrorEvent, RunFinishedEvent, RunStartedEvent, StateDeltaEvent, StateSnapshotEvent, StepFinishedEvent, StepStartedEvent, TextMessageChunkEvent, TextMessageContentEvent, TextMessageEndEvent, TextMessageStartEvent, ThinkingEndEvent, ThinkingStartEvent, ThinkingTextMessageContentEvent, ThinkingTextMessageEndEvent, ThinkingTextMessageStartEvent, ToolCallArgsEvent, ToolCallChunkEvent, ToolCallEndEvent, ToolCallResultEvent, ToolCallStartEvent
Instance Attribute Summary collapse
-
#raw_event ⇒ Object
readonly
Returns the value of attribute raw_event.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, timestamp: nil, raw_event: nil) ⇒ BaseEvent
constructor
A new instance of BaseEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(type:, timestamp: nil, raw_event: nil) ⇒ BaseEvent
Returns a new instance of BaseEvent.
90 91 92 93 94 |
# File 'lib/ag_ui_protocol/core/events.rb', line 90 def initialize(type:, timestamp: nil, raw_event: nil) @type = type @timestamp = @raw_event = raw_event end |
Instance Attribute Details
#raw_event ⇒ Object (readonly)
Returns the value of attribute raw_event.
84 85 86 |
# File 'lib/ag_ui_protocol/core/events.rb', line 84 def raw_event @raw_event end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
81 82 83 |
# File 'lib/ag_ui_protocol/core/events.rb', line 81 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
78 79 80 |
# File 'lib/ag_ui_protocol/core/events.rb', line 78 def type @type end |
Instance Method Details
#to_h ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/ag_ui_protocol/core/events.rb', line 97 def to_h { type: @type, timestamp: @timestamp, raw_event: @raw_event } end |