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 event classes inherit from ‘BaseEvent`, which provides common properties shared across all event types. Value types in this module (RunFinishedSuccessOutcome, RunFinishedInterruptOutcome) inherit directly from `Model` — they are payload types referenced by events, not events themselves. “`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, ReasoningEncryptedValueEvent, ReasoningEndEvent, ReasoningMessageChunkEvent, ReasoningMessageContentEvent, ReasoningMessageEndEvent, ReasoningMessageStartEvent, ReasoningStartEvent, 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.
109 110 111 112 113 |
# File 'lib/ag_ui_protocol/core/events.rb', line 109 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.
103 104 105 |
# File 'lib/ag_ui_protocol/core/events.rb', line 103 def raw_event @raw_event end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
100 101 102 |
# File 'lib/ag_ui_protocol/core/events.rb', line 100 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
97 98 99 |
# File 'lib/ag_ui_protocol/core/events.rb', line 97 def type @type end |
Instance Method Details
#to_h ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/ag_ui_protocol/core/events.rb', line 116 def to_h { type: @type, timestamp: @timestamp, raw_event: @raw_event } end |