Class: VoyageAI::Config
- Inherits:
-
Object
- Object
- VoyageAI::Config
- Defined in:
- lib/voyageai/config.rb
Overview
Constant Summary collapse
- DEFAULT_HOST =
"https://api.voyageai.com"
- DEFAULT_VERSION =
"v1"
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(api_key: ENV.fetch("VOYAGEAI_API_KEY", nil), host: ENV.fetch("VOYAGEAI_HOST", DEFAULT_HOST), version: ENV.fetch("VOYAGEAI_VERSION", DEFAULT_VERSION), logger: nil, timeout: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(api_key: ENV.fetch("VOYAGEAI_API_KEY", nil), host: ENV.fetch("VOYAGEAI_HOST", DEFAULT_HOST), version: ENV.fetch("VOYAGEAI_VERSION", DEFAULT_VERSION), logger: nil, timeout: nil) ⇒ Config
Returns a new instance of Config.
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/voyageai/config.rb', line 43 def initialize( api_key: ENV.fetch("VOYAGEAI_API_KEY", nil), host: ENV.fetch("VOYAGEAI_HOST", DEFAULT_HOST), version: ENV.fetch("VOYAGEAI_VERSION", DEFAULT_VERSION), logger: nil, timeout: nil ) @api_key = api_key @host = host @version = version @logger = logger @timeout = timeout end |
Instance Attribute Details
#api_key ⇒ String?
20 21 22 |
# File 'lib/voyageai/config.rb', line 20 def api_key @api_key end |
#host ⇒ String?
24 25 26 |
# File 'lib/voyageai/config.rb', line 24 def host @host end |
#logger ⇒ Logger?
32 33 34 |
# File 'lib/voyageai/config.rb', line 32 def logger @logger end |
#timeout ⇒ Integer?
36 37 38 |
# File 'lib/voyageai/config.rb', line 36 def timeout @timeout end |
#version ⇒ String?
28 29 30 |
# File 'lib/voyageai/config.rb', line 28 def version @version end |