[PR #4886] [MERGED] feat: Add control for how message content is split for TTS generation requests #8376

Closed
opened 2025-11-11 17:52:15 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/4886
Author: @kiosion
Created: 8/25/2024
Status: Merged
Merged: 8/26/2024
Merged by: @tjbck

Base: devHead: dev


📝 Commits (5)

  • f304287 fix: Safely retrieve settings from LocalStorage
  • 3967c34 feat: Add control for how message content is split for TTS generation reqs
  • 73998a7 i18n: Add new strings for en, fr locales
  • d78c35c refac: Tidy Chat.svelte
  • f4f7adb refac

📊 Changes

14 files changed (+426 additions, -238 deletions)

View changed files

📝 backend/apps/audio/main.py (+6 -0)
📝 backend/config.py (+6 -0)
📝 backend/main.py (+1 -0)
📝 src/lib/apis/audio/index.ts (+5 -1)
📝 src/lib/components/admin/Settings/Audio.svelte (+45 -16)
📝 src/lib/components/chat/Chat.svelte (+96 -74)
📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+169 -126)
📝 src/lib/i18n/locales/en-GB/translation.json (+4 -0)
📝 src/lib/i18n/locales/en-US/translation.json (+4 -0)
📝 src/lib/i18n/locales/fr-CA/translation.json (+5 -1)
📝 src/lib/i18n/locales/fr-FR/translation.json (+4 -0)
📝 src/lib/types/index.ts (+6 -0)
📝 src/lib/utils/index.ts (+65 -18)
📝 src/routes/(app)/+layout.svelte (+10 -2)

📄 Description

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?

Changelog Entry

Description

  • Add control for how message content is split up for TTS generation requests. This enables use of OAI's TTS API for larger responses without hitting their RPM limits (especially with tts-1-hd's RPM being just 5). Options are 'punctuation' (current behaviour and default value), 'paragraphs' (split by newlines), and 'none' (send message content as single string).

  • Tidy up Audio admin settings page and ResponseMessage component:

    • Fix some TypeErrors
    • Remove unused vars/imports
    • Use early returns in toggleSpeakMessage to avoid deep cond nesting
    • Properly type usage of i18n from GetContext as Writable<i18next>
  • Add error handling around loading settings from LocalStorage in +layout.svelte to prevent app hanging if key exists but the content can't be parsed (might crop up if running front-end locally, and another project has set the settings key in LocalStorage for localhost previously).

Added

  • Control under Audio settings page for changing how message content is split for TTS generation requests.

Fixed

  • App crash when settings LocalStorage key can't be parsed by JSON.parse on load.

Additional Information

Screenshots or Videos

image


🔄 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/4886 **Author:** [@kiosion](https://github.com/kiosion) **Created:** 8/25/2024 **Status:** ✅ Merged **Merged:** 8/26/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (5) - [`f304287`](https://github.com/open-webui/open-webui/commit/f30428754f2682a760546051308f8d5ecd099353) fix: Safely retrieve settings from LocalStorage - [`3967c34`](https://github.com/open-webui/open-webui/commit/3967c34261d2f8cabbe000403327d4fc6648eaba) feat: Add control for how message content is split for TTS generation reqs - [`73998a7`](https://github.com/open-webui/open-webui/commit/73998a70ccc6aea28a2ef59a5b2072f113fc36eb) i18n: Add new strings for en, fr locales - [`d78c35c`](https://github.com/open-webui/open-webui/commit/d78c35c9baaa3d8dc807570dfd36a8982b7baec2) refac: Tidy Chat.svelte - [`f4f7adb`](https://github.com/open-webui/open-webui/commit/f4f7adb377fe43fda2ba5cad9c2b3b62efe39467) refac ### 📊 Changes **14 files changed** (+426 additions, -238 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/audio/main.py` (+6 -0) 📝 `backend/config.py` (+6 -0) 📝 `backend/main.py` (+1 -0) 📝 `src/lib/apis/audio/index.ts` (+5 -1) 📝 `src/lib/components/admin/Settings/Audio.svelte` (+45 -16) 📝 `src/lib/components/chat/Chat.svelte` (+96 -74) 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+169 -126) 📝 `src/lib/i18n/locales/en-GB/translation.json` (+4 -0) 📝 `src/lib/i18n/locales/en-US/translation.json` (+4 -0) 📝 `src/lib/i18n/locales/fr-CA/translation.json` (+5 -1) 📝 `src/lib/i18n/locales/fr-FR/translation.json` (+4 -0) 📝 `src/lib/types/index.ts` (+6 -0) 📝 `src/lib/utils/index.ts` (+65 -18) 📝 `src/routes/(app)/+layout.svelte` (+10 -2) </details> ### 📄 Description # 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. - [x] 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? - [ ] 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? # Changelog Entry ### Description - Add control for how message content is split up for TTS generation requests. This enables use of OAI's TTS API for larger responses without hitting their RPM limits (especially with `tts-1-hd`'s RPM being just 5). Options are 'punctuation' (current behaviour and default value), 'paragraphs' (split by newlines), and 'none' (send message content as single string). - Tidy up `Audio` admin settings page and `ResponseMessage` component: - Fix some TypeErrors - Remove unused vars/imports - Use early returns in `toggleSpeakMessage` to avoid deep cond nesting - Properly type usage of `i18n` from GetContext as `Writable<i18next>` - Add error handling around loading settings from LocalStorage in `+layout.svelte` to prevent app hanging if key exists but the content can't be parsed (might crop up if running front-end locally, and another project has set the `settings` key in LocalStorage for `localhost` previously). ### Added - Control under Audio settings page for changing how message content is split for TTS generation requests. ### Fixed - App crash when `settings` LocalStorage key can't be parsed by `JSON.parse` on load. --- ### Additional Information - Resolves #4834 ### Screenshots or Videos ![image](https://github.com/user-attachments/assets/2671a608-0e5c-4d36-b2e8-0ab23e2eb1ae) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:52:15 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#8376