Module: RubyLLM::TopSecret::ActsAsFilteredChat

Extended by:
ActiveSupport::Concern
Defined in:
lib/ruby_llm/top_secret/acts_as_filtered_chat.rb

Overview

Provides the acts_as_filtered_chat class method for ActiveRecord models that use acts_as_chat. Declaring it automatically wraps complete in with_filtering, so filtering works across job boundaries without a manual block.

The gem does not provide a database column. Your application is responsible for storing the per-chat filtering decision (e.g. a filtered boolean column) and exposing it via a predicate method.

Examples:

Filter all chats for this model

class Chat < ApplicationRecord
  acts_as_chat
  acts_as_filtered_chat
end

Filter per-chat with a symbol condition

class Chat < ApplicationRecord
  acts_as_chat
  acts_as_filtered_chat if: :filtered?
end

Filter per-chat with a Proc condition

class Chat < ApplicationRecord
  acts_as_chat
  acts_as_filtered_chat if: -> { filtered? }
end