Class: AI21::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



19
20
21
22
23
# File 'lib/ai21.rb', line 19

def initialize
  @access_token = nil
  @uri_base = "https://api.ai21.com/studio/"
  @api_version = "v1"
end

Instance Attribute Details

#access_tokenObject

Raises:



25
26
27
28
29
30
# File 'lib/ai21.rb', line 25

def access_token
  return @access_token if @access_token

  error_text = "AI21 access token is missing. Visit https://studio.ai21.com/account"
  raise ConfigurationError, error_text
end

#api_versionObject

Returns the value of attribute api_version.



17
18
19
# File 'lib/ai21.rb', line 17

def api_version
  @api_version
end

#uri_baseObject

Returns the value of attribute uri_base.



17
18
19
# File 'lib/ai21.rb', line 17

def uri_base
  @uri_base
end