Closed davidvonthenen closed 1 month ago
[!WARNING]
Rate limit exceeded
@dvonthenen has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 13 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between a1fd3dcbb0da032436a2a66f6a364dd68f61e3ec and 7973bcbc22823135b2793d9c5d95ee6e51783a52.
The changes involve a comprehensive restructuring of import statements and organization of classes across multiple files in the Deepgram SDK. New entities have been added, existing entities have been reorganized into categorized sections, and several classes have been renamed or removed to streamline the codebase. The modifications focus on improving clarity and maintainability without altering the core functionality of the SDK.
Files | Change Summary |
---|---|
deepgram/__init__.py |
Restructured import statements, added new imports from .client , and reorganized response classes into categorized sections. |
deepgram/client.py |
Significant restructuring of imports, added new response classes, and commented out unused imports. |
deepgram/clients/__init__.py |
Organized imports from various modules into sections like "common," "unique," and "top level." New entities added from .listen and .manage . |
deepgram/clients/analyze/__init__.py |
Restructured imports into distinct groups for better readability. |
deepgram/clients/analyze/client.py |
Added new aliases for response types and reorganized source types for clarity. |
deepgram/clients/analyze/v1/__init__.py |
Organized imports and added new source types and response imports. |
deepgram/clients/analyze/v1/options.py |
Updated AnalyzeOptions class to inherit from BaseResponse , removed certain methods. |
deepgram/clients/analyze/v1/response.py |
Removed several data classes that extended BaseResponse , simplifying the response structure. |
deepgram/clients/common/__init__.py |
Introduced new aliases for various classes, enhancing the organization of imports. |
deepgram/clients/common/v1/__init__.py |
Added new imports from shared, rest, and websocket response modules. |
deepgram/clients/common/v1/rest_response.py |
Introduced new data classes for REST API response handling. |
deepgram/clients/listen/__init__.py |
Reorganized imports into categories for better clarity, moved certain imports to "common" section. |
deepgram/clients/listen/client.py |
Added new source types, updated websocket-related responses, and improved import organization. |
deepgram/clients/manage/__init__.py |
Restructured imports into "top level" and "shared" sections, moving several entities for better organization. |
deepgram/clients/manage/client.py |
Added multiple new response classes related to STT and TTS functionalities. |
deepgram/clients/manage/v1/__init__.py |
Restructured imports into "top level" and "shared" sections. |
deepgram/clients/manage/v1/options.py |
Updated options classes to inherit from BaseResponse , removing item access methods. |
deepgram/clients/manage/v1/response.py |
Significant renaming of classes for clarity and consistency, with the BaseResponse class moved to a common module. |
deepgram/clients/speak/__init__.py |
Restructured imports into sections, added new imports for websocket-related entities. |
deepgram/clients/speak/client.py |
Organized imports, added new source types, and updated response types for clarity. |
deepgram/clients/speak/v1/__init__.py |
Reorganized imports into categories, updated naming conventions for clarity. |
deepgram/clients/speak/v1/rest/__init__.py |
Added new imports for source types and updated import structure for clarity. |
deepgram/clients/speak/v1/rest/options.py |
Updated SpeakRESTOptions class to inherit from BaseResponse , removed item access methods. |
deepgram/clients/speak/v1/rest/response.py |
Removed several response classes, focusing on SpeakRESTResponse and centralizing base response functionality. |
deepgram/clients/speak/v1/websocket/__init__.py |
Reorganized import statements for clarity, moving classes under appropriate comments. |
deepgram/clients/speak/v1/websocket/options.py |
Updated SpeakWSOptions class to inherit from BaseResponse , simplifying the class structure. |
deepgram/clients/speak/v1/websocket/response.py |
Refactored response classes to inherit from BaseResponse , removing item access methods for a streamlined implementation. |
deepgram/clients/listen/v1/rest/options.py
file, specifically renaming an attribute in the PrerecordedOptions
class, which relates to the restructuring of imports and organization of response classes in the main PR.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?
Units tests pass as well!
Proposed changes
Addresses: https://github.com/deepgram/deepgram-python-sdk/issues/457
This exposes all types/classes in the top-level result results. Users should be able to access any object in a response by name or ref. This explicitly lists the objects and also explicitly state which ones are being used as "common" objects; you can see these as commented out items that are contained in the imports. This is to easily see what is being exported where. Example:
This is backward compatible, and no modification of client code is required. I manually ran each example to ensure the appropriate response.
As a consequence of doing this PR, there was a (much needed) consolidation of the BaseResponse class. This in turn deleted a bunch of code that is now inherited.
Created a test build
3.7.0-dev.2
to verify all types are exposed. This checks out.Types of changes
What types of changes does your code introduce to the community Python SDK? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
NA
Summary by CodeRabbit
New Features
SpeakWSMetadataResponse
to improve WebSocket response handling.Refactor
BaseResponse
for a more consistent response structure.Bug Fixes
Chores