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>
This commit is contained in:
Ni-co-la-s
2025-08-06 18:52:21 +00:00
committed by GitHub
parent c8612e2ab6
commit 894f3e986e
5 changed files with 146 additions and 21 deletions
+2 -2
View File
@@ -476,7 +476,7 @@ async function tts(text, voiceId, char) {
await addAudioJob(response, char);
}
let response = await ttsProvider.generateTts(text, voiceId);
let response = await ttsProvider.generateTts(text, voiceId, char);
// If async generator, process every chunk as it comes in
if (typeof response[Symbol.asyncIterator] === 'function') {
@@ -1007,7 +1007,7 @@ function getCharacters(unrestricted) {
return characters.filter(onlyUnique);
}
function sanitizeId(input) {
export function sanitizeId(input) {
// Remove any non-alphanumeric characters except underscore (_) and hyphen (-)
let sanitized = encodeURIComponent(input).replace(/[^a-zA-Z0-9-_]/g, '');