Deepgram.Config (Deepgram v0.1.0)
View SourceConfiguration for the Deepgram client.
This module handles configuration options for the Deepgram client, including API keys, access tokens, base URLs, and other settings.
Summary
Functions
Returns the authorization header value based on the configuration.
Returns the default HTTP headers for requests.
Creates a new configuration.
Returns the user agent string.
Types
Functions
Returns the authorization header value based on the configuration.
Prioritizes access token over API key for authentication.
Returns the default HTTP headers for requests.
Creates a new configuration.
Options
:api_key
- Your Deepgram API key (required, or set viaDEEPGRAM_API_KEY
env var):access_token
- OAuth 2.0 access token (alternative to API key):base_url
- Base URL for API requests (default: "https://api.deepgram.com"):timeout
- Request timeout in milliseconds (default: 30_000):headers
- Additional HTTP headers (default: %{}):options
- Additional options (default: %{})
Examples
iex> config = Deepgram.Config.new(api_key: "your-api-key")
%Deepgram.Config{...}
iex> config = Deepgram.Config.new(access_token: "your-access-token")
%Deepgram.Config{...}
iex> config = Deepgram.Config.new() # Uses DEEPGRAM_API_KEY env var
%Deepgram.Config{...}
@spec user_agent() :: String.t()
Returns the user agent string.