This commit is contained in:
2025-09-23 20:24:15 +08:00
commit bde8c44874
22 changed files with 846 additions and 0 deletions

20
models/tts/tts.py Normal file
View File

@@ -0,0 +1,20 @@
from typing import Mapping
from dify_plugin.entities.model import AIModelEntity, I18nObject
from dify_plugin.interfaces.model.openai_compatible.tts import OAICompatText2SpeechModel
class OpenAIText2SpeechModel(OAICompatText2SpeechModel):
def get_customizable_model_schema(
self, model: str, credentials: Mapping | dict
) -> AIModelEntity:
entity = super().get_customizable_model_schema(model, credentials)
if "display_name" in credentials and credentials["display_name"] != "":
entity.label = I18nObject(
en_US=credentials["display_name"], zh_Hans=credentials["display_name"]
)
return entity