Commit Graph

162 Commits

Author SHA1 Message Date
Wolfsblvt f3521e7007 Migrate built-in extensions to use manifest-based activate hooks (#5435)
* Convert jQuery/IIFE wrappers to exported init() functions and register activate hooks in 8 extension manifests

* Convert remaining extensions to exported init() with activate hooks and await initExtensions()

- Convert jQuery/IIFE wrappers to exported init() functions in expressions, memory, quick-reply, regex, stable-diffusion, translate, tts, and vectors extensions

- Register init functions as activate hooks in extension manifests

- Properly await async initExtensions() in firstLoadInit()

* Fix eslint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-09 23:49:55 +03:00
bumprat 94a5773412 refactor(tts): remove redundant 4-space codeblock filter (#5406)
* refactor(tts): remove redundant 4-space codeblock filter

- Deleted the regex that removed lines starting with four spaces.
- Original intent was to strip "indented code blocks" (Markdown legacy syntax).
- In practice, SillyTavern already handles explicit code fences (```...``` and ~~~...~~~).
- Indented code blocks are rarely used and the regex caused unnecessary text loss in normal messages.
- Simplifies codeblock skipping logic and avoids accidental removal of valid content.

* Remove commented out code

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-08 22:11:21 +03:00
Tony Gies 128888f605 Skip TTS for voices explicitly set to disabled (fixes #4970) (#5367)
* Skip TTS for voices explicitly set to disabled (fixes #4970)

* Always show disabled message in commands and fix restoring voice map UI

* Always show a message on manual TTS trigger

* Fix null current job on disabled

* Adjust type annotation

* Force update worker when disabled play is attempted

* Treat audio control queue as manual

* Update TTS message processing to include manual flag

* Don't show toast if was already shown by manual playback

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-05 20:25:26 +03:00
Xiangzhe e4ad489448 feat(tts): emit events and track messageId for third-party integrations (#5309)
* feat(tts): add event signals and messageId tracking for third-party integrations

* feat(tts): move events to core, centralize clone and id tracking

* Apply review suggestions

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-20 00:24:34 +02:00
YKDZ 966ab8336b Merge pull request #5171 from YKDZ/release
i18n: Comprehensive update and refactor for Simplified Chinese (zh-CN)
2026-02-16 21:00:26 +02:00
Cohee 4d1619ba47 Chore: enable brace-style eslint check (#5159)
* eslint: enable brace-style check

* Fix jsdoc and color

* fix: correct CSS color syntax in CreateZenSliders function
2026-02-15 01:46:32 +02:00
Cohee 357da3219b Chore: Add code formatting conventions as eslint rules (#5158)
* Add code formatting conventions as eslint rules

* Improve formatting in addQuickReply
2026-02-15 01:16:34 +02:00
Crush0 eaa6a00e97 Volcengine tts (#5003)
* feat(tts): Add support for Volcengine TTS provider

* refactor: Remove the redundant comments in the Volcengine TTS-related code.

* fix(volcengine): Fix the audio data processing logic in the voice generation interface

* feat(tts): Enhance Volcengine TTS functionality and improve error handling

- Return more detailed error information when generating voice fails
- Add multiple preset voice options and support custom voice management
- Reconstruct the audio stream processing logic to enhance reliability
- Improve the UI interface, adding a voice selection dropdown menu and operation buttons

* refactor(tts): Optimize the code structure and error handling of the Volcengine TTS provider
- Remove the unused "voices" array and "model" parameter
- Improve the text processing logic, eliminating unnecessary separators
- Standardize the error handling logic, simplifying the status code checks
- Fix the DOM operation method, using "createElement" instead of string concatenation
- Ensure the existence check of the "customVoices" array

* Fix: Change the Content-Type of the audio response to audio/mpeg.

* Clean-up

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-26 20:45:38 +02:00
DeclineThyself 8372e7bf9d "gradually replacing property access with a dot operator" (#4965)
* "gradually replacing property access with a dot operator"
https://github.com/SillyTavern/SillyTavern/pull/4963#discussion_r2663003561

(?<=\w|\])\['([a-zA-Z]\w+)'\]
My regex found 593 matches across 47 files.
Also, two typos.

* Fixed chat[0].chat_metadata type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664275854

* Fixed `swipedElementsDiv[0]?.getAnimations().filter((a) => a.animationName` type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664274593

* Fixed config.MESSAGE_SANITIZE and config.MESSAGE_ALLOW_SYSTEM_UI type errors.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664266271

* Fixed group.date_last_chat type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664295652

* Reverted SlashCommandParser dot property access.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664310931

* LLM fixed canUseNegativeLookbehind.result; type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664314288

* Reverted chat-completions.js bodyParams and headers dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664317848
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664320088
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664324438

* Reverted openai.js data dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664326244

* Reverted tests/frontend/MacroEnvBuilder.e2e.js env.dynamicMacros dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664330990

* Partially reverted `window` dot property access.

* Reverted result.json() and settings dot property access.

* Reverted google.js headers dot property access.

* Fixed regex: `(?<=\w|\])\['([a-zA-Z]\w*)'\]`

* Swapped window to globalThis with dot property access.

* LLM fixed canUseNegativeLookbehind type.

* Refactor property access

* Consistency

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-08 23:58:21 +02:00
ZhenyaPav ef89d0f291 Added regex filter option to TTS extension (#4924)
* Add regex filter option to TTS extension

- Added checkbox to enable/disable regex filtering of TTS text
- Added text input for custom regex patterns
- Default pattern removes emojis and non-English text while preserving letters, numbers, spaces, and punctuation
- Regex is applied after asterisk removal and other text processing
- Includes error handling for invalid regex patterns
- Automatically cleans up extra spaces after regex removal

* reverted the accidental change in tts_skip_tags description
clarified the regex description

* Add regex validation warning to TTS settings

* fixed regex field in UI

* reworked the regex warning

* changed the regex event to change (input might not have worked correctly)

* Apply review comments

* Spacing fix

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-31 20:03:04 +02:00
guoql666 efd87b4759 add new Tts adapter provider (#4915)
* add new provider: gpt-sovits-adapter

* export function getCharacters

* fixed some bugs
2025-12-28 23:55:28 +02:00
Ben 55a07d445d Chutes integration (#4844)
* Chutes integration

* Fix eslint

* Fix key saving

* Fix logo coloration

* Fix tool checks

* Unhide image inlining controls

* Fix order of options

* Fix type use in TTS extension script

* Add Chutes as a vector storage source

* Change log levels to debug

* Fix streamed reasoning parsing

* Skip remote models update

* TTS: Fix API key highlight

* Sort image models A-Z

* TTS: Fixes

* Remove unused SD endpoint

* Skip setting context size if models list is not yet loaded

* remove chutes quota / balance

* Fix: streamed tool calling

* Hide reasoning effort control

* Add image request debug log

* Fix: scroll down on media load in extensions

* Unhide some samplers

* Bring back reasoning effort

* This code will never execute

* Reformat else if cases

* Add stop strings to request

* Remove conditional from reasoning_effort body param

* Preserve original pricing fields

* Unhide logit bias setting

* Pass repetition penalty and logit bias to backend

* Swap llama tokenizer for llama3

* Pass min_p, remove supported_sampling_parameters checks

* Enable logprobs

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-01 00:17:49 +02:00
Ngo Dinh Gia Bao 07a4007363 feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Se… (#4528)
* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* Update public/scripts/extensions/tts/electronhub.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update public/scripts/openai.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update public/scripts/openai.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* feat: [Electron Hub] Show model capabilities

* Support logit_bias

* Small tweaks

* Added tokenizer selection logic

* Added tokenizer selection logic

* Fixed ESLint

* Small tweaks

* Split localization tags

* Fix formatting

* Refactor icons, add tool icon

* Support newer oai model tokenizers

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-16 22:22:27 +03:00
Wolfsblvt 862c2b7ba3 Implement robust quote extraction for TTS narration with support for nested quotes (#4502)
* feat: implement robust quote extraction for TTS narration with multi-language support

* refactor: simplify quote matching definition, remove dead code
2025-09-09 22:22:00 +03:00
Ni-co-la-s e71cfee4b8 Add multiple voice per character in TTS extension (#4367)
* Add multiple voice per character in TTS extension

* Reformat settings template

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-08-11 23:11:05 +03:00
Ni-co-la-s 894f3e986e Add gpt-4o-mini-tts model with character voice instructions #3879 (#4352)
* Add gpt-4o-mini-tts model with character voice instructions

* Restyle instructions block

* Add debug log for tts request

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-08-06 21:52:21 +03:00
An5w1r c283025b15 feat: add tts provider MiniMax (#4309)
* feat: add tts provider MiniMax

* fix: address code review feedback from @Cohee1207

- Moved inline styles to CSS classes in minimax.js
- Removed unused MINIMAX API key from secrets.js
- Removed static headers from debug logs
- Changed default API host to international endpoint
- Sorted TTS providers alphabetically in index.js

* feat: improve error handling and add language-specific test sentences based on selected voice

* fix: if no language mapping to MiniMax Format should use "auto"

* fix: move this minimax-tts.css under /public/scripts/extensions/tts/

* refactor: move minimax api communication to Node backend

* chore: unify import style for minimax router

* Move css into subfolder

* More secure secret key handling

* Better UI layout

* Finish secrets update

* Replace with a normal import

* This block shouldn't be here

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-07-27 15:56:26 +03:00
Cohee 4607132576 Pollinations: add as TTS provider 2025-07-14 22:29:30 +03:00
Gness Erquint 9aab4ea648 Non-streaming narrate by paragraphs setting now actually works automatically regardless of streaming-related settings. Resolves #4228. 2025-07-05 08:25:03 +03:00
Cohee 40f10d7d38 TTS: Add registerTtsProvider function export 2025-06-20 23:37:36 +03:00
powercaller 48f18cb74a Feature: Google Native TTS (#4163)
* google native tts impl

* Refactor getting google auth data

* Bring back status json

* Native TTS => Gemini TTS

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-15 16:58:01 +03:00
Boof2015 b9b0d054f9 Update index.js 2025-06-12 00:54:32 -04:00
Cohee 2376e6f4f6 Remove dead button, sort providers 2025-06-11 01:03:46 +03:00
Roberts Slisans 0fc82432ac TTS WebUI provider (#4097)
* initial version

* volume and additional parameters for chatterbox

* add voice fetch

* deduplicate code

* fix eslint

* add all parameters

* use own secret

* remove (Unofficial) tag

* use only client side requests, fix voice discovery

* enable streaming by default

* change openai_compatible to tts_webui in inputs

* remove unused volume helpers

* extract PCM processor

* eslint fix

* remove unused secrets

* Remove obsolete secret IDs

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-11 01:00:58 +03:00
Cohee 65a6e428d1 Improve tilde code blocks in message formatting and TTS processing 2025-03-30 13:25:15 +03:00
Cohee 20cdcc37fc Fix fixable lints 2025-03-19 20:00:33 +02:00
Cohee 594a3720ad Fix TTS 2025-03-18 00:59:04 +02:00
felger e23f3a6314 feature: 'kokoro-js' supports TTS #3412 (#3656)
* feature: 'kokoro-js' supports TTS #3412

* Linting, add credits for kokoro library

* Fix voice preview

* Fix display languages on previews

* Fix settings restoration. Debounce model init on settings change

* Fix engine sorting

* Move TTS processing to a web worker. Remove unused gain setting

* Speaking rate fix

* Update status when recreating a worker

* Pass voices list from TTS engine

* Call dispose function on provider change

* Extend worker init timeout to 10 minutes

---------

Co-authored-by: ryan <1014670860@qq.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-03-10 22:54:54 +02:00
Wolfsblvt 25ffc4ac4a Merge branch 'staging' into support-multiple-expressions 2025-02-01 04:47:48 +01:00
Wolfsblvt 73393a5d5e yoink talkinghead - goodbye extras dependency 2025-01-30 01:44:27 +01:00
Cohee 4f456b2b80 TTS: Call module worker when audio stops playing
#3371
2025-01-28 23:14:26 +02:00
Cohee 6dde068e71 Merge pull request #3371 from fearmear/release
Decrease TTS generation delay by splitting a message on a new line
2025-01-28 23:10:12 +02:00
Cohee 2aa1dd41f5 eslint 2025-01-28 23:07:59 +02:00
Dzmitry Kazlouski 63e7acb87b Make this feature togglable in extensions > "Narrate by paragraphs (when not streaming)" 2025-01-28 05:50:25 +03:00
Small Eggs 145136059e Fix tts.skip_tags's regex to match newlines
The extension_settings.tts.skip_tags setting is meant to skip sending
tags and their content to the TTS API provider. The original regular
expression matched content inside tags with ".*?". Unfortunately,
Javascript's engine does *not* match newlines on the "." without the /s
flag.

The /s flag was added in ES2018. To be more compatible, the regex
has been changed to "[\s\S]+?". This gives similar performance (instead
of using capture groups) and matches all content within a tag, as the
original regex intended.
2025-01-27 17:43:24 -08:00
Dzmitry Kazlouski 283ceb6bbf Decrease TTS generation delay by splitting a message on a new line 2025-01-28 02:51:05 +03:00
Yaroslav Sivakov 52a4c9202d Update public/scripts/extensions/tts/index.js
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2024-11-03 19:57:33 +03:00
Yaroslav Sivakov 8b32ee9e80 Remove embedded images before send text to TTS 2024-11-02 20:25:25 +03:00
Cohee 8cb0fda321 TTS: Add Google Translate TTS 2024-10-12 13:35:11 +03:00
Cohee a5be889852 Extend quote list for TTS 2024-10-05 20:14:07 +03:00
Cohee 00e48097e5 Mark provider unofficial in the list 2024-09-27 20:34:21 +03:00
Cohee 43c3943287 Merge branch 'staging' into GPT-SoVITS-V2 2024-09-27 20:29:22 +03:00
Cohee 84c04f0354 Mark provider unofficial in the list 2024-09-27 20:27:51 +03:00
Cohee d7d204f2ab Merge branch 'staging' into CosyVoice 2024-09-27 20:26:32 +03:00
刘悦 b9ed37f985 Update index.js 2024-09-08 23:00:25 +08:00
刘悦 5281bb9b59 Update index.js 2024-09-08 15:23:48 +08:00
Cohee 8be21fc5c4 Swap RVC function/setting checks 2024-08-26 10:30:17 +03:00
Cohee b7f31cb2ce TTS: Ignore prompt-hidden messages on auto narration 2024-08-22 22:13:57 +03:00
Cohee 1883095e39 Move request to backend 2024-08-13 20:29:33 +03:00
Alex Yancey ab42d6ff82 Quick and dirty attempt at implementing an OpenAI compatible TTS voice provider 2024-08-13 02:07:46 -07:00