Class: AgentCliRuntime::NormalizedOutcome
- Inherits:
-
Data
- Object
- Data
- AgentCliRuntime::NormalizedOutcome
- Defined in:
- lib/agent_cli_runtime/values.rb
Constant Summary collapse
- KINDS =
%i[ completed authentication_failure configuration_failure cli_failure malformed_output cancelled timed_out ].freeze
Instance Attribute Summary collapse
-
#diagnostic ⇒ Object
readonly
Returns the value of attribute diagnostic.
-
#final_message ⇒ Object
readonly
Returns the value of attribute final_message.
-
#final_message_truncated ⇒ Object
readonly
Returns the value of attribute final_message_truncated.
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#launcher_identity ⇒ Object
readonly
Returns the value of attribute launcher_identity.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#termination ⇒ Object
readonly
Returns the value of attribute termination.
-
#unknown_events ⇒ Object
readonly
Returns the value of attribute unknown_events.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #completed? ⇒ Boolean
-
#initialize(provider:, launcher_identity:, kind:, termination:, final_message: nil, identity:, usage: nil, diagnostic: nil, unknown_events: [], session_id: nil, message_id: nil, final_message_truncated: false) ⇒ NormalizedOutcome
constructor
A new instance of NormalizedOutcome.
Constructor Details
#initialize(provider:, launcher_identity:, kind:, termination:, final_message: nil, identity:, usage: nil, diagnostic: nil, unknown_events: [], session_id: nil, message_id: nil, final_message_truncated: false) ⇒ NormalizedOutcome
Returns a new instance of NormalizedOutcome.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/agent_cli_runtime/values.rb', line 569 def initialize(provider:, launcher_identity:, kind:, termination:, final_message: nil, identity:, usage: nil, diagnostic: nil, unknown_events: [], session_id: nil, message_id: nil, final_message_truncated: false) normalized_kind = kind.to_sym unless KINDS.include?(normalized_kind) raise ArgumentError, "invalid normalized outcome kind" end unless termination.is_a?(TerminationEvidence) raise ArgumentError, "termination must be TerminationEvidence" end unless identity.is_a?(RouteIdentity) raise ArgumentError, "identity must be RouteIdentity" end unless usage.nil? || usage.is_a?(NormalizedUsage) raise ArgumentError, "usage must be NormalizedUsage or nil" end super( provider: provider.to_sym, launcher_identity: Immutable.string(launcher_identity), kind: normalized_kind, termination: termination, final_message: .nil? ? nil : Immutable.string(), final_message_truncated: == true, identity: identity, usage: usage, diagnostic: diagnostic.nil? ? nil : Immutable.string(diagnostic), unknown_events: Immutable.strings(unknown_events), session_id: session_id.nil? ? nil : Immutable.string(session_id), message_id: .nil? ? nil : Immutable.string() ) end |
Instance Attribute Details
#diagnostic ⇒ Object (readonly)
Returns the value of attribute diagnostic
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def diagnostic @diagnostic end |
#final_message ⇒ Object (readonly)
Returns the value of attribute final_message
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def @final_message end |
#final_message_truncated ⇒ Object (readonly)
Returns the value of attribute final_message_truncated
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def @final_message_truncated end |
#identity ⇒ Object (readonly)
Returns the value of attribute identity
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def identity @identity end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def kind @kind end |
#launcher_identity ⇒ Object (readonly)
Returns the value of attribute launcher_identity
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def launcher_identity @launcher_identity end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def @message_id end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def provider @provider end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def session_id @session_id end |
#termination ⇒ Object (readonly)
Returns the value of attribute termination
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def termination @termination end |
#unknown_events ⇒ Object (readonly)
Returns the value of attribute unknown_events
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def unknown_events @unknown_events end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage
559 560 561 |
# File 'lib/agent_cli_runtime/values.rb', line 559 def usage @usage end |
Instance Method Details
#completed? ⇒ Boolean
604 605 606 |
# File 'lib/agent_cli_runtime/values.rb', line 604 def completed? kind == :completed end |