Closed SandraRodgers closed 2 days ago
The recent enhancements to the Deepgram codebase involve the introduction of new classes for handling real-time speech synthesis via WebSockets. This includes the addition of SpeakStreamClient
and AsyncSpeakStreamClient
to enable synchronous and asynchronous interactions, respectively, along with event handling for various TTS synthesis events. Several new files and imports have been introduced to support these capabilities, and there are significant improvements to event handling logic in the asynchronous client.
File/Module | Change Summary |
---|---|
deepgram/__init__.py |
Added imports for SpeakStreamClient , AsyncSpeakStreamClient , and SpeakStreamEvents . |
deepgram/client.py |
Added SpeakStreamClient , AsyncSpeakStreamClient , SpeakStreamEvents imports; new properties speakstream and asyncspeakstream . Updated the v method to handle new cases. |
deepgram/clients/__init__.py |
Added imports for SpeakStreamEvents , SpeakStreamClient , and AsyncSpeakStreamClient . |
deepgram/clients/live/v1/async_client.py |
Updated event handling logic for adding handlers and optimized task creation and handling during event emission. Enhanced exception handling. |
deepgram/clients/speak/__init__.py |
Added SpeakStreamClient , AsyncSpeakStreamClient exports, and imported SpeakStreamEvents . |
deepgram/clients/speak/client.py |
Updated declarations of SpeakStreamClient and AsyncSpeakStreamClient to latest versions. |
deepgram/clients/speak/enums.py |
New file defining SpeakStreamEvents enumeration. |
deepgram/clients/speak/errors.py |
Updated error message in DeepgramTypeError class. |
deepgram/clients/speak/v1/__init__.py |
Added imports for SpeakStreamClient and AsyncSpeakStreamClient . |
deepgram/clients/speak/v1/async_client_stream.py |
New file introducing AsyncSpeakStreamClient with methods for managing TTS synthesis over WebSockets. |
deepgram/clients/speak/v1/client_stream.py |
New file introducing SpeakStreamClient with methods and attributes for WebSocket-based TTS synthesis. |
deepgram/clients/speak/v1/response.py |
Added new data classes for various response types (OpenResponse , MetadataResponse , FlushedResponse , etc.). |
examples/speak-stream/async-interactive/main.py |
New example for setting up a client to interact with TTS service asynchronously, handling various events and data processing. |
examples/speak-stream/interactive/main.py |
New example for setting up a client to interact with TTS service synchronously, handling several streaming events. |
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?
@coderabbitai review
It looks like the blackformatter doesnt error the unit tests out. Will fix in this in a subsequent PR.
Proposed changes
Summary by CodeRabbit
New Features
SpeakStreamClient
andAsyncSpeakStreamClient
classes.Bug Fixes
AsyncLiveClient
.Documentation
Refactor