Closed davidvonthenen closed 9 months ago
The recent updates involve significant refactoring across the Deepgram .NET SDK, focusing on simplifying the import structure, enhancing consistency in URI segment handling, and streamlining client classes for various functionalities like Analyze, Live, Manage, OnPrem, and PreRecorded services. Changes include renaming classes and methods, adjusting namespaces, and refining the way HTTP clients are managed and utilized. This overhaul aims to improve the SDK's maintainability, usability, and alignment with the latest API capabilities.
File(s) | Summary |
---|---|
Deepgram.Dev.sln |
Updated to define projects and configurations for Debug and Release modes. |
Deepgram.Tests/UnitTests/ClientTests/AbstractRestClientTests.cs ,Deepgram.Tests/UnitTests/ClientTests/ManageClientTest.cs |
Updated import statements, removing Deepgram.Encapsulations and adding version-specific client imports. |
Deepgram.Tests/UnitTests/ClientTests/AnalyzeClientTests.cs ,Deepgram/Clients/Analyze/v1/Client.cs ,Deepgram/Clients/Analyze/v1/UriSegments.cs |
Refactored AnalyzeClient and updated URI segments and import statements. |
Deepgram.Tests/UnitTests/ClientTests/LiveClientTests.cs ,Deepgram.Tests/UnitTests/ClientTests/PreRecordedClientTests.cs ,Deepgram/Clients/Live/v1/... ,Deepgram/Clients/PreRecorded/v1/... ,Deepgram/LiveClient.cs ,examples/streaming/Program.cs |
Import updates, class and method renaming, and URI segment consistency improvements for Live and PreRecorded clients. |
Deepgram/Clients/Manage/v1/... ,Deepgram/ManageClient.cs |
Implemented version 1 of the Manage Client with updated import statements and functionality adjustments. |
Deepgram/Clients/OnPrem/v1/... ,Deepgram/OnPremClient.cs |
Introduced version 1 of the OnPrem Client with new URI segments and simplified client functionality. |
Deepgram/Constants/... ,Deepgram/Factory/HttpClientFactory.cs |
Namespace changes from Enums to Constants and updates in HTTP client management. |
Deepgram/GlobalUsings.cs ,Deepgram/README.md ,README.md |
Removed global usings for outdated namespaces and updated method names in documentation. |
Deepgram/Models/Live/v1/... |
Added new properties and updated types in live transcription models. |
Deepgram/Utilities/RequestContentUtil.cs ,examples/prerecorded/... |
Made DEFAULT_CONTENT_TYPE public and updated project references and namespace usage in examples. |
This table summarizes the key changes across the SDK, showcasing efforts to streamline the codebase and align it with current best practices and the Deepgram API's structure.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Ths start to address issue to refactor and simplify the Live Client: https://github.com/deepgram/deepgram-dotnet-sdk/issues/235 and https://github.com/deepgram/deepgram-dotnet-sdk/issues/229
Changes:
Deepgram
toDeepgram/Clients/<type>/v1
. Then preserved the latest/current version of the clients at the root of theDeepgram
package. This is similar to how Python and Go behave. Allows us to break interfaces and preserve users implementations.HttpClientFactory.CreateClient(Defaults.HTTPCLIENT_NAME)
now takes in an optional value for the HTTP Client name (defaults toDefaults.HTTPCLIENT_NAME
). There are instances in which you want to create multiple clients per application, such as in a thread pool.ResponseReceivedEventArgs
->ResponseEventArgs
,Others changes not related to Live Client that I noticed while working on the refactor:
Read
related toAnalyze
for the Text IntelligencePrerecorded
->PreRecorded
(don't want to have-
in the name soPre-Recorded
->PreRecorded
).TODOs:
The Prerecorded and Live examples function correctly and the unit tests pass.
Summary by CodeRabbit
Summary by CodeRabbit
UriSegments
classes for consistent URI management across SDK.SpeechStarted
event in live transcription.AbstractRestClient
toClient
inheritance for several client classes.