Class: Roseflow::StabilityAI::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/roseflow/stabilityai/provider.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = Config.new) ⇒ Provider

Returns a new instance of Provider.



6
7
8
# File 'lib/roseflow/stabilityai/provider.rb', line 6

def initialize(config = Config.new)
  @config = config
end

Instance Method Details

#call(operation, options, &block) ⇒ Object



18
19
20
# File 'lib/roseflow/stabilityai/provider.rb', line 18

def call(operation, options, &block)
  models.find(options.fetch(:engine_id)).call(operation, options, &block)
end

#clientObject



14
15
16
# File 'lib/roseflow/stabilityai/provider.rb', line 14

def client
  @client ||= Client.new(config, self)
end

#modelsObject



10
11
12
# File 'lib/roseflow/stabilityai/provider.rb', line 10

def models
  @models ||= ModelRepository.new(self)
end