Class: Legion::Extensions::Agentic::Inference::Abductive::Helpers::Observation

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/extensions/agentic/inference/abductive/helpers/observation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (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

#contextObject (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_atObject (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

#domainObject (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

#idObject (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_levelObject (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_hObject



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