Closed dvonthenen closed 4 months ago
The update introduces two new projects, enhances logging procedures, and adjusts properties in various models to support nullable values. Additionally, improvements are made to example applications, expanding functionality in the streaming example and refining the intent analysis program. These changes aim to enhance the flexibility, debuggability, and overall functionality of the Deepgram .NET SDK.
File Path | Change Summary |
---|---|
Deepgram.Dev.sln |
Added "http" and "Streaming" projects with Debug and Release configurations. |
.../HttpClientFactory.cs |
Enhanced logging by logging HttpClient ID before instance creation. |
.../Live/v1/*.cs |
Updated multiple classes to allow nullable properties. |
.../PreRecorded/v1/Topic.cs |
Modified Text property to allow nullable values. |
.../Clients/*/Client.cs |
Enhanced logging by serializing schema objects for various operations. |
examples/analyze/intent/Program.cs |
Improved logging, increased timeout, and updated method call in intent analysis example. |
examples/prerecorded/file/Program.cs |
Updated libraries, HTTP handling, timeouts, and cancellation token usage in prerecorded example. |
examples/streaming/http/Program.cs |
Added functionality for connecting to a live streaming service. |
examples/streaming/http/Streaming.csproj |
New project file for streaming example, targeting .NET 6.0 with nullable reference types and project references. |
Deepgram/Utilities/JsonSerializeOptions.cs |
Introduced JsonSerializeOptions class for default JSON serialization options. |
test (8.0.x) success (3)
Deepgram/Factory/HttpClientFactory.cs: [warning] 22-22: Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.test (7.0.x) success (3)
Deepgram/Factory/HttpClientFactory.cs: [warning] 22-22: Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.test (6.0.x) success (3)
Deepgram/Factory/HttpClientFactory.cs: [warning] 22-22: Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.build success (4)
Deepgram/Factory/HttpClientFactory.cs: [warning] 22-22: Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'. --- Deepgram/Factory/HttpClientFactory.cs: [warning] 22-22: Possible null reference argument for parameter 'name' in 'IHttpClientBuilder HttpClientFactoryServiceCollectionExtensions.AddHttpClient(IServiceCollection services, string name)'.
Deepgram/Factory/HttpClientFactory.cs (2)
`19-19`: Logging the HttpClient ID enhances traceability and debugging. The concerns about a possible null reference are addressed by the preceding check ensuring `httpId` is not null. --- `22-22`: The configuration of the HttpClient with retry policies and service provider setup is correctly implemented. The static analysis concerns about `httpId` being null are already mitigated by earlier code.
First thing,
rc.1
is broken and it took me a few hours to figure out why. The why I am surprised that the compile didn't warn or flag a problem but instead it caused all REST calls to just timeout. I still don't know why the logging would cause the timeout, but I know that this is the root cause.The root cause is that the Logger is a Singleton that doesn't normally get instantiated until the
Library.Init
is called; however, by placing this single log line inDeepgram/Utilities/QueryParameterUtil.cs
will cause the Logger to get created because the utility class itself is a static class (this class and subsequently the logger get created on application start) seen here: https://github.com/deepgram/deepgram-dotnet-sdk/pull/271/files#diff-c64fc6a76bdff754827d325339cfe10b6649c111860869dc9831bcbbd4cc4f66L22Why the logger would hold up the timer and the REST
SendAsync
call... I would need to think about it. Again, I know that this is the line causing the bonk on all REST calls inrc.1
. So at least the problem is fixed.Second, added an example for doing HTTP Webcast from BBC to LiveClient.
Third, this exposed some params that need to be null'able when certain options are not set. Particularly, in PreRecorded and Live Models.