Class: GAI18n::Setup

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

Instance Method Summary collapse

Instance Method Details

#run(openai_api_key: nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/gai18n/setup.rb', line 3

def run(openai_api_key: nil)
  copy_template
  puts "GAI18n configuration file created at #{destination}"
  if openai_api_key
    add_api_key_to_template openai_api_key
    puts 'Added OpenAI API key to configuration file.'
    puts 'Please run `bundle exec gai18n assistant:create` to create an OpenAI assistant, and then add the assistant id to the configuration file.'
  else
    puts '1. Please add your OpenAI API key to the configuration file.'
    puts '2. Then run `bundle exec gai18n assistant:create` to create an OpenAI assistant, and then add the assistant id to the configuration file.'
  end
end