Closed SandraRodgers closed 2 months ago
The overall changes introduce significant enhancements to the Deepgram SDK for text-to-speech streaming. New constants, error-handling mechanisms, struct types, and response types are added. The updates include default callback handlers, message routing logic, and a refined client streaming interface, thus providing a more robust foundation for implementing voice and text-based processing solutions.
Files | Change Summary |
---|---|
pkg/api/speak/v1/constants.go |
Added error constants ErrInvalidMessageType , ErrUserCallbackNotDefined . |
pkg/api/speak/v1/default.go |
Introduced default callback handler for live transcription, including various event handling functions. |
pkg/api/speak/v1/interfaces/constants.go |
Added message type constants for the text-to-speech streaming API. |
pkg/api/speak/v1/interfaces/interfaces.go |
Defined SpeakMessageCallback interface with methods for handling text-to-speech response types. |
pkg/api/speak/v1/interfaces/types.go |
Added several struct types, including SpeakStreamResponse and different response types. |
pkg/api/speak/v1/router.go |
Introduced MessageRouter struct for handling various message types and routing messages to appropriate callback methods. |
pkg/api/version/constants.go |
Added APITypeSpeakStream and updated APIPathMap to include new API type "speak-stream". |
pkg/api/version/speakstream-version.go |
New file introducing GetSpeakStreamAPI function for managing versioning and customization of the text-to-speech API. |
pkg/client/interfaces/types-speak.go |
Updated SpeakOptions struct to include Callback and CallbackMethod fields. |
pkg/client/speak/constants.go |
Added constants for retry mechanisms, error constants, and a new error related to connection validity. |
pkg/client/speak/client_stream.go |
Enhanced streaming client implementation with functions for websocket connection, retries, event handling, and connection lifecycle management. |
examples/speak/stream/http/main.go |
Renamed Transcription options to TTS options in the main function. |
examples/speak/stream/interactive/main.go |
New file implementing an example for text-to-speech using the Deepgram SDK, with user interaction and callback handling. |
pkg/api/speak-stream/v1/constants.go |
Added error constants for input validation and callback definition in the Deepgram SDK. |
pkg/api/speak-stream/v1/default.go |
Introduced a default callback handler for text-to-speech connections, handling various events with debug logging. |
pkg/api/speak-stream/v1/interfaces/constants.go |
Added message type constants for the text-to-speech streaming API. |
pkg/api/speak-stream/v1/interfaces/interfaces.go |
Defined SpeakMessageCallback interface with methods for handling text-to-speech response types. |
pkg/api/speak-stream/v1/interfaces/types.go |
Added request and response structs for the speech streaming API, including SpeakStreamResponse and various response types. |
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?
Just in case this got lost: https://github.com/deepgram/deepgram-go-sdk/pull/239#pullrequestreview-2128437923
This is ready to go, but we need to merge this PR https://github.com/deepgram/deepgram-go-sdk/pull/245 and cut a release before merging this one.
Hold this for right now, but I think we are in the clear.
I am going to need to port/code some things over from these PRs: https://github.com/deepgram/deepgram-go-sdk/pull/243 and https://github.com/deepgram/deepgram-go-sdk/pull/245
Will do that when tackling this: https://github.com/deepgram/deepgram-go-sdk/issues/241
We should be good for the release then.
Summary by CodeRabbit
New Features
MessageRouter
for handling different message types.Enhancements
SpeakOptions
to includeCallback
andCallbackMethod
.Examples
These changes enhance the text-to-speech functionality, provide better error handling, and introduce examples for easier implementation.