agentgui 1.0.538 → 1.0.539
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/js/client.js +2 -1
- package/static/js/voice.js +2 -3
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -1350,7 +1350,8 @@ class AgentGUIClient {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
1352
|
this.disableControls();
|
|
1353
|
-
const
|
|
1353
|
+
const ttsActive = window.TTSHandler && window.TTSHandler.getAutoSpeak && window.TTSHandler.getAutoSpeak();
|
|
1354
|
+
const savedPrompt = ttsActive ? prompt + '\n\n[Respond optimized for text-to-speech: use short sentences, simple words, and focus on clarity.]' : prompt;
|
|
1354
1355
|
if (this.ui.messageInput) {
|
|
1355
1356
|
this.ui.messageInput.value = '';
|
|
1356
1357
|
this.ui.messageInput.style.height = 'auto';
|
package/static/js/voice.js
CHANGED
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
audioChunkQueue = []; isPlayingChunk = false;
|
|
61
61
|
var cached = ttsAudioCache.get(selectedVoiceId + ':' + text);
|
|
62
62
|
if (cached) { ttsConsecutiveFailures = 0; audioChunkQueue.push(cached); streamDone = true; if (!isPlayingChunk) playNextChunk(); return; }
|
|
63
|
-
var opt = text + ' [Optimize for speech: Keep it short. Use simple words. Use short sentences. Focus on clarity.]';
|
|
64
63
|
function ok() { ttsConsecutiveFailures = 0; }
|
|
65
64
|
function fail() {
|
|
66
65
|
if (++ttsConsecutiveFailures >= TTS_MAX_FAILURES) { ttsDisabledUntilReset = true; speechQueue = []; }
|
|
@@ -68,8 +67,8 @@
|
|
|
68
67
|
if (!ttsDisabledUntilReset) processQueue();
|
|
69
68
|
}
|
|
70
69
|
function stream() {
|
|
71
|
-
if (!streamingSupported) { nonStream(
|
|
72
|
-
fetch(BASE + '/api/tts-stream', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text:
|
|
70
|
+
if (!streamingSupported) { nonStream(text); return; }
|
|
71
|
+
fetch(BASE + '/api/tts-stream', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: text, voiceId: selectedVoiceId }) })
|
|
73
72
|
.then(function(r) {
|
|
74
73
|
if (!r.ok) { streamingSupported = false; throw 0; }
|
|
75
74
|
var reader = r.body.getReader(), buf = new Uint8Array(0);
|