Class: AgUiProtocol::Core::Events::RunErrorEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::RunErrorEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Signals an error during an agent run.
“‘ruby
event = AgUiProtocol::Core::Events::RunErrorEvent.new(message: “An error occurred”, code: “RUN_ERROR”)
“‘
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(message:, code: nil, timestamp: nil, raw_event: nil) ⇒ RunErrorEvent
constructor
A new instance of RunErrorEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(message:, code: nil, timestamp: nil, raw_event: nil) ⇒ RunErrorEvent
Returns a new instance of RunErrorEvent.
1073 1074 1075 1076 1077 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1073 def initialize(message:, code: nil, timestamp: nil, raw_event: nil) super(type: EventType::RUN_ERROR, timestamp: , raw_event: raw_event) @message = @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
1066 1067 1068 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1066 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
1063 1064 1065 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1063 def @message end |
Instance Method Details
#to_h ⇒ Object
1080 1081 1082 |
# File 'lib/ag_ui_protocol/core/events.rb', line 1080 def to_h super.merge(message: @message, code: @code) end |