Class: Gemini::Configuration

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

Constant Summary collapse

DEFAULT_API_VERSION =
"v1".freeze
DEFAULT_URI_BASE =
"https://generativelanguage.googleapis.com/".freeze
DEFAULT_REQUEST_TIMEOUT =
120
DEFAULT_MODEL =
"gemini-pro".freeze

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/gemini.rb', line 22

def initialize
  @access_token = nil
  @api_version = DEFAULT_API_VERSION
  @organization_id = nil
  @uri_base = DEFAULT_URI_BASE
  @request_timeout = DEFAULT_REQUEST_TIMEOUT
  @default_model = DEFAULT_MODEL
end

Instance Attribute Details

#access_tokenObject

Raises:



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

def access_token
  return @access_token if @access_token

  error_text = "Gemini access token missing! See https://github.com/thechrisoshow/gemini#usage"
  raise ConfigurationError, error_text
end

#api_versionObject

Returns the value of attribute api_version.



14
15
16
# File 'lib/gemini.rb', line 14

def api_version
  @api_version
end

#default_modelObject

Returns the value of attribute default_model.



14
15
16
# File 'lib/gemini.rb', line 14

def default_model
  @default_model
end

#extra_headersObject

Returns the value of attribute extra_headers.



14
15
16
# File 'lib/gemini.rb', line 14

def extra_headers
  @extra_headers
end

#organization_idObject

Returns the value of attribute organization_id.



14
15
16
# File 'lib/gemini.rb', line 14

def organization_id
  @organization_id
end

#request_timeoutObject

Returns the value of attribute request_timeout.



14
15
16
# File 'lib/gemini.rb', line 14

def request_timeout
  @request_timeout
end

#uri_baseObject

Returns the value of attribute uri_base.



14
15
16
# File 'lib/gemini.rb', line 14

def uri_base
  @uri_base
end