Class: Brute::Providers::Shell::ModelList

Inherits:
Object
  • Object
show all
Defined in:
lib/brute/providers/shell.rb

Overview

Minimal object that quacks like provider.models so the REPL’s fetch_models can call provider.models.all.select(&:chat?).

Defined Under Namespace

Classes: ModelEntry

Instance Method Summary collapse

Constructor Details

#initialize(names) ⇒ ModelList

Returns a new instance of ModelList.



98
99
100
# File 'lib/brute/providers/shell.rb', line 98

def initialize(names)
  @entries = names.map { |n| ModelEntry.new(id: n, chat?: true) }
end

Instance Method Details

#allObject



102
103
104
# File 'lib/brute/providers/shell.rb', line 102

def all
  @entries
end