Class: Aigen::Google::Configuration
- Inherits:
-
Object
- Object
- Aigen::Google::Configuration
- Defined in:
- lib/aigen/google/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#default_model ⇒ Object
Returns the value of attribute default_model.
-
#retry_count ⇒ Object
Returns the value of attribute retry_count.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/aigen/google/configuration.rb', line 8 def initialize @api_key = ENV.fetch("GOOGLE_API_KEY", nil) @default_model = "gemini-pro" @timeout = 30 @retry_count = 3 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/aigen/google/configuration.rb', line 6 def api_key @api_key end |
#default_model ⇒ Object
Returns the value of attribute default_model.
6 7 8 |
# File 'lib/aigen/google/configuration.rb', line 6 def default_model @default_model end |
#retry_count ⇒ Object
Returns the value of attribute retry_count.
6 7 8 |
# File 'lib/aigen/google/configuration.rb', line 6 def retry_count @retry_count end |
#timeout ⇒ Object
Returns the value of attribute timeout.
6 7 8 |
# File 'lib/aigen/google/configuration.rb', line 6 def timeout @timeout end |
Instance Method Details
#validate! ⇒ Object
15 16 17 |
# File 'lib/aigen/google/configuration.rb', line 15 def validate! raise ConfigurationError, "API key is required. Set via Aigen::Google.configure or ENV['GOOGLE_API_KEY']" if api_key.nil? || api_key.empty? end |