Class: OpenAI::Configuration
- Inherits:
-
Object
- Object
- OpenAI::Configuration
- Defined in:
- lib/openai.rb
Constant Summary collapse
- DEFAULT_API_VERSION =
"v1".freeze
- DEFAULT_URI_BASE =
"https://api.openai.com/".freeze
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#uri_base ⇒ Object
Returns the value of attribute uri_base.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 29 30 |
# File 'lib/openai.rb', line 24 def initialize @access_token = nil @api_version = DEFAULT_API_VERSION @organization_id = nil @uri_base = DEFAULT_URI_BASE @request_timeout = DEFAULT_REQUEST_TIMEOUT end |
Instance Attribute Details
#access_token ⇒ Object
32 33 34 35 36 37 |
# File 'lib/openai.rb', line 32 def access_token return @access_token if @access_token error_text = "OpenAI access token missing! See https://github.com/alexrudall/ruby-openai#usage" raise ConfigurationError, error_text end |
#api_version ⇒ Object
Returns the value of attribute api_version.
18 19 20 |
# File 'lib/openai.rb', line 18 def api_version @api_version end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
18 19 20 |
# File 'lib/openai.rb', line 18 def organization_id @organization_id end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
18 19 20 |
# File 'lib/openai.rb', line 18 def request_timeout @request_timeout end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
18 19 20 |
# File 'lib/openai.rb', line 18 def uri_base @uri_base end |