Class: PromptSanitizer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/prompt_sanitizer.rb

Overview

── Configuration ──────────────────────────────────────────────────────────

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



45
46
47
48
49
50
51
52
# File 'lib/prompt_sanitizer.rb', line 45

def initialize
  @mode        = :fast
  @ner_backend = :informers
  @ner_model   = "distilbert"
  @vault_store = :memory
  @audit_log   = :none
  @locale      = "en"
end

Instance Attribute Details

#audit_logObject

Audit log backend: :none (default), :memory, :active_record



40
41
42
# File 'lib/prompt_sanitizer.rb', line 40

def audit_log
  @audit_log
end

#localeObject

Locale for synthetic replacements (Faker locale string, e.g. "en", "fr")



43
44
45
# File 'lib/prompt_sanitizer.rb', line 43

def locale
  @locale
end

#modeObject

Detection mode: :fast, :smart, :full



28
29
30
# File 'lib/prompt_sanitizer.rb', line 28

def mode
  @mode
end

#ner_backendObject

NER backend (used in :smart / :full mode): :informers, :mitie



31
32
33
# File 'lib/prompt_sanitizer.rb', line 31

def ner_backend
  @ner_backend
end

#ner_modelObject

NER model variant: "distilbert" (66 MB, default) or "bert-base" (110 MB)



34
35
36
# File 'lib/prompt_sanitizer.rb', line 34

def ner_model
  @ner_model
end

#vault_storeObject

Vault persistence: :memory (default), :rails_cache, :active_record



37
38
39
# File 'lib/prompt_sanitizer.rb', line 37

def vault_store
  @vault_store
end