When using a TTS system, punctuation and in particular emojis can sometimes be read and repeated, which disrupts the flow of speech.
This PR addresses the issue by removing unnecessary characters, ensuring a smoother and more coherent TTS experience.
The filtering process retains essential letters, numbers, and punctuation while eliminating unwanted symbols and emojis.
Pull Request Checklist
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests for validating the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Description
I made the following changes in the ResponseMessage.svelte file:
Created a new variable named speakMessage that utilizes a regular expression (regex) to filter the content of the message for the TTS system. The regex is designed to remove unnecessary characters while preserving: Letters (including accented and foreign characters), Numbers and Essential punctuation marks
Applied the speakMessage variable insted of message.content in the toggleSpeakMessage function
Added
Nothing
Changed
New variable speakMessage now stores the filtered content of message.content
speakMessage now is used instead of message.content in the toggleSpeakMessage functon when calling the tts.
Deprecated
Nothing
Removed
Nothing
Fixed
TTS system now does not speak emojis or some special characters
Security
Nothing
Breaking Changes
BREAKING CHANGE: Nothing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/5611
**Author:** [@Simi5599](https://github.com/Simi5599)
**Created:** 9/22/2024
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `main`
---
### 📝 Commits (10+)
- [`bd81fc8`](https://github.com/open-webui/open-webui/commit/bd81fc8bffc27739920986f5bab1dd218e639d85) downgrade authlib to 1.3.1
- [`5fe2795`](https://github.com/open-webui/open-webui/commit/5fe2795db8d6659a3f6192ed70f8e2104506c22c) Merge pull request #5556 from open-webui/dev
- [`9b05fe3`](https://github.com/open-webui/open-webui/commit/9b05fe3c54b1f0388b640b356ea49bcc30536694) Update pyproject.toml
- [`79b5430`](https://github.com/open-webui/open-webui/commit/79b5430a9e729cb18d0123bd0319cffe0d3bad7b) Merge pull request #5546 from itaybar/bugfix/downgrade_authlib
- [`578d52b`](https://github.com/open-webui/open-webui/commit/578d52b89ddbc549127bd7d5b9796835e0443580) Merge pull request #5562 from open-webui/dev
- [`ff8a2da`](https://github.com/open-webui/open-webui/commit/ff8a2da751e4b64441909554965cd51c60f5332a) Merge pull request #5565 from open-webui/dev
- [`f47dffe`](https://github.com/open-webui/open-webui/commit/f47dffe6e11c6fc63f2dc6029c4cb5e458d22fe7) Merge pull request #5576 from open-webui/dev
- [`54d63ec`](https://github.com/open-webui/open-webui/commit/54d63ece6f85d96f8c079dd802c71be6a9518d3e) Merge pull request #5583 from open-webui/dev
- [`6b46316`](https://github.com/open-webui/open-webui/commit/6b463164f4b129e0ce4bdc9008dd661214fe5eb5) Merge pull request #5584 from open-webui/dev
- [`3820ab7`](https://github.com/open-webui/open-webui/commit/3820ab79ff47738e550d71e906ca1da96029ca7e) Improve TTS message preparation by filtering unnecessary characters
### 📊 Changes
**3 files changed** (+9 additions, -4 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/requirements.txt` (+1 -1)
📝 `pyproject.toml` (+1 -1)
📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+7 -2)
</details>
### 📄 Description
When using a TTS system, punctuation and in particular emojis can sometimes be read and repeated, which disrupts the flow of speech.
This PR addresses the issue by removing unnecessary characters, ensuring a smoother and more coherent TTS experience.
The filtering process retains essential letters, numbers, and punctuation while eliminating unwanted symbols and emojis.
# Pull Request Checklist
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests for validating the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
### Description
I made the following changes in the ResponseMessage.svelte file:
- Created a new variable named speakMessage that utilizes a regular expression (regex) to filter the content of the message for the TTS system. The regex is designed to remove unnecessary characters while preserving: Letters (including accented and foreign characters), Numbers and Essential punctuation marks
- Applied the speakMessage variable insted of message.content in the toggleSpeakMessage function
### Added
- Nothing
### Changed
- New variable speakMessage now stores the filtered content of message.content
- speakMessage now is used instead of message.content in the toggleSpeakMessage functon when calling the tts.
### Deprecated
- Nothing
### Removed
- Nothing
### Fixed
- TTS system now does not speak emojis or some special characters
### Security
- Nothing
### Breaking Changes
- **BREAKING CHANGE**: Nothing
---
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/5611
Author: @Simi5599
Created: 9/22/2024
Status: ❌ Closed
Base:
dev← Head:main📝 Commits (10+)
bd81fc8downgrade authlib to 1.3.15fe2795Merge pull request #5556 from open-webui/dev9b05fe3Update pyproject.toml79b5430Merge pull request #5546 from itaybar/bugfix/downgrade_authlib578d52bMerge pull request #5562 from open-webui/devff8a2daMerge pull request #5565 from open-webui/devf47dffeMerge pull request #5576 from open-webui/dev54d63ecMerge pull request #5583 from open-webui/dev6b46316Merge pull request #5584 from open-webui/dev3820ab7Improve TTS message preparation by filtering unnecessary characters📊 Changes
3 files changed (+9 additions, -4 deletions)
View changed files
📝
backend/requirements.txt(+1 -1)📝
pyproject.toml(+1 -1)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+7 -2)📄 Description
When using a TTS system, punctuation and in particular emojis can sometimes be read and repeated, which disrupts the flow of speech.
This PR addresses the issue by removing unnecessary characters, ensuring a smoother and more coherent TTS experience.
The filtering process retains essential letters, numbers, and punctuation while eliminating unwanted symbols and emojis.
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
I made the following changes in the ResponseMessage.svelte file:
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.