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.
955 956 957 958 959 |
# File 'lib/ag_ui_protocol/core/events.rb', line 955 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.
948 949 950 |
# File 'lib/ag_ui_protocol/core/events.rb', line 948 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
945 946 947 |
# File 'lib/ag_ui_protocol/core/events.rb', line 945 def @message end |
Instance Method Details
#to_h ⇒ Object
962 963 964 |
# File 'lib/ag_ui_protocol/core/events.rb', line 962 def to_h super.merge(message: @message, code: @code) end |