This pull request introduces support for the Deepgram SDK in both the STT (Speech-to-Text) and TTS (Text-to-Speech) services. The changes include adding new provider strategies, updating schemas, and modifying request handling to incorporate the Deepgram SDK.
Introduced sdkStrategies for Deepgram in the TTSService constructor (api/server/services/Files/Audio/TTSService.js).
Implemented deepgramSDKProvider method for generating speech using Deepgram SDK (api/server/services/Files/Audio/TTSService.js).
Updated ttsRequest method to determine and use the appropriate strategy, including SDK support (api/server/services/Files/Audio/TTSService.js).
Schema and Configuration Updates:
Added Deepgram schema definitions for both STT and TTS in config.ts (packages/data-provider/src/config.ts). [1][2]
Updated STTProviders and TTSProviders enums to include Deepgram (packages/data-provider/src/config.ts). [1][2]
Miscellaneous:
Added Deepgram SDK dependency in package.json (package.json).
Updated getVoices function to handle Deepgram TTS provider (api/server/services/Files/Audio/getVoices.js).
Minor UI and code cleanup in HoverButtons.tsx, MessageAudio.tsx, useTTSBrowser.ts, useTTSEdge.ts, and useTTSExternal.ts (client/src/components/Chat/Messages/HoverButtons.tsx, client/src/components/Chat/Messages/MessageAudio.tsx, client/src/hooks/Audio/useTTSBrowser.ts, client/src/hooks/Audio/useTTSEdge.ts, client/src/hooks/Audio/useTTSExternal.ts). [1][2][3][4][5]
Change Type
[x] New feature (non-breaking change which adds functionality)
Checklist
[x] My code adheres to this project's style guidelines
[x] I have performed a self-review of my own code
[x] I have commented in any complex areas of my code
[x] I have made pertinent documentation changes
[x] My changes do not introduce new warnings
[x] I have written tests demonstrating that my changes are effective or that my feature works
[x] Local unit tests pass with my changes
[x] Any changes dependent on mine have been merged and published in downstream modules.
[x] A pull request for updating the documentation has been submitted.
Summary
This pull request introduces support for the Deepgram SDK in both the STT (Speech-to-Text) and TTS (Text-to-Speech) services. The changes include adding new provider strategies, updating schemas, and modifying request handling to incorporate the Deepgram SDK.
Key Changes:
STTService Enhancements:
api/server/services/Files/Audio/STTService.js
).sdkStrategies
for Deepgram in theSTTService
constructor (api/server/services/Files/Audio/STTService.js
).deepgramSDKProvider
method for transcribing audio using Deepgram SDK (api/server/services/Files/Audio/STTService.js
).sttRequest
method to determine and use the appropriate strategy, including SDK support (api/server/services/Files/Audio/STTService.js
).TTSService Enhancements:
api/server/services/Files/Audio/TTSService.js
).sdkStrategies
for Deepgram in theTTSService
constructor (api/server/services/Files/Audio/TTSService.js
).deepgramSDKProvider
method for generating speech using Deepgram SDK (api/server/services/Files/Audio/TTSService.js
).ttsRequest
method to determine and use the appropriate strategy, including SDK support (api/server/services/Files/Audio/TTSService.js
).Schema and Configuration Updates:
config.ts
(packages/data-provider/src/config.ts
). [1] [2]STTProviders
andTTSProviders
enums to include Deepgram (packages/data-provider/src/config.ts
). [1] [2]Miscellaneous:
package.json
(package.json
).getVoices
function to handle Deepgram TTS provider (api/server/services/Files/Audio/getVoices.js
).HoverButtons.tsx
,MessageAudio.tsx
,useTTSBrowser.ts
,useTTSEdge.ts
, anduseTTSExternal.ts
(client/src/components/Chat/Messages/HoverButtons.tsx
,client/src/components/Chat/Messages/MessageAudio.tsx
,client/src/hooks/Audio/useTTSBrowser.ts
,client/src/hooks/Audio/useTTSEdge.ts
,client/src/hooks/Audio/useTTSExternal.ts
). [1] [2] [3] [4] [5]Change Type
Checklist