Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔀 refactor: Modularize TTS Logic for Improved Browser support #3657

Merged
merged 7 commits into from
Aug 15, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Aug 15, 2024

Summary

  • Created separate voice dropdown components for different TTS engines (Edge, Browser, and External).
  • Updated the useTextToSpeechBrowser hook to handle errors and improve error logging.
  • Implemented new hooks for different TTS engines: useTTSBrowser, useTTSEdge, and useTTSExternal.
  • Updated the librechat.example.yaml file to correct the voices example.
  • Refactored the VoiceDropdown component to use the new engine-specific voice dropdown components.
  • Improved error handling and logging throughout the TTS-related components and hooks.
  • Updated type definitions and imports for better code organization and maintainability.
  • Added browser support check for Edge TTS engine component with error toast if not supported.

These changes ensure that engine-specific API calls and settings are never initialized unless they are explicitly selected by the user, which helps prevent incompatibility issues as well as avoids resource usage for engines that are never used.

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@danny-avila danny-avila merged commit dba7040 into main Aug 15, 2024
3 checks passed
@danny-avila danny-avila deleted the refactor/message-audio branch August 15, 2024 15:34
danny-avila added a commit that referenced this pull request Aug 17, 2024
* WIP: message audio refactor

* WIP: use MessageAudio by provider

* fix: Update MessageAudio component to use TTSEndpoints enum

* feat: Update useTextToSpeechBrowser hook to handle errors and improve error logging

* feat: Add voice dropdown components for different TTS engines

* docs: update incorrect `voices` example

changed `voice: ''` to `voices: ['alloy']`

* feat: Add brwoser support check for Edge TTS engine component with error toast if not supported

---------

Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
…avila#3657)

* WIP: message audio refactor

* WIP: use MessageAudio by provider

* fix: Update MessageAudio component to use TTSEndpoints enum

* feat: Update useTextToSpeechBrowser hook to handle errors and improve error logging

* feat: Add voice dropdown components for different TTS engines

* docs: update incorrect `voices` example

changed `voice: ''` to `voices: ['alloy']`

* feat: Add brwoser support check for Edge TTS engine component with error toast if not supported

---------

Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants