Module: RubyLLM::Registry::Adapters

Defined in:
lib/ruby_llm/registry/adapters.rb,
lib/ruby_llm/registry/adapters/s3.rb,
lib/ruby_llm/registry/adapters/base.rb,
lib/ruby_llm/registry/adapters/mongo.rb,
lib/ruby_llm/registry/adapters/sqlite.rb,
lib/ruby_llm/registry/adapters/active_record.rb

Defined Under Namespace

Classes: ActiveRecord, Base, MongoDB, S3, SQLite

Class Method Summary collapse

Class Method Details

.build(type = :filesystem, **options) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_llm/registry/adapters.rb', line 14

def build(type = :filesystem, **options)
  case type.to_sym
  when :filesystem then FilesystemBackend.new(**options)
  when :sqlite then SQLite.new(**options)
  when :active_record, :ar then ActiveRecord.new(**options)
  when :mongo, :mongodb then MongoDB.new(**options)
  when :s3 then S3.new(**options)
  else
    raise ArgumentError, "Unknown adapter type: #{type.inspect}"
  end
end