Skip to content

Commit

Permalink
Merge pull request #271 from dvonthenen/webcast-plus-model-null
Browse files Browse the repository at this point in the history
Implement Bonked `rc.1` + HTTP Webcast Example + Model Params When Null
  • Loading branch information
davidvonthenen authored Apr 10, 2024
2 parents db50b7c + 47f31d4 commit 1668952
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 59 deletions.
10 changes: 10 additions & 0 deletions Deepgram.Dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriggerCancel", "tests\expe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExerciseTimeout", "tests\expected_failures\websocket\exercise_timeout\ExerciseTimeout.csproj", "{8C5A02D8-E18B-4060-A567-A4AACC49B2F6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "http", "http", "{5DFC6330-8303-4045-B186-32B396391D31}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Streaming", "examples\streaming\http\Streaming.csproj", "{61B42F6B-521C-4A07-B592-54975F4AE2E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -261,6 +265,10 @@ Global
{8C5A02D8-E18B-4060-A567-A4AACC49B2F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C5A02D8-E18B-4060-A567-A4AACC49B2F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C5A02D8-E18B-4060-A567-A4AACC49B2F6}.Release|Any CPU.Build.0 = Release|Any CPU
{61B42F6B-521C-4A07-B592-54975F4AE2E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61B42F6B-521C-4A07-B592-54975F4AE2E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61B42F6B-521C-4A07-B592-54975F4AE2E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61B42F6B-521C-4A07-B592-54975F4AE2E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -329,6 +337,8 @@ Global
{DF383769-5F1F-4692-854F-2E923F3D0F09} = {D100AACD-E5FB-45E5-980B-B19C091440B2}
{F736604C-A245-411E-BECE-028FBD98166E} = {80E7546A-4CED-4644-8900-983422CDE73C}
{8C5A02D8-E18B-4060-A567-A4AACC49B2F6} = {3AC17A9C-30BB-4298-8E5A-4FAE73189821}
{5DFC6330-8303-4045-B186-32B396391D31} = {132EEE99-6194-477A-9416-D7EF173C17FD}
{61B42F6B-521C-4A07-B592-54975F4AE2E6} = {5DFC6330-8303-4045-B186-32B396391D31}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8D4ABC6D-7126-4EE2-9303-43A954616B2A}
Expand Down
9 changes: 1 addition & 8 deletions Deepgram/Abstractions/AbstractRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public virtual async Task<T> GetAsync<S, T>(string uriSegment, S? parameter, Can
{
Log.Verbose("AbstractRestClient.GetAsync<S, T>", "ENTER");
Log.Debug("GetAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("GetAsync<S, T>", $"parameter: {parameter}");
Log.Debug("GetAsync<S, T>", $"addons: {addons}");

try
Expand Down Expand Up @@ -173,7 +172,6 @@ public virtual async Task<LocalFileWithMetadata> PostRetrieveLocalFileAsync<R, S
{
Log.Verbose("AbstractRestClient.PostRetrieveLocalFileAsync<R, S, T>", "ENTER");
Log.Debug("PostRetrieveLocalFileAsync<R, S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PostRetrieveLocalFileAsync<R, S, T>", $"parameter: {parameter}");
Log.Debug("PostRetrieveLocalFileAsync<R, S, T>", $"keys: {keys}");
Log.Debug("PostRetrieveLocalFileAsync<R, S, T>", $"addons: {addons}");

Expand Down Expand Up @@ -290,7 +288,6 @@ public virtual async Task<T> PostAsync<S, T>(string uriSegment, S? parameter, Ca
{
Log.Verbose("AbstractRestClient.PostAsync<S, T>", "ENTER");
Log.Debug("PostAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PostAsync<S, T>", $"parameter: {parameter}");
Log.Debug("PostAsync<S, T>", $"addons: {addons}");

try
Expand Down Expand Up @@ -350,8 +347,7 @@ public virtual async Task<T> PostAsync<R, S, T>(string uriSegment, S? parameter,
Dictionary<string, string>? addons = null, Dictionary<string, string>? headers = null)
{
Log.Verbose("AbstractRestClient.PostAsync<R, S, T>", "ENTER");
Log.Debug("PostAsync<R, S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PostAsync<R, S, T>", $"parameter: {parameter}");
Log.Debug("PostAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PostAsync<R, S, T>", $"addons: {addons}");

try
Expand Down Expand Up @@ -428,7 +424,6 @@ public virtual async Task<T> PatchAsync<S, T>(string uriSegment, S? parameter, C
{
Log.Verbose("AbstractRestClient.PatchAsync<S, T>", "ENTER");
Log.Debug("PatchAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PatchAsync<S, T>", $"parameter: {parameter}");
Log.Debug("PatchAsync<S, T>", $"addons: {addons}");

try
Expand Down Expand Up @@ -503,7 +498,6 @@ public virtual async Task<T> PutAsync<S, T>(string uriSegment, S? parameter, Can
{
Log.Verbose("AbstractRestClient.PutAsync<S, T>", "ENTER");
Log.Debug("PutAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("PutAsync<S, T>", $"parameter: {parameter}");
Log.Debug("PutAsync<S, T>", $"addons: {addons}");

try
Expand Down Expand Up @@ -635,7 +629,6 @@ public virtual async Task<T> DeleteAsync<S, T>(string uriSegment, S? parameter,
{
Log.Verbose("AbstractRestClient.DeleteAsync<S, T>", "ENTER");
Log.Debug("DeleteAsync<S, T>", $"uriSegment: {uriSegment}");
Log.Debug("DeleteAsync<S, T>", $"parameter: {parameter}");
Log.Debug("DeleteAsync<S, T>", $"addons: {addons}");

try
Expand Down
8 changes: 4 additions & 4 deletions Deepgram/Clients/Analyze/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task<SyncResponse> AnalyzeUrl(UrlSource source, AnalyzeSchema? anal
{
Log.Verbose("AnalyzeClient.AnalyzeUrl", "ENTER");
Log.Information("AnalyzeUrl", $"source: {source}");
Log.Information("AnalyzeUrl", $"analyzeSchema: {analyzeSchema}");
Log.Information("AnalyzeUrl", $"analyzeSchema:\n{JsonSerializer.Serialize(analyzeSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyNoCallBack(nameof(AnalyzeUrl), analyzeSchema);

Expand Down Expand Up @@ -66,7 +66,7 @@ public async Task<SyncResponse> AnalyzeFile(Stream source, AnalyzeSchema? analyz
{
Log.Verbose("AnalyzeClient.AnalyzeFile", "ENTER");
Log.Information("AnalyzeFile", $"source: {source}");
Log.Information("AnalyzeFile", $"analyzeSchema: {analyzeSchema}");
Log.Information("AnalyzeFile", $"analyzeSchema:\n{JsonSerializer.Serialize(analyzeSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyNoCallBack(nameof(AnalyzeFile), analyzeSchema);

Expand Down Expand Up @@ -109,7 +109,7 @@ public async Task<AsyncResponse> AnalyzeFileCallBack(Stream source, string? call
Log.Verbose("AnalyzeClient.AnalyzeFileCallBack", "ENTER");
Log.Information("AnalyzeFileCallBack", $"source: {source}");
Log.Information("AnalyzeFileCallBack", $"callBack: {callBack}");
Log.Information("AnalyzeFileCallBack", $"analyzeSchema: {analyzeSchema}");
Log.Information("AnalyzeFileCallBack", $"analyzeSchema:\n{JsonSerializer.Serialize(analyzeSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyOneCallBackSet(nameof(AnalyzeFileCallBack), callBack, analyzeSchema);
if (callBack != null)
Expand Down Expand Up @@ -139,7 +139,7 @@ public async Task<AsyncResponse> AnalyzeUrlCallBack(UrlSource source, string? ca
Log.Verbose("AnalyzeClient.AnalyzeUrlCallBack", "ENTER");
Log.Information("AnalyzeUrlCallBack", $"source: {source}");
Log.Information("AnalyzeUrlCallBack", $"callBack: {callBack}");
Log.Information("AnalyzeUrlCallBack", $"analyzeSchema: {analyzeSchema}");
Log.Information("AnalyzeUrlCallBack", $"analyzeSchema:\n{JsonSerializer.Serialize(analyzeSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyOneCallBackSet(nameof(AnalyzeUrlCallBack), callBack, analyzeSchema);
if (callBack != null)
Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Clients/Live/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task Connect(LiveSchema options, CancellationTokenSource? cancelTok
Dictionary<string, string>? headers = null)
{
Log.Verbose("LiveClient.Connect", "ENTER");
Log.Information("Connect", $"options: {options}");
Log.Information("Connect", $"options:\n{JsonSerializer.Serialize(options, JsonSerializeOptions.DefaultOptions)}");
Log.Debug("Connect", $"addons: {addons}");

// check if the client is disposed
Expand Down
15 changes: 7 additions & 8 deletions Deepgram/Clients/Manage/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

using System;
using Deepgram.Models.Authenticate.v1;
using Deepgram.Models.Manage.v1;

Expand Down Expand Up @@ -69,7 +68,7 @@ public async Task<MessageResponse> UpdateProject(string projectId, ProjectSchema
{
Log.Verbose("ManageClient.UpdateProject", "ENTER");
Log.Information("UpdateProject", $"projectId: {projectId}");
Log.Information("UpdateProject", $"updateProjectSchema: {updateProjectSchema}");
Log.Information("UpdateProject", $"updateProjectSchema:\n{JsonSerializer.Serialize(updateProjectSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}");
var result = await PatchAsync<ProjectSchema, MessageResponse>(uri, updateProjectSchema, cancellationToken, addons, headers);
Expand Down Expand Up @@ -181,7 +180,7 @@ public async Task<KeyResponse> CreateKey(string projectId, KeySchema keySchema,
{
Log.Verbose("ManageClient.CreateKey", "ENTER");
Log.Information("CreateKey", $"projectId: {projectId}");
Log.Information("CreateKey", $"keySchema: {keySchema}");
Log.Information("CreateKey", $"keySchema:\n{JsonSerializer.Serialize(keySchema, JsonSerializeOptions.DefaultOptions)}");

if (keySchema.ExpirationDate is not null && keySchema.TimeToLiveInSeconds is not null)
{
Expand Down Expand Up @@ -280,7 +279,7 @@ public async Task<MessageResponse> SendInvite(string projectId, InviteSchema inv
{
Log.Verbose("ManageClient.SendInvite", "ENTER");
Log.Information("SendInvite", $"projectId: {projectId}");
Log.Information("SendInvite", $"inviteSchema: {inviteSchema}");
Log.Information("SendInvite", $"inviteSchema:\n{JsonSerializer.Serialize(inviteSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.INVITES}");
var result = await PostAsync<InviteSchema, MessageResponse>(uri, inviteSchema, cancellationToken, addons, headers);
Expand Down Expand Up @@ -351,7 +350,7 @@ public async Task<MessageResponse> UpdateMemberScope(string projectId, string me
Log.Verbose("ManageClient.UpdateMemberScope", "ENTER");
Log.Information("UpdateMemberScope", $"projectId: {projectId}");
Log.Information("UpdateMemberScope", $"memberId: {memberId}");
Log.Information("UpdateMemberScope", $"projectId: {scopeSchema}");
Log.Information("UpdateMemberScope", $"scopeSchema:\n{JsonSerializer.Serialize(scopeSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.MEMBERS}/{memberId}/{UriSegments.SCOPES}");
var result = await PutAsync<MemberScopeSchema, MessageResponse>(uri,scopeSchema, cancellationToken, addons, headers);
Expand Down Expand Up @@ -400,7 +399,7 @@ public async Task<UsageRequestsResponse> GetUsageRequests(string projectId, Usag
{
Log.Verbose("ManageClient.GetUsageRequests", "ENTER");
Log.Information("GetUsageRequests", $"projectId: {projectId}");
Log.Information("GetUsageRequests", $"usageRequestsSchema: {usageRequestsSchema}");
Log.Information("GetUsageRequests", $"usageRequestsSchema:\n{JsonSerializer.Serialize(usageRequestsSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.REQUESTS}");
var result = await GetAsync<UsageRequestsSchema, UsageRequestsResponse>(uri, usageRequestsSchema, cancellationToken, addons, headers);
Expand Down Expand Up @@ -446,7 +445,7 @@ public async Task<UsageSummaryResponse> GetUsageSummary(string projectId, UsageS
{
Log.Verbose("ManageClient.GetUsageSummary", "ENTER");
Log.Information("GetUsageSummary", $"projectId: {projectId}");
Log.Information("GetUsageSummary", $"summarySchema: {summarySchema}");
Log.Information("GetUsageSummary", $"summarySchema:\n{JsonSerializer.Serialize(summarySchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.USAGE}");
var result = await GetAsync<UsageSummarySchema, UsageSummaryResponse>(uri, summarySchema, cancellationToken, addons, headers);
Expand All @@ -469,7 +468,7 @@ public async Task<UsageFieldsResponse> GetUsageFields(string projectId, UsageFie
{
Log.Verbose("ManageClient.GetUsageFields", "ENTER");
Log.Information("GetUsageFields", $"projectId: {projectId}");
Log.Information("GetUsageFields", $"summarySchema: {fieldsSchema}");
Log.Information("GetUsageFields", $"summarySchema:\n{JsonSerializer.Serialize(fieldsSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.USAGE}/fields");
var result = await GetAsync<UsageFieldsSchema, UsageFieldsResponse>(uri, fieldsSchema, cancellationToken, addons, headers);
Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Clients/OnPrem/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task<CredentialResponse> CreateCredentials(string projectId, Creden
{
Log.Verbose("OnPremClient.CreateCredentials", "ENTER");
Log.Debug("CreateCredentials", $"projectId: {projectId}");
Log.Debug("CreateCredentials", $"credentialsSchema: {credentialsSchema}");
Log.Debug("CreateCredentials", $"credentialsSchema:\n{JsonSerializer.Serialize(credentialsSchema, JsonSerializeOptions.DefaultOptions)}");

var uri = GetUri(_options, $"{UriSegments.PROJECTS}/{projectId}/{UriSegments.ONPREM}");
var result = await PostAsync<CredentialsSchema, CredentialResponse>(uri, credentialsSchema, cancellationToken, addons, headers);
Expand Down
8 changes: 4 additions & 4 deletions Deepgram/Clients/PreRecorded/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task<SyncResponse> TranscribeUrl(UrlSource source, PrerecordedSchem
{
Log.Verbose("PreRecordedClient.TranscribeUrl", "ENTER");
Log.Information("TranscribeUrl", $"source: {source}");
Log.Information("TranscribeUrl", $"prerecordedSchema: {prerecordedSchema}");
Log.Information("TranscribeUrl", $"prerecordedSchema:\n{JsonSerializer.Serialize(prerecordedSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyNoCallBack(nameof(TranscribeUrl), prerecordedSchema);

Expand Down Expand Up @@ -66,7 +66,7 @@ public async Task<SyncResponse> TranscribeFile(Stream source, PrerecordedSchema?
{
Log.Verbose("PreRecordedClient.TranscribeFile", "ENTER");
Log.Information("TranscribeFile", $"source: {source}");
Log.Information("TranscribeFile", $"prerecordedSchema: {prerecordedSchema}");
Log.Information("TranscribeFile", $"prerecordedSchema:\n{JsonSerializer.Serialize(prerecordedSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyNoCallBack(nameof(TranscribeFile), prerecordedSchema);

Expand Down Expand Up @@ -108,7 +108,7 @@ public async Task<AsyncResponse> TranscribeFileCallBack(Stream source, string? c
Log.Verbose("PreRecordedClient.TranscribeFileCallBack", "ENTER");
Log.Information("TranscribeFileCallBack", $"source: {source}");
Log.Information("TranscribeFileCallBack", $"callBack: {callBack}");
Log.Information("TranscribeFileCallBack", $"prerecordedSchema: {prerecordedSchema}");
Log.Information("TranscribeFileCallBack", $"prerecordedSchema:\n{JsonSerializer.Serialize(prerecordedSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyOneCallBackSet(nameof(TranscribeFileCallBack), callBack, prerecordedSchema);
if (callBack != null)
Expand Down Expand Up @@ -136,7 +136,7 @@ public async Task<AsyncResponse> TranscribeUrlCallBack(UrlSource source, string?
Log.Verbose("PreRecordedClient.TranscribeUrlCallBack", "ENTER");
Log.Information("TranscribeUrlCallBack", $"source: {source}");
Log.Information("TranscribeUrlCallBack", $"callBack: {callBack}");
Log.Information("TranscribeUrlCallBack", $"prerecordedSchema: {prerecordedSchema}");
Log.Information("TranscribeUrlCallBack", $"prerecordedSchema:\n{JsonSerializer.Serialize(prerecordedSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyOneCallBackSet(nameof(TranscribeUrlCallBack), callBack, prerecordedSchema);

Expand Down
5 changes: 2 additions & 3 deletions Deepgram/Clients/Speak/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task<SyncResponse> ToStream(TextSource source, SpeakSchema? speakSc
{
Log.Verbose("SpeakClient.ToStream", "ENTER");
Log.Information("ToStream", $"source: {source}");
Log.Information("ToStream", $"analyzeSchema: {speakSchema}");
Log.Information("ToStream", $"analyzeSchema:\n{JsonSerializer.Serialize(speakSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyNoCallBack(nameof(ToStream), speakSchema);

Expand Down Expand Up @@ -98,7 +98,6 @@ public async Task<SyncResponse> ToFile(TextSource source, string filename, Speak
)
{
Log.Verbose("Client.ToFile", "ENTER");
Log.Information("ToFile", $"source: {source}");
Log.Information("ToFile", $"filename: {filename}");

var response = await ToStream(source, speakSchema, cancellationToken, addons, headers);
Expand Down Expand Up @@ -133,7 +132,7 @@ public async Task<AsyncResponse> StreamCallBack(TextSource source, string? callB
Log.Verbose("SpeakClient.StreamCallBack", "ENTER");
Log.Information("StreamCallBack", $"source: {source}");
Log.Information("StreamCallBack", $"callBack: {callBack}");
Log.Information("StreamCallBack", $"speakSchema: {speakSchema}");
Log.Information("StreamCallBack", $"speakSchema:\n{JsonSerializer.Serialize(speakSchema, JsonSerializeOptions.DefaultOptions)}");

VerifyOneCallBackSet(nameof(StreamCallBack), callBack, speakSchema);
if (callBack != null)
Expand Down
6 changes: 4 additions & 2 deletions Deepgram/Factory/HttpClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ internal class HttpClientFactory

public static HttpClient Create(string? httpId = null)
{
if (string.IsNullOrWhiteSpace(httpId))
if (string.IsNullOrEmpty(httpId))
httpId = HTTPCLIENT_NAME;

Log.Information("HttpClientFactory.Create", $"HttpClient ID: {httpId}");

var services = new ServiceCollection();
services.AddHttpClient(httpId ?? HTTPCLIENT_NAME)
services.AddHttpClient(httpId)

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

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.

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

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.

Check warning on line 22 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 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.

Check warning on line 22 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 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.

Check warning on line 22 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 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.
.AddTransientHttpErrorPolicy(policyBuilder =>
policyBuilder.WaitAndRetryAsync(Backoff.DecorrelatedJitterBackoffV2(TimeSpan.FromSeconds(1), 5)));
var sp = services.BuildServiceProvider();
Expand Down
6 changes: 3 additions & 3 deletions Deepgram/Models/Live/v1/Alternative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ public record Alternative
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("transcript")]
public string Transcript { get; set; }
public string? Transcript { get; set; }
/// <summary>
/// Value between 0 and 1 indicating the model's relative confidence in this transcript.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("confidence")]
public double Confidence { get; set; }
public double? Confidence { get; set; }

/// <summary>
/// ReadOnly List of <see cref="Word"/> objects.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("words")]
public IReadOnlyList<Word> Words { get; set; }
public IReadOnlyList<Word>? Words { get; set; }
}
2 changes: 1 addition & 1 deletion Deepgram/Models/Live/v1/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public record Channel
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("alternatives")]
public IReadOnlyList<Alternative> Alternatives { get; set; }
public IReadOnlyList<Alternative>? Alternatives { get; set; }
}
Loading

0 comments on commit 1668952

Please sign in to comment.