Class: LLMExperiment::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/llm_experiment/doctor.rb

Overview

Preflight. Every check returns what is wrong AND what to type next, because each one encodes a failure that used to cost an afternoon.

Defined Under Namespace

Classes: Check

Instance Method Summary collapse

Constructor Details

#initialize(container: Container.new) ⇒ Doctor

Returns a new instance of Doctor.



9
10
11
# File 'lib/llm_experiment/doctor.rb', line 9

def initialize(container: Container.new)
  @container = container
end

Instance Method Details

#checks(experiment = nil) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/llm_experiment/doctor.rb', line 13

def checks(experiment = nil)
  list = [cli_check]
  # Without the CLI nothing else is answerable.
  return list if list.first.status == :fail

  list += [system_check, builder_check, disk_check, auth_check]
  list += experiment_checks(experiment) if experiment
  list
end

#ok?(experiment = nil) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/llm_experiment/doctor.rb', line 23

def ok?(experiment = nil)
  checks(experiment).none? { |c| c.status == :fail }
end