Class: Soka::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Soka::Generators::InstallGenerator
- Defined in:
- lib/generators/soka/install/install_generator.rb
Overview
Generator for installing Soka Rails configuration
Instance Method Summary collapse
- #add_soka_directory ⇒ Object
- #create_application_agent ⇒ Object
- #create_application_tool ⇒ Object
- #create_initializer ⇒ Object
- #display_post_install_message ⇒ Object
Instance Method Details
#add_soka_directory ⇒ Object
23 24 25 26 27 |
# File 'lib/generators/soka/install/install_generator.rb', line 23 def add_soka_directory empty_directory 'app/soka' empty_directory 'app/soka/agents' empty_directory 'app/soka/tools' end |
#create_application_agent ⇒ Object
15 16 17 |
# File 'lib/generators/soka/install/install_generator.rb', line 15 def create_application_agent template 'application_agent.rb', 'app/soka/agents/application_agent.rb' end |
#create_application_tool ⇒ Object
19 20 21 |
# File 'lib/generators/soka/install/install_generator.rb', line 19 def create_application_tool template 'application_tool.rb', 'app/soka/tools/application_tool.rb' end |
#create_initializer ⇒ Object
11 12 13 |
# File 'lib/generators/soka/install/install_generator.rb', line 11 def create_initializer template 'soka.rb', 'config/initializers/soka.rb' end |
#display_post_install_message ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/generators/soka/install/install_generator.rb', line 29 def say "\nSoka Rails has been successfully installed!", :green say "\nNext steps:" say ' 1. Set your AI provider API key: GEMINI_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY' say ' 2. Create your first agent: rails generate soka:agent MyAgent' say ' 3. Create your first tool: rails generate soka:tool MyTool' say "\nFor more information, visit: https://github.com/jiunjiun/soka-rails" end |