Class: ObsceneGpt::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
23
24
25
# File 'lib/obscene_gpt/configuration.rb', line 16

def initialize
  @api_key = ENV.fetch("OPENAI_API_KEY", nil)
  @model = "gpt-4.1-nano"
  @prompt = Prompts::SYSTEM_PROMPT
  @schema = Prompts::SIMPLE_SCHEMA
  @profanity_threshold = 0.8
  @test_mode = false
  @test_detector_class = TestDetector
  @request_timeout = 10
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def api_key
  @api_key
end

#modelObject

Returns the value of attribute model.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def model
  @model
end

#profanity_thresholdObject

Returns the value of attribute profanity_threshold.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def profanity_threshold
  @profanity_threshold
end

#promptObject

Returns the value of attribute prompt.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def prompt
  @prompt
end

#request_timeoutObject

Returns the value of attribute request_timeout.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def request_timeout
  @request_timeout
end

#schemaObject

Returns the value of attribute schema.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def schema
  @schema
end

#test_detector_classObject

Returns the value of attribute test_detector_class.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def test_detector_class
  @test_detector_class
end

#test_modeObject

Returns the value of attribute test_mode.



13
14
15
# File 'lib/obscene_gpt/configuration.rb', line 13

def test_mode
  @test_mode
end