Class: PolylingoChat::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
14
# File 'lib/polylingo_chat/config.rb', line 5

def initialize
  @provider = :openai
  @api_key = ENV['POLYGLOT_API_KEY']
  @model = 'gpt-4o-mini'
  @default_language = 'en'
  @cache_store = nil
  @async = true
  @timeout = 15
  @queue_adapter = nil # Optional: Specify which ActiveJob adapter you're using
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def api_key
  @api_key
end

#asyncObject

Returns the value of attribute async.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def async
  @async
end

#cache_storeObject

Returns the value of attribute cache_store.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def cache_store
  @cache_store
end

#default_languageObject

Returns the value of attribute default_language.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def default_language
  @default_language
end

#modelObject

Returns the value of attribute model.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def model
  @model
end

#providerObject

Returns the value of attribute provider.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def provider
  @provider
end

#queue_adapterObject

Returns the value of attribute queue_adapter.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def queue_adapter
  @queue_adapter
end

#timeoutObject

Returns the value of attribute timeout.



3
4
5
# File 'lib/polylingo_chat/config.rb', line 3

def timeout
  @timeout
end