Class: Legion::Extensions::Agentic::Defense::Bias::Helpers::BiasEvent
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Defense::Bias::Helpers::BiasEvent
- Defined in:
- lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb
Instance Attribute Summary collapse
-
#bias_type ⇒ Object
readonly
Returns the value of attribute bias_type.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#corrected ⇒ Object
readonly
Returns the value of attribute corrected.
-
#correction_applied ⇒ Object
readonly
Returns the value of attribute correction_applied.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#magnitude ⇒ Object
readonly
Returns the value of attribute magnitude.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(bias_type:, domain:, magnitude:, **opts) ⇒ BiasEvent
constructor
A new instance of BiasEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(bias_type:, domain:, magnitude:, **opts) ⇒ BiasEvent
Returns a new instance of BiasEvent.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 15 def initialize(bias_type:, domain:, magnitude:, **opts) @id = SecureRandom.uuid @bias_type = bias_type @domain = domain @magnitude = magnitude @corrected = opts.fetch(:corrected, false) @correction_applied = opts.fetch(:correction_applied, 0.0) @context = opts.fetch(:context, {}) @timestamp = Time.now.utc end |
Instance Attribute Details
#bias_type ⇒ Object (readonly)
Returns the value of attribute bias_type.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def bias_type @bias_type end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def context @context end |
#corrected ⇒ Object (readonly)
Returns the value of attribute corrected.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def corrected @corrected end |
#correction_applied ⇒ Object (readonly)
Returns the value of attribute correction_applied.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def correction_applied @correction_applied end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def domain @domain end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def id @id end |
#magnitude ⇒ Object (readonly)
Returns the value of attribute magnitude.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def magnitude @magnitude end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
12 13 14 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 12 def @timestamp end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb', line 26 def to_h { id: @id, bias_type: @bias_type, domain: @domain, magnitude: @magnitude, corrected: @corrected, correction_applied: @correction_applied, context: @context, timestamp: @timestamp } end |