Class: StabilityAI::Configuration

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

Constant Summary collapse

DEFAULT_API_VERSION =
"/v1".freeze
DEFAULT_ENGINE_ID =
"/stable-diffusion-v1-5".freeze
DEFAULT_FOLDER =
"/generation".freeze
DEFAULT_URI_BASE =
"https://api.stability.ai".freeze
DEFAULT_REQUEST_TIMEOUT =
120

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
24
25
26
27
28
29
# File 'lib/stabilityai.rb', line 21

def initialize
  @access_token = nil
			@organization_id = nil
  @api_version = DEFAULT_API_VERSION
  @engine_id = DEFAULT_ENGINE_ID
  @folder = DEFAULT_FOLDER
  @uri_base = DEFAULT_URI_BASE
  @request_timeout = DEFAULT_REQUEST_TIMEOUT
end

Instance Attribute Details

#access_tokenObject

Raises:



31
32
33
34
35
36
# File 'lib/stabilityai.rb', line 31

def access_token
  return @access_token if @access_token

  error_text = "StabilityAI access token missing! See https://github.com/kurbm/ruby-stabilityai#usage"
  raise ConfigurationError, error_text
end

#api_versionObject

Returns the value of attribute api_version.



13
14
15
# File 'lib/stabilityai.rb', line 13

def api_version
  @api_version
end

#engine_idObject

Returns the value of attribute engine_id.



13
14
15
# File 'lib/stabilityai.rb', line 13

def engine_id
  @engine_id
end

#folderObject

Returns the value of attribute folder.



13
14
15
# File 'lib/stabilityai.rb', line 13

def folder
  @folder
end

#organization_idObject

Returns the value of attribute organization_id.



13
14
15
# File 'lib/stabilityai.rb', line 13

def organization_id
  @organization_id
end

#request_timeoutObject

Returns the value of attribute request_timeout.



13
14
15
# File 'lib/stabilityai.rb', line 13

def request_timeout
  @request_timeout
end

#uri_baseObject

Returns the value of attribute uri_base.



13
14
15
# File 'lib/stabilityai.rb', line 13

def uri_base
  @uri_base
end