Sha256: 80a3232d14ce4ea634f327a85116f60889be2765961822f969a096e2f1d5dd32

Contents?: true

Size: 931 Bytes

Versions: 7

Compression:

Stored size: 931 Bytes

Contents

require "rails/generators"
require "rails/generators/active_record"

module LangchainrbRails
  module Generators
    class BaseGenerator < Rails::Generators::Base
      include ::ActiveRecord::Generators::Migration

      class_option :model, type: :string, required: true, desc: "ActiveRecord Model to add vectorsearch to", aliases: "-m"
      class_option :llm, type: :string, required: true, desc: "LLM provider that will be used to generate embeddings and completions"

      # Available LLM providers to be passed in as --llm option
      LLMS = {
        "cohere" => "Langchain::LLM::Cohere",
        "google_palm" => "Langchain::LLM::GooglePalm",
        "hugging_face" => "Langchain::LLM::HuggingFace",
        "llama_cpp" => "Langchain::LLM::LlamaCpp",
        "ollama" => "Langchain::LLM::Ollama",
        "openai" => "Langchain::LLM::OpenAI",
        "replicate" => "Langchain::LLM::Replicate"
      }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
langchainrb_rails-0.1.9 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.8 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.7 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.6 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.5 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.4 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb
langchainrb_rails-0.1.3 lib/langchainrb_rails/generators/langchainrb_rails/base_generator.rb