feat: openai tts 更换模型 #300

This commit is contained in:
Soulter
2025-02-02 19:47:39 +08:00
parent 4611ce15eb
commit d47da241af
2 changed files with 9 additions and 1 deletions

View File

@@ -428,9 +428,17 @@ CONFIG_METADATA_2 = {
"api_key": "",
"api_base": "",
"model": "tts-1",
"openai-tts-voice": "alloy",
"timeout": "20",
},
},
"items": {
"openai-tts-voice": {
"description": "voice",
"type": "string",
"obvious_hint": True,
"hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'",
},
"whisper_hint": {
"description": "本地部署 Whisper 模型须知",
"type": "string",

View File

@@ -15,7 +15,7 @@ class ProviderOpenAITTSAPI(TTSProvider):
) -> None:
super().__init__(provider_config, provider_settings)
self.chosen_api_key = provider_config.get("api_key", "")
self.voice = provider_config.get("voice", "alloy")
self.voice = provider_config.get("openai-tts-voice", "alloy")
self.client = AsyncOpenAI(
api_key=self.chosen_api_key,