Module: Smith::Context::ObservationMasking
- Defined in:
- lib/smith/context/observation_masking.rb
Constant Summary collapse
- SYSTEM_ROLES =
%i[system].push("system").freeze
Class Method Summary collapse
Class Method Details
.apply(messages, strategy:) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/smith/context/observation_masking.rb', line 8 def self.apply(, strategy:) return unless strategy window = strategy[:window] return unless window system_msgs, non_system = .partition { |m| SYSTEM_ROLES.include?(m[:role]) } system_msgs + non_system.last(window) end |