Class: Legion::CLI::Llm

Inherits:
Thor
  • Object
show all
Includes:
Logging::Helper
Defined in:
lib/legion/cli/llm_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/legion/cli/llm_command.rb', line 12

def self.exit_on_failure?
  true
end

Instance Method Details

#modelsObject



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/legion/cli/llm_command.rb', line 49

def models
  out = formatter
  boot_llm_settings

  data = collect_models
  if options[:json]
    out.json(models: data)
  else
    show_models(out, data)
  end
end

#pingObject



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/legion/cli/llm_command.rb', line 63

def ping
  out = formatter
  boot_llm(out)

  results = ping_all_providers(out)
  if options[:json]
    out.json(results: results)
  else
    show_ping_results(out, results)
  end
end

#providersObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/legion/cli/llm_command.rb', line 36

def providers
  out = formatter
  boot_llm_settings

  data = collect_providers
  if options[:json]
    out.json(providers: data)
  else
    show_providers(out, data)
  end
end

#statusObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/legion/cli/llm_command.rb', line 23

def status
  out = formatter
  boot_llm_settings

  data = collect_status
  if options[:json]
    out.json(data)
  else
    show_status(out, data)
  end
end