diff --git a/Deepgram/Models/Authenticate/v1/DeepgramHttpClientOptions.cs b/Deepgram/Models/Authenticate/v1/DeepgramHttpClientOptions.cs index 16ccde90..a1073f3a 100644 --- a/Deepgram/Models/Authenticate/v1/DeepgramHttpClientOptions.cs +++ b/Deepgram/Models/Authenticate/v1/DeepgramHttpClientOptions.cs @@ -100,7 +100,10 @@ public DeepgramHttpClientOptions(string? apiKey = null, string? baseAddress = nu Log.Debug("DeepgramHttpClientOptions", headers == null ? "Headers is null" : "Headers provided"); KeepAlive = false; - ApiKey = apiKey ?? ""; + if (string.IsNullOrWhiteSpace(ApiKey)) + { + ApiKey = apiKey ?? ""; + } BaseAddress = baseAddress ?? Defaults.DEFAULT_URI; OnPrem = onPrem ?? false; Addons = headers ?? new Dictionary(); diff --git a/Deepgram/Models/Authenticate/v1/DeepgramWsClientOptions.cs b/Deepgram/Models/Authenticate/v1/DeepgramWsClientOptions.cs index 9fa36f8e..64b25f07 100644 --- a/Deepgram/Models/Authenticate/v1/DeepgramWsClientOptions.cs +++ b/Deepgram/Models/Authenticate/v1/DeepgramWsClientOptions.cs @@ -97,7 +97,10 @@ public DeepgramWsClientOptions(string? apiKey = null, string? baseAddress = null Log.Debug("DeepgramWsClientOptions", headers == null ? "Headers is null" : "Headers provided"); Log.Debug("DeepgramWsClientOptions", addons == null ? "Addons is null" : "Addons provided"); - ApiKey = apiKey ?? ""; + if (string.IsNullOrWhiteSpace(ApiKey)) + { + ApiKey = apiKey ?? ""; + } BaseAddress = baseAddress ?? Defaults.DEFAULT_URI; KeepAlive = keepAlive ?? false; OnPrem = onPrem ?? false; diff --git a/Deepgram/Models/Manage/v1/Config.cs b/Deepgram/Models/Manage/v1/Config.cs index 44547232..3050c0b3 100644 --- a/Deepgram/Models/Manage/v1/Config.cs +++ b/Deepgram/Models/Manage/v1/Config.cs @@ -20,12 +20,14 @@ public record Config [JsonPropertyName("callback")] public string? Callback { get; set; } - /// - /// Indicates whether topic detection was requested. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonPropertyName("detect_topics")] - public bool? DetectTopics { get; set; } + // TODO: This is throwing an error, need to figure out how to handle this. Commenting out for now. + // Please see: https://github.com/deepgram/deepgram-dotnet-sdk/issues/346 + ///// + ///// Indicates whether topic detection was requested. + ///// + //[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + //[JsonPropertyName("detect_topics")] + //public bool? DetectTopics { get; set; } /// /// Indicates whether diarization was requested.