diff --git a/enjoy/src/main/db/models/conversation.ts b/enjoy/src/main/db/models/conversation.ts index 8574653e..228ad7ac 100644 --- a/enjoy/src/main/db/models/conversation.ts +++ b/enjoy/src/main/db/models/conversation.ts @@ -68,18 +68,23 @@ export class Conversation extends Model { @BeforeSave static validateConfiguration(conversation: Conversation) { - if (!conversation.model) throw new Error(t("models.conversation.modelIsRequired")); - if (conversation.type === 'tts') { + if (conversation.type === "tts") { if (!conversation.configuration.tts) { - throw new Error(t("models.conversation.ttsConfigurationIsRequired")) + throw new Error(t("models.conversation.ttsConfigurationIsRequired")); } if (!conversation.configuration.tts.engine) { - throw new Error(t("models.conversation.ttsEngineIsRequired")) + throw new Error(t("models.conversation.ttsEngineIsRequired")); } if (!conversation.configuration.tts.model) { - throw new Error("models.conversation.ttsModelIsRequired") + throw new Error("models.conversation.ttsModelIsRequired"); } + + conversation.engine = conversation.configuration.tts.engine; + conversation.configuration.model = conversation.configuration.tts.engine; } + + if (!conversation.configuration.model) + throw new Error(t("models.conversation.modelIsRequired")); } @AfterCreate diff --git a/enjoy/src/renderer/pages/conversations.tsx b/enjoy/src/renderer/pages/conversations.tsx index d7cf5039..75f7594c 100644 --- a/enjoy/src/renderer/pages/conversations.tsx +++ b/enjoy/src/renderer/pages/conversations.tsx @@ -49,6 +49,8 @@ export default () => { type: "tts", tts: { engine: currentEngine.name, + model: "tts-1", + voice: "alloy", }, }, }, @@ -152,6 +154,8 @@ export default () => { type: "tts", tts: { engine: currentEngine.name, + model: "tts-1", + voice: "alloy", }, }, };