Class: Legion::Extensions::Agentic::Executive::DualProcess::Helpers::Decision
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Executive::DualProcess::Helpers::Decision
- Defined in:
- lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb
Instance Attribute Summary collapse
-
#complexity ⇒ Object
readonly
Returns the value of attribute complexity.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#effort_cost ⇒ Object
readonly
Returns the value of attribute effort_cost.
-
#heuristic_id ⇒ Object
readonly
Returns the value of attribute heuristic_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#outcome ⇒ Object
Returns the value of attribute outcome.
-
#processing_time_ms ⇒ Object
readonly
Returns the value of attribute processing_time_ms.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#system_used ⇒ Object
readonly
Returns the value of attribute system_used.
Instance Method Summary collapse
-
#initialize(query:, domain:, system_used:, confidence:, complexity:, **opts) ⇒ Decision
constructor
A new instance of Decision.
- #to_h ⇒ Object
Constructor Details
#initialize(query:, domain:, system_used:, confidence:, complexity:, **opts) ⇒ Decision
Returns a new instance of Decision.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 15 def initialize(query:, domain:, system_used:, confidence:, complexity:, **opts) @id = SecureRandom.uuid @query = query @domain = domain @system_used = system_used @confidence = confidence.clamp(Constants::CONFIDENCE_FLOOR, Constants::CONFIDENCE_CEILING) @complexity = complexity.clamp(0.0, 1.0) @heuristic_id = opts.fetch(:heuristic_id, nil) @outcome = nil @effort_cost = opts.fetch(:effort_cost, 0.0) @processing_time_ms = opts.fetch(:processing_time_ms, 0) @created_at = Time.now.utc end |
Instance Attribute Details
#complexity ⇒ Object (readonly)
Returns the value of attribute complexity.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def complexity @complexity end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def confidence @confidence end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def domain @domain end |
#effort_cost ⇒ Object (readonly)
Returns the value of attribute effort_cost.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def effort_cost @effort_cost end |
#heuristic_id ⇒ Object (readonly)
Returns the value of attribute heuristic_id.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def heuristic_id @heuristic_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def id @id end |
#outcome ⇒ Object
Returns the value of attribute outcome.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 12 def outcome @outcome end |
#processing_time_ms ⇒ Object (readonly)
Returns the value of attribute processing_time_ms.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def processing_time_ms @processing_time_ms end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def query @query end |
#system_used ⇒ Object (readonly)
Returns the value of attribute system_used.
13 14 15 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 13 def system_used @system_used end |
Instance Method Details
#to_h ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/legion/extensions/agentic/executive/dual_process/helpers/decision.rb', line 29 def to_h { id: @id, query: @query, domain: @domain, system_used: @system_used, confidence: @confidence, complexity: @complexity, heuristic_id: @heuristic_id, outcome: @outcome, effort_cost: @effort_cost, processing_time_ms: @processing_time_ms, created_at: @created_at } end |