DeepgramConfig class
Immutable configuration object shared by every sub-client.
Provide either apiKey, or jwt, or set a token provider on the client.
Constructors
- DeepgramConfig({String? apiKey, String? jwt, String baseUrl = 'api.deepgram.com', String agentBaseUrl = 'agent.deepgram.com', bool useTls = true, Duration requestTimeout = const Duration(seconds: 60), Duration connectTimeout = const Duration(seconds: 15), int maxRetries = 3, Duration retryBaseDelay = const Duration(milliseconds: 500), Duration retryMaxDelay = const Duration(seconds: 10), String? probeUrl, DeepgramLogger? logger})
-
Creates a configuration.
const
- DeepgramConfig.region(DeepgramRegion region, {String? apiKey, String? jwt, Duration requestTimeout = const Duration(seconds: 60), Duration connectTimeout = const Duration(seconds: 15), int maxRetries = 3, Duration retryBaseDelay = const Duration(milliseconds: 500), Duration retryMaxDelay = const Duration(seconds: 10), String? probeUrl, DeepgramLogger? logger})
-
Creates a configuration pointing at a DeepgramRegion.
factory
Properties
- agentBaseUrl → String
-
Host for the Voice Agent WebSocket. Default:
agent.deepgram.com.final - apiKey → String?
-
Deepgram API key (
Authorization: Token <apiKey>).final - baseUrl → String
-
Host for REST + media WebSockets. Default:
api.deepgram.com.final - connectTimeout → Duration
-
Timeout for establishing WebSocket connections.
final
- effectiveProbeUrl → String
-
The URL used by the connectivity probe.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- jwt → String?
-
A pre-issued JSON Web Token (
Authorization: Bearer <jwt>).final - logger → DeepgramLogger?
-
Optional logger shared by every component.
final
- maxRetries → int
-
Maximum number of retries for idempotent REST requests.
final
- probeUrl → String?
-
URL used by the connectivity probe to distinguish "internet is down"
from "Deepgram is down". Defaults to the REST base URL.
final
- requestTimeout → Duration
-
Default timeout for REST requests (scaled up automatically for large
audio uploads).
final
- restScheme → String
-
The REST scheme (
httpsorhttp).no setter - retryBaseDelay → Duration
-
Base delay for the exponential retry backoff.
final
- retryMaxDelay → Duration
-
Upper bound for the exponential retry backoff.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useTls → bool
-
Whether to use TLS (
https/wss). Should staytruein production.final - wsScheme → String
-
The WebSocket scheme (
wssorws).no setter
Methods
-
agentWsUri(
String path, [Map< String, dynamic> ? query]) → Uri -
Builds a WebSocket URI for
pathon the Voice Agent host. -
copyWith(
{String? apiKey, String? jwt, String? baseUrl, String? agentBaseUrl, bool? useTls, Duration? requestTimeout, Duration? connectTimeout, int? maxRetries, Duration? retryBaseDelay, Duration? retryMaxDelay, String? probeUrl, DeepgramLogger? logger}) → DeepgramConfig - Returns a copy with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restUri(
String path, [Map< String, dynamic> ? query]) → Uri -
Builds a REST URI for
path(e.g./v1/listen). -
toString(
) → String -
A string representation of this object.
inherited
-
wsUri(
String path, [Map< String, dynamic> ? query]) → Uri -
Builds a WebSocket URI for
pathon the media host.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited