Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API Key Using Property #350

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading