Module: RubyLLM::TopSecret

Defined in:
lib/ruby_llm/top_secret.rb,
lib/ruby_llm/top_secret/payload.rb,
lib/ruby_llm/top_secret/railtie.rb,
lib/ruby_llm/top_secret/version.rb,
lib/ruby_llm/top_secret/patches/chat.rb,
lib/ruby_llm/top_secret/patches/acts_as_chat.rb,
lib/ruby_llm/top_secret/acts_as_filtered_chat.rb

Overview

Integrates Top Secret with RubyLLM to automatically filter sensitive information before it is sent to LLM providers.

Defined Under Namespace

Modules: ActsAsFilteredChat, AutoFiltering, Patches Classes: Error, Payload, Railtie

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.filtering?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ruby_llm/top_secret.rb', line 24

def self.filtering?
  Thread.current[:ruby_llm_top_secret_filter] == true
end

.with_filteringObject



16
17
18
19
20
21
22
# File 'lib/ruby_llm/top_secret.rb', line 16

def self.with_filtering
  was_filtering = Thread.current[:ruby_llm_top_secret_filter]
  Thread.current[:ruby_llm_top_secret_filter] = true
  yield
ensure
  Thread.current[:ruby_llm_top_secret_filter] = was_filtering
end