Class: Legion::Extensions::Agentic::Inference::Abductive::Helpers::Observation
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Inference::Abductive::Helpers::Observation
- Defined in:
- lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#surprise_level ⇒ Object
readonly
Returns the value of attribute surprise_level.
Instance Method Summary collapse
-
#initialize(content:, domain:, surprise_level: :notable, context: {}) ⇒ Observation
constructor
A new instance of Observation.
- #to_h ⇒ Object
Constructor Details
#initialize(content:, domain:, surprise_level: :notable, context: {}) ⇒ Observation
Returns a new instance of Observation.
14 15 16 17 18 19 20 21 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 14 def initialize(content:, domain:, surprise_level: :notable, context: {}) @id = SecureRandom.uuid @content = content @domain = domain @surprise_level = surprise_level @context = context @created_at = Time.now.utc end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def content @content end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def context @context end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def domain @domain end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def id @id end |
#surprise_level ⇒ Object (readonly)
Returns the value of attribute surprise_level.
12 13 14 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 12 def surprise_level @surprise_level end |
Instance Method Details
#to_h ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb', line 23 def to_h { id: @id, content: @content, domain: @domain, surprise_level: @surprise_level, context: @context, created_at: @created_at } end |