Class: LangsmithrbRails::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/langsmithrb_rails/install/install_generator.rb

Overview

Generator for installing LangSmith Rails integration

Instance Method Summary collapse

Instance Method Details

#create_config_fileObject



15
16
17
# File 'lib/generators/langsmithrb_rails/install/install_generator.rb', line 15

def create_config_file
  template "config.yml", "config/langsmith.yml"
end

#create_initializerObject



11
12
13
# File 'lib/generators/langsmithrb_rails/install/install_generator.rb', line 11

def create_initializer
  template "initializer.rb", "config/initializers/langsmith.rb"
end

#display_post_install_messageObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/langsmithrb_rails/install/install_generator.rb', line 19

def display_post_install_message
  say "\n"
  say "LangSmith Rails has been installed! 🎉", :green
  say "\n"
  say "Next steps:", :yellow
  say "  1. Add your LangSmith API key to your environment:", :yellow
  say "     export LANGSMITH_API_KEY=your_api_key", :yellow
  say "  2. Optionally set your LangSmith project name:", :yellow
  say "     export LANGSMITH_PROJECT=your_project_name", :yellow
  say "\n"
  say "To enable tracing in your Rails app, run:", :yellow
  say "  bin/rails g langsmithrb_rails:tracing", :yellow
  say "\n"
end