Class: RubynCode::CLI::Commands::Model

Inherits:
Base
  • Object
show all
Defined in:
lib/rubyn_code/cli/commands/model.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

aliases, all_names, hidden?

Class Method Details

.command_nameObject



7
# File 'lib/rubyn_code/cli/commands/model.rb', line 7

def self.command_name = '/model'

.descriptionObject



8
# File 'lib/rubyn_code/cli/commands/model.rb', line 8

def self.description = 'Show or switch model (/model [provider:model])'

Instance Method Details

#execute(args, ctx) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rubyn_code/cli/commands/model.rb', line 10

def execute(args, ctx)
  name = args.first
  return show_current(ctx) unless name

  provider, model = parse_model_arg(name)
  switch_model(provider, model, ctx)
end