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.
16 17 18 19 20 |
# File 'lib/deepgram/base.rb', line 16 def initialize( = {}) @connection = Faraday.new(url: ENV.fetch('DEEPGRAM_URL', 'https://api.deepgram.com')) @connection.headers['Authorization'] = "Token #{ENV.fetch('DEEPGRAM_API_KEY', 'api-key')}" @options = end |