Skip to content

Commit

Permalink
Merge pull request #350 from dvonthenen/fix-apikey-using-property
Browse files Browse the repository at this point in the history
Fix API Key Using Property
  • Loading branch information
davidvonthenen authored Nov 4, 2024
2 parents 5991268 + 5acc3ac commit 86b27b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Deepgram/Models/Authenticate/v1/DeepgramHttpClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>();
Expand Down
5 changes: 4 additions & 1 deletion Deepgram/Models/Authenticate/v1/DeepgramWsClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 8 additions & 6 deletions Deepgram/Models/Manage/v1/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ public record Config
[JsonPropertyName("callback")]
public string? Callback { get; set; }

/// <summary>
/// Indicates whether topic detection was requested.
/// </summary>
[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
///// <summary>
///// Indicates whether topic detection was requested.
///// </summary>
//[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
//[JsonPropertyName("detect_topics")]
//public bool? DetectTopics { get; set; }

/// <summary>
/// Indicates whether diarization was requested.
Expand Down

0 comments on commit 86b27b7

Please sign in to comment.