Class: LittleGhost::Models::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/little_ghost/models/configuration.rb

Overview

Loads trusted provider connections or logical model profiles from YAML.

Class Method Summary collapse

Class Method Details

.models(path) ⇒ Object

Loads model profiles and an optional default role from path.



20
21
22
23
# File 'lib/little_ghost/models/configuration.rb', line 20

def models(path)
  document = read(path)
  [mapping(document["models"], path, "models"), document["default_model"]&.to_s]
end

.providers(path) ⇒ Object

Loads provider connections from path.



14
15
16
17
# File 'lib/little_ghost/models/configuration.rb', line 14

def providers(path)
  document = read(path)
  Providers::Configuration.new(mapping(document["providers"], path, "providers"))
end