-
Notifications
You must be signed in to change notification settings - Fork 32
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
Implements Analyze Client #217
Implements Analyze Client #217
Conversation
WalkthroughThe recent updates focus on enhancing the Deepgram SDK's functionality and organization. Key improvements include the introduction of the Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 8
Configuration used: CodeRabbit UI
Files selected for processing (47)
- Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs (1 hunks)
- Deepgram/AnalyzeClient.cs (1 hunks)
- Deepgram/Constants/UriSegments.cs (1 hunks)
- Deepgram/Logger/Log.cs (1 hunks)
- Deepgram/ManageClient.cs (1 hunks)
- Deepgram/Models/Analyze/v1/AnalyzeSchema.cs (1 hunks)
- Deepgram/Models/Analyze/v1/AsyncResponse.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Average.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Intent.cs (1 hunks)
- Deepgram/Models/Analyze/v1/IntentGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/IntentsInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Metadata.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Results.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Segment.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SentimentGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SentimentInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Summary.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SummaryInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SyncResponse.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Topic.cs (1 hunks)
- Deepgram/Models/Analyze/v1/TopicGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/TopicsInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/UrlSource.cs (1 hunks)
- Deepgram/Models/Live/v1/Average.cs (1 hunks)
- Deepgram/Models/Live/v1/SpeechStartedResponse.cs (1 hunks)
- Deepgram/Models/Live/v1/UtteranceEndResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/InviteSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/KeySchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/KeysResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/Member.cs (1 hunks)
- Deepgram/Models/Manage/v1/MemberScopeSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/ProjectSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/ProjectsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageFieldsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageRequestsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageRequestsSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageSummaryResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageSummarySchema.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/AsyncResponse.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Average.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/IntentGroup.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/IntentSchema.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Metadata.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Segment.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/SentimentGroup.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/SentimentInfo.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Topic.cs (1 hunks)
Files skipped from review due to trivial changes (8)
- Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs
- Deepgram/Models/Analyze/v1/Topic.cs
- Deepgram/Models/Manage/v1/Member.cs
- Deepgram/Models/Manage/v1/ProjectSchema.cs
- Deepgram/Models/Manage/v1/ProjectsResponse.cs
- Deepgram/Models/Manage/v1/UsageFieldsResponse.cs
- Deepgram/Models/Manage/v1/UsageRequestsResponse.cs
- Deepgram/Models/Manage/v1/UsageSummarySchema.cs
Additional comments: 38
Deepgram/Models/Manage/v1/KeysResponse.cs (1)
- 2-2: The code is correct; file-scoped namespaces do not require a semicolon in C# 9.0 and later.
Deepgram/Models/Analyze/v1/Summary.cs (1)
- 3-10: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/PreRecorded/v1/AsyncResponse.cs (1)
- 2-2: The code is correct; file-scoped namespaces do not require a semicolon in C# 9.0 and later.
Deepgram/Models/Analyze/v1/AsyncResponse.cs (1)
- 3-11: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Live/v1/Average.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/PreRecorded/v1/Average.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/PreRecorded/v1/IntentGroup.cs (1)
- 10-10: The change from
IntentSegment
toSegment
aligns with the provided context indicating a functionality change.Deepgram/Models/PreRecorded/v1/SentimentGroup.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/IntentGroup.cs (1)
- 3-11: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/PreRecorded/v1/Topic.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/SyncResponse.cs (1)
- 3-16: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/PreRecorded/v1/SentimentInfo.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/SummaryInfo.cs (1)
- 3-22: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Live/v1/SpeechStartedResponse.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Live/v1/UtteranceEndResponse.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/TopicsInfo.cs (1)
- 3-23: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/IntentsInfo.cs (1)
- 3-23: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Analyze/v1/Intent.cs (1)
- 3-16: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Manage/v1/UsageSummaryResponse.cs (1)
- 2-2: The code is correct; file-scoped namespaces do not require a semicolon in C# 9.0 and later.
Deepgram/Models/Analyze/v1/Results.cs (1)
- 3-28: The code is correct and follows best practices for record declarations in C#.
Deepgram/Constants/UriSegments.cs (1)
- 18-18: The addition of the
ANALYZE
constant aligns with the introduction of the Analyze Client.Deepgram/Models/PreRecorded/v1/Segment.cs (1)
- 3-3: The code is correct and follows best practices for record declarations in C#.
Deepgram/Models/Manage/v1/KeySchema.cs (1)
- 1-2: The code is correct and follows best practices for class declarations in C#.
Deepgram/Models/PreRecorded/v1/IntentSchema.cs (1)
- 2-2: The code is correct; file-scoped namespaces do not require a semicolon in C# 9.0 and later.
Deepgram/Models/Manage/v1/UsageRequestsSchema.cs (1)
- 2-2: The code is correct; file-scoped namespaces do not require a semicolon in C# 9.0 and later.
Deepgram/ManageClient.cs (13)
- 1-2: The import statements have been updated to reflect the use of versioned namespaces for
Manage
andAuthenticate
modules. Ensure all references within the file are compatible with these versioned namespaces.- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [5-6]
The class documentation and constructor are clear and follow the expected .NET documentation standards.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [9-11]
The method
GetProjects
correctly implements an asynchronous call to retrieve projects. Ensure theUriSegments.PROJECTS
constant is correctly defined and matches the expected API endpoint.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [13-15]
The method
GetProject
uses string interpolation to construct the URL, which is acceptable. However, ensure proper validation ofprojectId
to prevent injection vulnerabilities.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [17-19]
The
UpdateProject
method uses PATCH correctly. EnsureProjectSchema
validation is in place to prevent sending invalid data to the API.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [21-23]
The
DeleteProject
method's comment about no response being expected is clear. Ensure the API contract agrees with this expectation.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [25-27]
The
LeaveProject
method's implementation is consistent with the SDK's design. Confirm that the API supports this endpoint as expected.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [29-31]
In
CreateProjectKey
, validate bothExpirationDate
andTimeToLiveInSeconds
to ensure they are not set simultaneously, as this could lead to confusion or errors.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [33-35]
The
DeleteProjectKey
method correctly performs a deletion without expecting a response. Confirm deletion logic aligns with API expectations.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [37-39]
The
SendProjectInvite
method should validateinviteSchema
to ensure it contains valid data before sending it to the API.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [41-43]
The
GetProjectUsageRequests
method constructs query parameters from a schema object. Ensure thatQueryParameterUtil.GetParameters
properly encodes parameters to prevent URL manipulation.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [45-47]
The
GetProjectUsageSummary
andGetProjectUsageFields
methods share similar logic for constructing query strings. Confirm that the encoding and concatenation logic is secure and free from injection vulnerabilities.
- 1-4: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [49-51]
The
GetProjectBalances
andGetProjectBalance
methods are implemented correctly. Verify that balance IDs are validated or sanitized before use in the URL path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (47)
- Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs (1 hunks)
- Deepgram/AnalyzeClient.cs (1 hunks)
- Deepgram/Constants/UriSegments.cs (1 hunks)
- Deepgram/Logger/Log.cs (1 hunks)
- Deepgram/ManageClient.cs (1 hunks)
- Deepgram/Models/Analyze/v1/AnalyzeSchema.cs (1 hunks)
- Deepgram/Models/Analyze/v1/AsyncResponse.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Average.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Intent.cs (1 hunks)
- Deepgram/Models/Analyze/v1/IntentGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/IntentsInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Metadata.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Results.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Segment.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SentimentGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SentimentInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Summary.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SummaryInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/SyncResponse.cs (1 hunks)
- Deepgram/Models/Analyze/v1/Topic.cs (1 hunks)
- Deepgram/Models/Analyze/v1/TopicGroup.cs (1 hunks)
- Deepgram/Models/Analyze/v1/TopicsInfo.cs (1 hunks)
- Deepgram/Models/Analyze/v1/UrlSource.cs (1 hunks)
- Deepgram/Models/Live/v1/Average.cs (1 hunks)
- Deepgram/Models/Live/v1/SpeechStartedResponse.cs (1 hunks)
- Deepgram/Models/Live/v1/UtteranceEndResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/InviteSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/KeySchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/KeysResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/Member.cs (1 hunks)
- Deepgram/Models/Manage/v1/MemberScopeSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/ProjectSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/ProjectsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageFieldsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageRequestsResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageRequestsSchema.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageSummaryResponse.cs (1 hunks)
- Deepgram/Models/Manage/v1/UsageSummarySchema.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/AsyncResponse.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Average.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/IntentGroup.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/IntentSchema.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Metadata.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Segment.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/SentimentGroup.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/SentimentInfo.cs (1 hunks)
- Deepgram/Models/PreRecorded/v1/Topic.cs (1 hunks)
Files skipped from review as they are similar to previous changes (47)
- Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs
- Deepgram/AnalyzeClient.cs
- Deepgram/Constants/UriSegments.cs
- Deepgram/Logger/Log.cs
- Deepgram/ManageClient.cs
- Deepgram/Models/Analyze/v1/AnalyzeSchema.cs
- Deepgram/Models/Analyze/v1/AsyncResponse.cs
- Deepgram/Models/Analyze/v1/Average.cs
- Deepgram/Models/Analyze/v1/Intent.cs
- Deepgram/Models/Analyze/v1/IntentGroup.cs
- Deepgram/Models/Analyze/v1/IntentsInfo.cs
- Deepgram/Models/Analyze/v1/Metadata.cs
- Deepgram/Models/Analyze/v1/Results.cs
- Deepgram/Models/Analyze/v1/Segment.cs
- Deepgram/Models/Analyze/v1/SentimentGroup.cs
- Deepgram/Models/Analyze/v1/SentimentInfo.cs
- Deepgram/Models/Analyze/v1/Summary.cs
- Deepgram/Models/Analyze/v1/SummaryInfo.cs
- Deepgram/Models/Analyze/v1/SyncResponse.cs
- Deepgram/Models/Analyze/v1/Topic.cs
- Deepgram/Models/Analyze/v1/TopicGroup.cs
- Deepgram/Models/Analyze/v1/TopicsInfo.cs
- Deepgram/Models/Analyze/v1/UrlSource.cs
- Deepgram/Models/Live/v1/Average.cs
- Deepgram/Models/Live/v1/SpeechStartedResponse.cs
- Deepgram/Models/Live/v1/UtteranceEndResponse.cs
- Deepgram/Models/Manage/v1/InviteSchema.cs
- Deepgram/Models/Manage/v1/KeySchema.cs
- Deepgram/Models/Manage/v1/KeysResponse.cs
- Deepgram/Models/Manage/v1/Member.cs
- Deepgram/Models/Manage/v1/MemberScopeSchema.cs
- Deepgram/Models/Manage/v1/ProjectSchema.cs
- Deepgram/Models/Manage/v1/ProjectsResponse.cs
- Deepgram/Models/Manage/v1/UsageFieldsResponse.cs
- Deepgram/Models/Manage/v1/UsageRequestsResponse.cs
- Deepgram/Models/Manage/v1/UsageRequestsSchema.cs
- Deepgram/Models/Manage/v1/UsageSummaryResponse.cs
- Deepgram/Models/Manage/v1/UsageSummarySchema.cs
- Deepgram/Models/PreRecorded/v1/AsyncResponse.cs
- Deepgram/Models/PreRecorded/v1/Average.cs
- Deepgram/Models/PreRecorded/v1/IntentGroup.cs
- Deepgram/Models/PreRecorded/v1/IntentSchema.cs
- Deepgram/Models/PreRecorded/v1/Metadata.cs
- Deepgram/Models/PreRecorded/v1/Segment.cs
- Deepgram/Models/PreRecorded/v1/SentimentGroup.cs
- Deepgram/Models/PreRecorded/v1/SentimentInfo.cs
- Deepgram/Models/PreRecorded/v1/Topic.cs
Addresses Issues: #158, #157, #156, #155
This implements Analyze Client using PreRecorded Client as a template. This should be working... just need the unit tests and examples to make sure they do.
TODOs:
will add unit tests and examples in subsequent PRs
Summary by CodeRabbit
New Features
ReadClient
class for interacting with Read API's, including transcription from URLs, byte arrays, streams, and support for callback URLs for asynchronous tasks.AnalyzeSchema
class with extensive properties for transcription customization.AsyncResponse
,Average
,Intent
,IntentGroup
,IntentsInfo
,Metadata
,Results
,Segment
,SentimentGroup
,SentimentInfo
,Summary
,SummaryInfo
,SyncResponse
,Topic
,TopicGroup
,TopicsInfo
, andUrlSource
classes in theAnalyze
module.Live
andManage
modules with new records and schema updates for better data handling and response structures.Refactor
Live
andPreRecorded
modules.Bug Fixes
Manage
module classes to ensure code integrity and proper compilation.