Class: RubyLLM::Ups::Configuration
- Inherits:
-
Object
- Object
- RubyLLM::Ups::Configuration
- Defined in:
- lib/ruby_llm/ups/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#async ⇒ Object
Returns the value of attribute async.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#circuit_breaker_threshold ⇒ Object
Returns the value of attribute circuit_breaker_threshold.
-
#circuit_breaker_timeout ⇒ Object
Returns the value of attribute circuit_breaker_timeout.
-
#component_id ⇒ Object
Returns the value of attribute component_id.
-
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
-
#on_error ⇒ Object
Returns the value of attribute on_error.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#status_page_id ⇒ Object
Returns the value of attribute status_page_id.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_llm/ups/configuration.rb', line 11 def initialize @base_url = "https://ups.dev" @request_timeout = 30 @on_error = ->(e) { $stderr.puts("[ruby_llm-ups] #{e.message}") } @async = true @flush_interval = 5 @circuit_breaker_threshold = 5 @circuit_breaker_timeout = 60 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def api_key @api_key end |
#async ⇒ Object
Returns the value of attribute async.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def async @async end |
#base_url ⇒ Object
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def base_url @base_url end |
#circuit_breaker_threshold ⇒ Object
Returns the value of attribute circuit_breaker_threshold.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def circuit_breaker_threshold @circuit_breaker_threshold end |
#circuit_breaker_timeout ⇒ Object
Returns the value of attribute circuit_breaker_timeout.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def circuit_breaker_timeout @circuit_breaker_timeout end |
#component_id ⇒ Object
Returns the value of attribute component_id.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def component_id @component_id end |
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def flush_interval @flush_interval end |
#on_error ⇒ Object
Returns the value of attribute on_error.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def on_error @on_error end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def request_timeout @request_timeout end |
#status_page_id ⇒ Object
Returns the value of attribute status_page_id.
6 7 8 |
# File 'lib/ruby_llm/ups/configuration.rb', line 6 def status_page_id @status_page_id end |
Instance Method Details
#validate! ⇒ Object
21 22 23 24 |
# File 'lib/ruby_llm/ups/configuration.rb', line 21 def validate! raise ConfigurationError, "api_key is required" if api_key.nil? || api_key.empty? raise ConfigurationError, "status_page_id is required" if status_page_id.nil? || status_page_id.empty? end |