Class: AgUiProtocol::Core::Events::ReasoningMessageStartEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::ReasoningMessageStartEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Signals the start of a reasoning message within a reasoning block.
The ‘role` is always “reasoning” (enforced). The optional `role:` kwarg exists to support round-trip deserialization from `to_h` output (which emits `role: “reasoning”`); supplying any other value raises ArgumentError.
“‘ruby event = AgUiProtocol::Core::Events::ReasoningMessageStartEvent.new(message_id: “reason_msg_1”) “`
Instance Attribute Summary collapse
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(message_id:, role: nil, timestamp: nil, raw_event: nil) ⇒ ReasoningMessageStartEvent
constructor
A new instance of ReasoningMessageStartEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(message_id:, role: nil, timestamp: nil, raw_event: nil) ⇒ ReasoningMessageStartEvent
Returns a new instance of ReasoningMessageStartEvent.
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1190 def initialize(message_id:, role: nil, timestamp: nil, raw_event: nil) if !role.nil? && role != "reasoning" raise ArgumentError, "ReasoningMessageStartEvent.role must be \"reasoning\"" end super(type: EventType::REASONING_MESSAGE_START, timestamp: , raw_event: raw_event) @message_id = # Role is always "reasoning" for ReasoningMessageStartEvent. @role = "reasoning" end |
Instance Attribute Details
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
1180 1181 1182 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1180 def @message_id end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
1183 1184 1185 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1183 def role @role end |
Instance Method Details
#to_h ⇒ Object
1202 1203 1204 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1202 def to_h super.merge(message_id: @message_id, role: @role) end |