Class: Asimov::Configuration
- Inherits:
-
Object
- Object
- Asimov::Configuration
- Defined in:
- lib/asimov/configuration.rb
Overview
Application-wide configuration for the Asimov library. Should be configured once using the Asimov.configure method on application startup.
Constant Summary collapse
- DEFAULT_OPENAI_BASE_URI =
"https://api.openai.com/v1".freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#openai_api_base ⇒ Object
Returns the value of attribute openai_api_base.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#request_options ⇒ Object
Returns the value of attribute request_options.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Initializes the Configuration object and resets it to default values.
-
#reset ⇒ Object
Reset the configuration to default values.
Constructor Details
#initialize ⇒ Configuration
Initializes the Configuration object and resets it to default values.
19 20 21 |
# File 'lib/asimov/configuration.rb', line 19 def initialize reset end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/asimov/configuration.rb', line 10 def api_key @api_key end |
#openai_api_base ⇒ Object
Returns the value of attribute openai_api_base.
12 13 14 |
# File 'lib/asimov/configuration.rb', line 12 def openai_api_base @openai_api_base end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
10 11 12 |
# File 'lib/asimov/configuration.rb', line 10 def organization_id @organization_id end |
#request_options ⇒ Object
Returns the value of attribute request_options.
12 13 14 |
# File 'lib/asimov/configuration.rb', line 12 def @request_options end |
Instance Method Details
#reset ⇒ Object
Reset the configuration to default values. Mostly used for testing.
26 27 28 29 30 31 |
# File 'lib/asimov/configuration.rb', line 26 def reset @api_key = nil @organization_id = nil @request_options = {} @openai_api_base = DEFAULT_OPENAI_BASE_URI end |