Class: Deepseek::Configuration
- Inherits:
-
Object
- Object
- Deepseek::Configuration
- Defined in:
- lib/deepseek/configuration.rb
Instance Attribute Summary collapse
-
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#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.
5 6 7 8 9 10 |
# File 'lib/deepseek/configuration.rb', line 5 def initialize @api_key = ENV['DEEPSEEK_API_KEY'] @api_base_url = ENV['DEEPSEEK_API_BASE_URL'] || 'https://api.deepseek.com' @timeout = ENV['DEEPSEEK_TIMEOUT']&.to_i || 30 @max_retries = ENV['DEEPSEEK_MAX_RETRIES']&.to_i || 3 end |
Instance Attribute Details
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
3 4 5 |
# File 'lib/deepseek/configuration.rb', line 3 def api_base_url @api_base_url end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/deepseek/configuration.rb', line 3 def api_key @api_key end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
3 4 5 |
# File 'lib/deepseek/configuration.rb', line 3 def max_retries @max_retries end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/deepseek/configuration.rb', line 3 def timeout @timeout end |
Instance Method Details
#validate! ⇒ Object
12 13 14 |
# File 'lib/deepseek/configuration.rb', line 12 def validate! raise ConfigurationError, 'API key must be set' if api_key.nil? || api_key.to_s.strip.empty? end |