Commit Graph

291 Commits

Author SHA1 Message Date
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 a09c1a7a84 Added 'dot-notation': ['error'] to .eslint.cjs (#5042)
* Added 'dot-notation': ['error'], to `.eslint.cjs`

* Ran `eslint --fix` to correct `dot-notation` errors.

* Added `eslint-disable dot-notation` anywhere errors were caused.

* Allowed dot-notation for uppercase properties: 'allowPattern': '[A-Z]\\w*$'

* Check if `rule instanceof CSSStyleRule`
https://github.com/SillyTavern/SillyTavern/pull/5042#discussion_r2711827148

* Fixed `await result.json();` types.

* refactor: update dot-notation usage in CoquiTtsProvider and PresetManager

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-23 00:11:03 +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
Cohee c75df956c5 Refactor ElevenLabs TTS API key handling (#4906)
* Refactor ElevenLabs TTS API key handling #4483

* Remove unused connection button and related event handler from ElevenLabs TTS provider

* Add ElevenLabs STT endpoint
2025-12-20 18:37:59 +02:00
Cohee f26a672811 Omit content type in POST request if no body 2025-12-07 23:26:47 +02:00
Cohee 43f1824309 Fix: TTS speed control binding for chutes 2025-12-01 01:56:19 +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
Cohee ba79e7d94c Fix event handlers in cosyvoice.js
Fixes #4668
2025-10-19 16:50:55 +03:00
Cohee 10ebf09438 Fix control binds in gpt-sovits provider
Fixes #4655
2025-10-15 20:10:26 +03:00
Wolfsblvt d2f3a85742 Fix MiniMax (TTS) pitch on API calls being the wrong range (#4578)
* fix: change MiniMax TTS pitch from float range 0.5-2.0 to integer range -12 to 12

Fixes #4570

* refactor: replace hardcoded defaults with defaultSettings in MiniMaxTtsProvider config

* refactor: restructure TTS settings with min/max ranges and add value clamping, adjust volume range

* fix: flatten MiniMaxTtsProvider settings to use default values from complex field definitions

* Adjust block spacing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-02 21:03:22 +03: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
Yokayo 1e05eac7df Update ru-ru locale (#4522)
* Work on tl

* eslint fix

* Update data-i18n attribute for expand view button

* Add data-i18n to button

---------

Co-authored-by: Yokayo <nonameutubecomm@gmail.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-14 20:57:33 +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
Cohee d407848e0a Substitute macro params in 4o character instructions 2025-08-06 23:36:44 +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
Cohee 9a86f8a6bb NovelAI: Fix TTS preview 2025-07-14 22:26:39 +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
GregW6 1547a53d7c Refactor: Replace Deprecated Code (#4221)
* refactor: ♻️ Replace deprecated code defined within this repository

- Replace ““/public/scripts.js” > `callPopup`” with ““/public/scripts/popup.js” > `callGenericPopup`”.
- Replace ““/public/scripts/tokenizers.js” > `getTokenCount`” with ““/public/scripts/tokenizers.js” > `getTokenCountAsync`”.
- Replace ““/public/scripts/extensions/assets/index.js” > `executeSlashCommands`” with ““/public/scripts/extensions/assets/index.js” > `executeSlashCommandsWithOptions`”.

* refactor: ♻️ Replace deprecated code from standard library

1. Replace set of deprecated `escape` and deprecated `unescape` functions with `encodeURIComponent` and `decodeURIComponent` functions.
2. Replace set of `encodeURIComponent` and deprecated `unescape` functions with a custom `convertTextToBinaryString` function.

* refactor: ♻️ Replace deprecated code imported from external library

All of them is from jQuery.
1. Replace `$(document).ready(() => { ... })` → `jQuery(() => { ... })`.
2. Replace event type direct calls.
    1) Change
        - `$('...').change(function () { ... })` → `$('...').on('change', function () { ... })`.
    2) Click
        - `$('...').click(function () { ... })` → `$('...').on('click', function () { ... })`.
        - `$('...').click()` → `$('...').trigger('click')`.
    3) Focus
        - `$('...').focus(function () { ... })` → `$('...').on('focus', function () { ... })`.
        - `$('...').focus()` → `$('...').trigger('focus')`.
    4) Blur
        - `$('...').blur(function () { ... })` → `$('...').on('blur', function () { ... })`.
    5) Keyup
        - `$('...').keyup(function () { ... })` → `$('...').on('keyup', function () { ... })`.

* refactor(Attachment): ♻️ Merge `convertTextToBinaryString` and `convertTextToBase64`

