LibreChat
LibreChat copied to clipboard
🎤 feat: add custom speech config, browser TTS/STT features, and dynamic speech tab settings
Summary
This PR introduces several key features and improvements related to the speech functionality in LibreChat:
-
Custom Speech Configuration: Added a custom speech configuration option in
librechat.yaml
, allowing the ADMIN to set pre-configured "speech tab" settings - Browser TTS Language Selection: Enabled language selection for text-to-speech (TTS) directly within the browser
- Browser STT Streaming: Implemented streaming for speech-to-text (STT) in the browser
- Dynamic Speech Tab Settings: The speech tab settings now dynamically appear and disappear based on user settings (e.g., browser/external engine dropdown)
-
Refactoring:
- Renamed
endpointSTT
andendpointTTS
toengineSTT
andengineTTS
respectively - Moved the speech API to a subpath
/api/files/speech
- Renamed
Breaking Changes
- The variables
SpeechToText
andTextToSpeech
in the store have been renamed tospeechToText
andtextToSpeech
. If you encounter any issues, please delete LibreChat's cache - The speech section has been moved under the
speech:
Change Type
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update
Testing
External STT/TTS:
- ElevenLabs
- OpenAI
Local STT/TTS:
- Chrome
Test Configuration:
To reproduce the test process, follow these steps:
- Configure the
librechat.yaml
file with appropriate speech settings - Select a TTS language in the browser and verify the speech output
- Test STT streaming functionality in the browser using various input sources
- Verify that the speech tab settings appear or disappear based on the selected user settings
- Ensure all refactored endpoints (
engineSTT
andengineTTS
) function correctly - Confirm the speech API is accessible via the new subpath
/api/files/speech
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.