Class: NitroIntelligence::ModelFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/nitro_intelligence/models/model_factory.rb

Constant Summary collapse

TYPES =
{
  "text" => TextModel,
  "audio_transcription" => TextModel,
  "image" => ImageModel,
  "text_to_speech" => TextToSpeechModel,
}.freeze

Class Method Summary collapse

Class Method Details

.build(model_metadata) ⇒ Object



12
13
14
15
16
17
# File 'lib/nitro_intelligence/models/model_factory.rb', line 12

def self.build()
   = .symbolize_keys
  type = [:type]
  model_class = TYPES.fetch(type) { raise ArgumentError, "Unknown model type: #{type.inspect}" }
  model_class.new(**)
end