Method: Deepgram::Base#initialize

Defined in:
lib/deepgram/base.rb

#initialize(options = {}) ⇒ Base

Initializes a Faraday connection to the Deepgram API. The API endpoint and authorization token are set via environment variables, with defaults provided.

Parameters:

  • options (Hash) (defaults to: {})

    Optional parameters for future extensions.



16
17
18
19
20
# File 'lib/deepgram/base.rb', line 16

def initialize(options = {})
  @connection = Faraday.new(url: ENV.fetch('DEEPGRAM_URL', 'https://api.deepgram.com'))
  @connection.headers['Authorization'] = "Token #{ENV.fetch('DEEPGRAM_API_KEY', 'api-key')}"
  @options = options
end