Class: SuperAGI::Configuration

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

Constant Summary collapse

DEFAULT_API_VERSION =
"v1".freeze
DEFAULT_URI_BASE =
"https://app.superagi.com/api/".freeze
DEFAULT_REQUEST_TIMEOUT =
120

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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

def initialize
  @secret_key = nil
  @api_type = nil
  @api_version = DEFAULT_API_VERSION
  @uri_base = DEFAULT_URI_BASE
  @request_timeout = DEFAULT_REQUEST_TIMEOUT
  @extra_headers = nil
end

Instance Attribute Details

#api_typeObject

Returns the value of attribute api_type.



15
16
17
# File 'lib/superagi.rb', line 15

def api_type
  @api_type
end

#api_versionObject

Returns the value of attribute api_version.



15
16
17
# File 'lib/superagi.rb', line 15

def api_version
  @api_version
end

#extra_headersObject

Returns the value of attribute extra_headers.



15
16
17
# File 'lib/superagi.rb', line 15

def extra_headers
  @extra_headers
end

#request_timeoutObject

Returns the value of attribute request_timeout.



15
16
17
# File 'lib/superagi.rb', line 15

def request_timeout
  @request_timeout
end

#secret_keyObject

Raises:



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

def secret_key
  return @secret_key if @secret_key

  error_text = "SuperAGI secret key missing! See https://github.com/alexrudall/superagi#usage"
  raise ConfigurationError, error_text
end

#uri_baseObject

Returns the value of attribute uri_base.



15
16
17
# File 'lib/superagi.rb', line 15

def uri_base
  @uri_base
end