Class: GeminiAi::Configuration

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

Constant Summary collapse

DEFAULT_SERVICE_VERSION =
'v1'.freeze
DEFAULT_SERVICE =
'generative-language-api'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



34
35
36
37
38
39
40
# File 'lib/gemini-ai.rb', line 34

def initialize
  @api_key = nil
  @region = nil
  @file_path = nil
  @version = DEFAULT_SERVICE_VERSION
  @service = DEFAULT_SERVICE
end

Instance Attribute Details

#api_keyObject



42
43
44
# File 'lib/gemini-ai.rb', line 42

def api_key
  @api_key
end

#file_pathObject



57
58
59
# File 'lib/gemini-ai.rb', line 57

def file_path
  @file_path
end

#regionObject



61
62
63
# File 'lib/gemini-ai.rb', line 61

def region
  @region
end

#serviceObject



46
47
48
49
50
51
# File 'lib/gemini-ai.rb', line 46

def service
  unless %w[vertex-ai-api generative-language-api].include?(@service)
    raise Errors::UnsupportedServiceError, "Unsupported service: #{@service}"
  end
  @service
end

#versionObject



53
54
55
# File 'lib/gemini-ai.rb', line 53

def version
  @version
end