Class: GAI18n::Configuration
- Inherits:
-
Object
- Object
- GAI18n::Configuration
- Defined in:
- lib/gai18n/configuration.rb
Instance Attribute Summary collapse
- #base_git_branch ⇒ Object
- #keys_per_paginated_requests ⇒ Object
-
#locales ⇒ Object
Returns the value of attribute locales.
- #model ⇒ Object
-
#openai_assistant_id ⇒ Object
Returns the value of attribute openai_assistant_id.
-
#openai_secret_key ⇒ Object
Returns the value of attribute openai_secret_key.
-
#source_locale ⇒ Object
Returns the value of attribute source_locale.
-
#target_locales ⇒ Object
Returns the value of attribute target_locales.
Instance Method Summary collapse
Instance Attribute Details
#base_git_branch ⇒ Object
21 22 23 |
# File 'lib/gai18n/configuration.rb', line 21 def base_git_branch @base_git_branch ||= 'main' end |
#keys_per_paginated_requests ⇒ Object
29 30 31 |
# File 'lib/gai18n/configuration.rb', line 29 def keys_per_paginated_requests @keys_per_paginated_requests ||= 20 end |
#locales ⇒ Object
Returns the value of attribute locales.
3 4 5 |
# File 'lib/gai18n/configuration.rb', line 3 def locales @locales end |
#model ⇒ Object
25 26 27 |
# File 'lib/gai18n/configuration.rb', line 25 def model @model ||= 'gpt-3.5-turbo-1106' end |
#openai_assistant_id ⇒ Object
Returns the value of attribute openai_assistant_id.
3 4 5 |
# File 'lib/gai18n/configuration.rb', line 3 def openai_assistant_id @openai_assistant_id end |
#openai_secret_key ⇒ Object
Returns the value of attribute openai_secret_key.
3 4 5 |
# File 'lib/gai18n/configuration.rb', line 3 def openai_secret_key @openai_secret_key end |
#source_locale ⇒ Object
Returns the value of attribute source_locale.
3 4 5 |
# File 'lib/gai18n/configuration.rb', line 3 def source_locale @source_locale end |
#target_locales ⇒ Object
Returns the value of attribute target_locales.
3 4 5 |
# File 'lib/gai18n/configuration.rb', line 3 def target_locales @target_locales end |
Instance Method Details
#openai_client ⇒ Object
8 9 10 11 12 13 |
# File 'lib/gai18n/configuration.rb', line 8 def openai_client args = { access_token: openai_secret_key } @openai_client ||= ::OpenAI::Client.new args end |
#project_root ⇒ Object
15 16 17 18 19 |
# File 'lib/gai18n/configuration.rb', line 15 def project_root return Rails.root if defined? Rails return Bundler.root if defined? Bundler Dir.pwd end |