diff --git a/core/js/lm-studio.js b/core/js/lm-studio.js index afe4d7c..fd7b969 100644 --- a/core/js/lm-studio.js +++ b/core/js/lm-studio.js @@ -72,6 +72,14 @@ function lmsSend() { openAIMessages.push({ role: "user", content: sQuestion }); openAIMessages.push({ role: "assistant", content: candidate }); localStorage.setItem("openAIMessages", JSON.stringify(openAIMessages)); + + // Check the state of the checkbox and have fun + const checkbox = document.getElementById("autoSpeak"); + if (checkbox.checked) { + speakText(); + const audio = document.getElementById("audioPlayback"); + audio.setAttribute("autoplay", true); + } }) .catch(error => { console.error("Error:", error);