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

Provide Text for TODOs in Comments #261

Merged
merged 1 commit into from
Apr 5, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml

Expand Down
15 changes: 8 additions & 7 deletions Deepgram/Clients/Live/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public Client(string? apiKey = null, DeepgramWsClientOptions? options = null)
/// Fires when an event is received from the Deepgram API
/// </summary>
private event EventHandler<OpenResponse>? _openReceived;
private event EventHandler<MetadataResponse>? _metadataReceived;
private event EventHandler<ResultResponse>? _resultsReceived;
private event EventHandler<UtteranceEndResponse>? _utteranceEndReceived;
private event EventHandler<MetadataResponse>? _metadataReceived;
private event EventHandler<ResultResponse>? _resultsReceived;
private event EventHandler<UtteranceEndResponse>? _utteranceEndReceived;
private event EventHandler<SpeechStartedResponse>? _speechStartedReceived;
private event EventHandler<CloseResponse>? _closeReceived;
private event EventHandler<UnhandledResponse>? _unhandledReceived;
Expand Down Expand Up @@ -105,10 +105,10 @@ public async Task Connect(LiveSchema options, CancellationTokenSource? cancellat
}

// cancelation token
if (cancellationToken != null)
if (cancellationToken != null)
{
Log.Information("Connect", "Using provided cancellation token");
_cancellationTokenSource = cancellationToken;
Log.Information("Connect", "Using provided cancellation token");
_cancellationTokenSource = cancellationToken;
} else
{
Log.Information("Connect", "Using default cancellation token");
Expand Down Expand Up @@ -351,7 +351,8 @@ internal async Task ProcessSendQueue()
Log.Verbose("ProcessSendQueue", "Reading message of queue...");
while (_sendChannel.Reader.TryRead(out var message))
{
Log.Verbose("ProcessSendQueue", $"Sending message..."); // TODO: dump this message
// TODO: Add logging for message capturing for possible playback
Log.Verbose("ProcessSendQueue", "Sending message...");
lock (_mutexSend)
{
_clientWebSocket.SendAsync(message.Message, message.MessageType, true, _cancellationTokenSource.Token)
Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Clients/Speak/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task<SyncResponse> ToStream(TextSource source, SpeakSchema? speakSc
response.Date = DateTime.Parse(item.Value);
break;
default:
// TODO log this
Log.Error("ToStream", $"Unknown metadata key: {key}");
break;
}
}
Expand Down
3 changes: 1 addition & 2 deletions Deepgram/Factory/HttpClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
httpId = HTTPCLIENT_NAME;

var services = new ServiceCollection();
services.AddHttpClient(httpId)
services.AddHttpClient(httpId ?? HTTPCLIENT_NAME)
.AddTransientHttpErrorPolicy(policyBuilder =>
policyBuilder.WaitAndRetryAsync(Backoff.DecorrelatedJitterBackoffV2(TimeSpan.FromSeconds(1), 5)));
var sp = services.BuildServiceProvider();

var client = sp.GetRequiredService<IHttpClientFactory>().CreateClient(httpId);

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (6.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (6.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (6.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (6.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (7.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (7.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (7.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (7.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (8.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (8.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (8.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

Check warning on line 25 in Deepgram/Factory/HttpClientFactory.cs

View workflow job for this annotation

GitHub Actions / test (8.0.x)

Possible null reference argument for parameter 'name' in 'HttpClient IHttpClientFactory.CreateClient(string name)'.

// this is ok because we are using CancellationTokenSource with a default DefaultRESTTimeout timeout
client.Timeout = Timeout.InfiniteTimeSpan;
Expand All @@ -46,7 +46,6 @@
client.DefaultRequestHeaders.Add(header.Key, header.Value);
}

// TODO: log
client.BaseAddress = new Uri(options.BaseAddress);

return client;
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
22 changes: 11 additions & 11 deletions Deepgram/Models/Analyze/v1/AnalyzeSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,67 @@ namespace Deepgram.Models.Analyze.v1;
public class AnalyzeSchema
{
/// <summary>
/// TODO
/// Callback URL to provide if you would like your submitted text to be processed.
/// </summary>
[JsonPropertyName("callback")]
public string? CallBack { get; set; }

/// <summary>
/// TODO
/// Enable a callback method
/// </summary>
[JsonPropertyName("callback_method")]
public string? CallbackMethod { get; set; }

/// <summary>
/// TODO
/// Define custom intents.
/// </summary>
[JsonPropertyName("custom_intent")]
public List<string>? CustomIntent { get; set; }

/// <summary>
/// TODO
/// When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition to those submitted using the custom_intent param. Default: extended
/// </summary>
[JsonPropertyName("custom_intent_mode")]
public string? CustomIntentMode { get; set; }

/// <summary>
/// TODO
/// Define custom topics.
/// </summary>
[JsonPropertyName("custom_topic")]
public List<string>? CustomTopic { get; set; }

/// <summary>
/// TODO
/// When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param. Default: extended
/// </summary>
[JsonPropertyName("custom_topic_mode")]
public string? CustomTopicMode { get; set; }

/// <summary>
/// TODO
/// Recognizes speaker intent throughout an entire input text. Returns a list of text segments and the intents found within each segment
/// </summary>
[JsonPropertyName("intents")]
public bool? Intents { get; set; }

/// <summary>
/// TODO
/// Required: en. The language of your input text. (Only English language is supported at this time)
/// </summary>
[JsonPropertyName("language")]
public string? Language { get; set; }

/// <summary>
/// TODO
/// Recognizes the sentiment of the entire input text and detects a shift in sentiment throughout. Returns a list of text segments and the sentiment found within each segment.
/// </summary>
[JsonPropertyName("sentiment")]
public bool? Sentiment { get; set; }

/// <summary>
/// TODO
/// Provides a brief summary of the input text.
/// </summary>
[JsonPropertyName("summarize")]
public bool? Summarize { get; set; }

/// <summary>
/// TODO
/// Detects topics throughout an entire input text. Returns a list of text segments and the topics found within each segment.
/// </summary>
[JsonPropertyName("topics")]
public bool? Topics { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Deepgram/Models/Analyze/v1/Average.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Deepgram.Models.Analyze.v1;
public record Average
{
/// <summary>
/// TODO
/// Sentiment of the text segment.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("sentiment")]
public string? Sentiment { get; set; }

/// <summary>
/// TODO
/// Sentiment score of the audio segment, ranging from -1 (negative sentiment) to 1 (positive sentiment), with 0 indicating neutral sentiment.
/// </summary>
[JsonPropertyName("sentiment_score")]
public double? SentimentScore { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Analyze/v1/IntentsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace Deepgram.Models.Analyze.v1;
public record IntentsInfo
{
/// <summary>
/// TODO
/// Input tokens used in the model.
/// </summary>
[JsonPropertyName("input_tokens")]
public int? InputTokens { get; set; }

/// <summary>
/// TODO
/// Model UUID.
/// </summary>
[JsonPropertyName("model_uuid")]
public string? ModelUuid { get; set; }

/// <summary>
/// TODO
/// Output tokens used in the model.
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions Deepgram/Models/Analyze/v1/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ public record Metadata
public string? Language { get; set; }

/// <summary>
/// TODO
/// Intents information
/// </summary>
[JsonPropertyName("intents_info")]
public IntentsInfo? IntentsInfo { get; set; }

/// <summary>
/// TODO.
/// Sentiment information
/// </summary>
[JsonPropertyName("sentiment_info")]
public SentimentInfo? SentimentInfo { get; set; }

/// <summary>
/// TODO
/// Summary information
/// </summary>
[JsonPropertyName("summary_info")]
public SummaryInfo? SummaryInfo { get; set; }

/// <summary>
/// TODO
/// Topics information
/// </summary>
[JsonPropertyName("topics_info")]
public TopicsInfo? TopicsInfo { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Analyze/v1/Results.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Deepgram.Models.Analyze.v1;
public record Results
{
/// <summary>
/// TODO
/// Intents <see cref="IntentGroup"/>
/// </summary>
[JsonPropertyName("intents")]
public IntentGroup? Intents { get; set; }

/// <summary>
/// TODO
/// Sentiments <see cref="SentimentGroup"/>
/// </summary>
[JsonPropertyName("sentiments")]
public SentimentGroup? Sentiments { get; set; }
Expand All @@ -25,7 +25,7 @@ public record Results
public Summary? Summary { get; set; }

/// <summary>
/// TODO
/// Summary of the topics <see cref="TopicGroup"/>
/// </summary>
[JsonPropertyName("topics")]
public TopicGroup? Topics { get; set; }
Expand Down
14 changes: 7 additions & 7 deletions Deepgram/Models/Analyze/v1/Segment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@ namespace Deepgram.Models.Analyze.v1;
public record Segment
{
/// <summary>
/// TODO
/// Transcribed text
/// </summary>
[JsonPropertyName("text")]
public string? Text { get; set; }

/// <summary>
/// TODO
/// Timestamp of the start of the segment
/// </summary>
[JsonPropertyName("start_word")]
public int? StartWord { get; set; }

/// <summary>
/// TODO
/// Timestamp of the end of the segment
/// </summary>
[JsonPropertyName("end_word")]
public int? EndWord { get; set; }

/// <summary>
/// TODO
/// Sentiment: positive, negative, neutral
/// </summary>
[JsonPropertyName("sentiment")]
public string? Sentiment { get; set; }

/// <summary>
/// TODO
/// Sentiment score
/// </summary>
[JsonPropertyName("sentiment_score")]
public double? SentimentScore { get; set; }

/// <summary>
/// TODO
/// Topics list
/// </summary>
[JsonPropertyName("topics")]
public IReadOnlyList<Topic>? Topics { get; set; }

/// <summary>
/// TODO
/// Summary of the text
/// </summary>
[JsonPropertyName("intents")]
public IReadOnlyList<Intent>? Intents { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Deepgram/Models/Analyze/v1/SentimentGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Deepgram.Models.Analyze.v1;
public record SentimentGroup
{
/// <summary>
/// TODO
/// Sentiment of the text segment.
/// </summary>
[JsonPropertyName("segments")]
public IReadOnlyList<Segment>? Segments { get; set; }

/// <summary>
/// TODO
/// Sentiment of the text segment.
/// </summary>
[JsonPropertyName("average")]
public Average? Average { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Analyze/v1/SentimentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace Deepgram.Models.Analyze.v1;
public record SentimentInfo
{
/// <summary>
/// TODO
/// Input tokens used in the model.
/// </summary>
[JsonPropertyName("input_tokens")]
public int? InputTokens { get; set; }

/// <summary>
/// TODO
/// Model UUID.
/// </summary>
[JsonPropertyName("model_uuid")]
public string? ModelUuid { get; set; }

/// <summary>
/// TODO
/// Output tokens used in the model.
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Analyze/v1/SummaryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace Deepgram.Models.Analyze.v1;
public record SummaryInfo
{
/// <summary>
/// TODO
/// Input tokens used in the model.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("input_tokens")]
public int? InputTokens { get; set; }

/// <summary>
/// TODO
/// Model UUID.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("model_uuid")]
public string? ModelUUID { get; set; }

/// <summary>
/// TODO
/// Output tokens used in the model.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Models/Analyze/v1/Topic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public record Topic
public double? Confidence { get; set; }

/// <summary>
/// TODO
/// The discover topic.
/// </summary>
[JsonPropertyName("topic")]
public string Text;
Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Models/Analyze/v1/TopicGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Deepgram.Models.Analyze.v1;
public record TopicGroup
{
/// <summary>
/// TODO
/// Topics of the text segment.
/// </summary>
[JsonPropertyName("segments")]
public IReadOnlyList<Segment>? Segments { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Analyze/v1/TopicsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace Deepgram.Models.Analyze.v1;
public record TopicsInfo
{
/// <summary>
/// TODO
/// Input tokens used in the model.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("input_tokens")]
public int? InputTokens { get; set; }

/// <summary>
/// TODO
/// Model UUID.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("model_uuid")]
public string? ModelUuid { get; set; }

/// <summary>
/// TODO
/// Output tokens used in the model.
davidvonthenen marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
Expand Down
Loading
Loading