`convertTextToBase64` function use `Uint8Array.prototype.toBase64` if supported by the Browser and use a combination of `Window.btoa` and `String.fromCharCode` as fallback.

* fix: 🐛 Fix Bind World Info to Character Card

Using the new `Popup` class.

* fix: 🐛 Fix Bind World Info to Character Card

Using the new `Popup` class.

* refactor: 🐛 Refactor and fix Character World Info popup

Add singleton back and some optimization.

-   **🛡️ Singleton Pattern:** Implemented a singleton pattern using the `characterWorldPopup` variable. This prevents multiple instances of the popup from being created, ensuring a clean and predictable UI. If the popup is already open, it will be brought into focus instead of creating a duplicate.
-   **♻️ Improved Readability:** The event handling logic has been extracted into clearly named functions (`handlePrimaryWorldSelect`, `handleExtrasWorldSelect`), making the `Popup` constructor cleaner and the overall code more readable and maintainable.
-   **⚙️ Optimized Performance:** The new implementation caches frequently accessed values and jQuery selectors, reducing redundant DOM lookups and improving performance.

---

* refactor(Chat): ♻️ Modernize chat deletion confirmation

Replaces the deprecated `callPopup` with the modern `callGenericPopup` for the chat deletion confirmation dialog.

* Fix /delchat command

* Remove unused code

* Fix type. Change value to debug log

* Remove value logs

* Remove singleton pattern for openCharacterWorldPopup

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-07-04 19:42:51 +03:00
Vin Astralis a7783b62a8 Add Speed Control to ElevenLabs TTS Provider (#4213)
* add speed

* Adjust speed range

* More granular step

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-29 02:30:24 +03:00
Vin Astralis 363192dd39 feat(elevenlabs): add new models and deprecate old ones (#4212)
* feat(elevenlabs): add new models and deprecate old ones

* feat(elevenlabs): update default model to eleven_turbo_v2_5 and enhance extended settings check
2025-06-28 15:58:09 +03:00
Cohee 579ef1e86c Refactor API key management in extensions 2025-06-26 21:24:51 +03:00
Cohee 40f10d7d38 TTS: Add registerTtsProvider function export 2025-06-20 23:37:36 +03:00
powercaller f302916b57 disabled vertexAI for now (#4168) 2025-06-16 10:26:20 +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
Cohee 022b0d8d62 Fix seed in preview generation 2025-06-12 20:41:24 +03:00
Cohee 81ab2ab953 Fix styles and logic 2025-06-12 20:21:16 +03:00
Cohee 274c7ef82c Add input class 2025-06-12 20:12:17 +03:00
Boof2015 bce6f3eef0 Fix ESLint errors 2025-06-12 01:48:38 -04:00
Boof2015 b9b0d054f9 Update index.js 2025-06-12 00:54:32 -04:00
Boof2015 e2b1e14ee1 Add files via upload 2025-06-12 00:53:40 -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 9bcbe957af Refactor transition durations to use CSS variables 2025-06-07 16:40:30 +03:00
Cohee 1cbc4ac65b Fix HTML syntax errors by @Dakraid
Original commit: https://github.com/SillyTavern/SillyTavern/commit/fd4babab31c420e94df7d355db2d32c478b853c7
2025-05-29 21:38:55 +03:00
Roberts Slisans 8db879d9f2 refresh voices upon checkReady in openai-compatible TTS 2025-05-29 14:40:52 +03:00
Cohee 586ce36167 Merge pull request #3868 from YunZLu/staging
Fix Edge Browser TTS Compatibility
2025-04-19 01:15:14 +03:00
Cohee 352a8c3c97 Fix TTS provider settings
Fixes #3877
2025-04-18 22:03:17 +03:00
YunZLu 41c2dd16f2 fix(eslint): resolve no-trailing-spaces error 2025-04-18 04:12:37 +08:00
YunZLu d7cc70256a cleaned all redundant comments 2025-04-18 03:58:04 +08:00
YunZLu d511875db9 Fix Edge Browser TTS Compatibility
Edge-compatible fallback for empty Web Speech voice lists
2025-04-17 19:46:49 +08:00
Cohee 65a6e428d1 Improve tilde code blocks in message formatting and TTS processing 2025-03-30 13:25:15 +03:00
Cohee 0af4a3ebd7 Fix unfixable lints 2025-03-19 21:10:42 +02:00
Cohee 20cdcc37fc Fix fixable lints 2025-03-19 20:00:33 +02:00