Class: RankedLlm::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- RankedLlm::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/ranked_llm/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
11 12 13 |
# File 'lib/generators/ranked_llm/install/install_generator.rb', line 11 def self.next_migration_number(dirname) ::ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#create_migrations ⇒ Object
15 16 17 18 19 |
# File 'lib/generators/ranked_llm/install/install_generator.rb', line 15 def create_migrations migration_template "create_llm_credentials.rb.tt", "db/migrate/create_llm_credentials.rb" sleep 1 if migration_template "create_llm_usage_records.rb.tt", "db/migrate/create_llm_usage_records.rb" end |
#show_post_install_message ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/generators/ranked_llm/install/install_generator.rb', line 21 def say "" say "ranked_llm installed. Next steps:", :green say " 1. Run: bin/rails db:migrate" say " 2. Add `include Llm::Owned` to whatever model is your tenant/owner concept (Account, Team, User, ...)." say " 3. Configure Active Record Encryption if this app doesn't already (bin/rails db:encryption:init) —" say " Llm::Credential#api_key is encrypted at rest using it." say " 4. Call it: Llm::Client.for(current_account).call_tool(system:, tool:, max_tokens:, messages:)" say "" say " Optional settings UI scaffold: bin/rails generate ranked_llm:views" say "" end |