Class: AgUiProtocol::Core::Events::RunFinishedInterruptOutcome
- Inherits:
-
Types::Model
- Object
- Types::Model
- AgUiProtocol::Core::Events::RunFinishedInterruptOutcome
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Represents an interrupt outcome for a run.
“‘ruby outcome = AgUiProtocol::Core::Events::RunFinishedInterruptOutcome.new(
interrupts: [
AgUiProtocol::Core::Types::Interrupt.new(id: "int_1", reason: "input_required")
]
) “‘
Instance Attribute Summary collapse
-
#interrupts ⇒ Object
readonly
Returns the value of attribute interrupts.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(interrupts:, type: nil) ⇒ RunFinishedInterruptOutcome
constructor
A new instance of RunFinishedInterruptOutcome.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(interrupts:, type: nil) ⇒ RunFinishedInterruptOutcome
Returns a new instance of RunFinishedInterruptOutcome.
976 977 978 979 980 981 982 983 984 985 986 987 |
# File 'lib/ag_ui_protocol/core/events.rb', line 976 def initialize(interrupts:, type: nil) unless interrupts.is_a?(Array) && interrupts.all? { |i| i.is_a?(AgUiProtocol::Core::Types::Interrupt) } raise ArgumentError, "interrupts must be an Array of Interrupt" end if !type.nil? && type != "interrupt" raise ArgumentError, "RunFinishedInterruptOutcome.type must be \"interrupt\"" end @type = "interrupt" @interrupts = interrupts end |
Instance Attribute Details
#interrupts ⇒ Object (readonly)
Returns the value of attribute interrupts.
971 972 973 |
# File 'lib/ag_ui_protocol/core/events.rb', line 971 def interrupts @interrupts end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
968 969 970 |
# File 'lib/ag_ui_protocol/core/events.rb', line 968 def type @type end |
Instance Method Details
#to_h ⇒ Object
990 991 992 |
# File 'lib/ag_ui_protocol/core/events.rb', line 990 def to_h { type: @type, interrupts: @interrupts } end |