Repository navigation
Conversation
The OpenAI-TTS model and voice were fixed dropdowns, so read-aloud only worked with tts-1/tts-1-hd and the six built-in voices. They are now text fields that keep those values as suggestions, so any OpenAI-compatible speech server behind the configured endpoint works. The request trims both values, and an empty field falls back to the default model or voice. The settings shape is unchanged (both were already plain strings), so saved settings keep working without a migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
In Settings, the OpenAI-TTS Model and Voice are fixed dropdowns (
tts-1/tts-1-hdand six voices). This turns both into text fields that keep the same values as suggestions, so you can use whatever model and voice your speech endpoint supports, including any OpenAI-compatible/v1/audio/speechserver behind the OpenAI endpoint you already set (Custom Endpoint in the browser, orBASE_URLon the server).Why now: OpenAI's deprecations page says
tts-1,tts-1-hdandgpt-4o-mini-tts"will be removed from the API on January 6, 2027". The replacement it lists,gpt-realtime-2.1-mini, runs on the Realtime API and isn't supported on/v1/audio/speech. After that date the OpenAI-TTS engine only works against another OpenAI-compatible server, which has its own model and voice names, and today there's no way to enter them.What changed:
tts-config.tsx: Model and Voice are text inputs with a<datalist>of the current lists. The placeholder shows the default.TTSConfigValidator.model()and.voice()trim the value and fall back totts-1/alloywhen it's empty, and the speech call inchat.tsxruns the saved values through them. The fields themselves store exactly what you type, so they can be cleared and edited normally.ttsConfig.modelandttsConfig.voicewere already plain strings, so saved settings load as before and the store needs no migration.tts-1. Whether to change it is your call. Edge-TTS is untouched.📝 补充信息 | Additional Information
How I checked it:
yarn test:cipasses. I extendedtest/tts-config-validator.test.ts: a custom model and voice come back trimmed, an empty or blank value falls back to the default, and a custom model and voice survive a save and reload of the config store. On main the trim and fallback tests fail (" my-speech-model "comes back as is,""comes back empty).yarn buildandnpx tsc --noEmitpass.next dev, with a small local stub as the OpenAI-compatible server: I set the model tomy-speech-modeland the voice tomy-voice, reloaded (both were still set), and clicked Play on a reply. The stub gotPOST /v1/audio/speechwith{"model":"my-speech-model","input":"…","voice":"my-voice","speed":1}, both through/api/openaiwithBASE_URLpointing at the stub and with Custom Endpoint on. With the model padded with spaces and the voice cleared, it got"model":"my-speech-model"and"voice":"alloy". On main the same run can only choose from the two models and six voices.Unrelated, but you may hit it:
yarn lintstops onapp/constant.tswithCannot read properties of undefined (reading 'loc')fromunused-imports/no-unused-imports. It does the same on main, and this PR doesn't touch that file. With that rule turned off, eslint reports the same warnings as on main and no errors.A server-side default (
DEFAULT_TTS_MODEL/DEFAULT_TTS_VOICEenv vars, likeDEFAULT_MODEL) would fit on top of this. I left it out to keep the change small.