open-agents-ai 0.187.286 → 0.187.287
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/dist/index.js +10 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -328340,7 +328340,7 @@ var VAD_SILENCE_MS, MAX_SEGMENT_MS, MAX_CONTEXT_TURNS, SYSTEM_PROMPT2, MIN_SIGNA
|
|
|
328340
328340
|
var init_voicechat = __esm({
|
|
328341
328341
|
"packages/cli/src/tui/voicechat.ts"() {
|
|
328342
328342
|
"use strict";
|
|
328343
|
-
VAD_SILENCE_MS =
|
|
328343
|
+
VAD_SILENCE_MS = 3e3;
|
|
328344
328344
|
MAX_SEGMENT_MS = 6500;
|
|
328345
328345
|
MAX_CONTEXT_TURNS = 20;
|
|
328346
328346
|
SYSTEM_PROMPT2 = `You are a voice assistant having a live spoken conversation. Keep responses extremely brief — 1-2 sentences max. You're speaking aloud, not writing. Be conversational, direct, and helpful. Don't use markdown or formatting — just natural speech.
|
|
@@ -328403,7 +328403,9 @@ Rules:
|
|
|
328403
328403
|
this.verbose = Boolean(opts.verbose);
|
|
328404
328404
|
this.debugSnr = Boolean(opts.debugSnr);
|
|
328405
328405
|
this.heuristicsEnabled = opts.heuristicsEnabled !== false;
|
|
328406
|
-
|
|
328406
|
+
if (typeof opts.vadSilenceMs === "number" && opts.vadSilenceMs > 0) {
|
|
328407
|
+
this._vadSilenceMs = Math.floor(opts.vadSilenceMs);
|
|
328408
|
+
}
|
|
328407
328409
|
this.onStatus = opts.onStatus ?? (() => {
|
|
328408
328410
|
});
|
|
328409
328411
|
this.onUserSpeech = opts.onUserSpeech ?? (() => {
|
|
@@ -328556,15 +328558,12 @@ Rules:
|
|
|
328556
328558
|
this.emit("snr", { score: this.lastSignalScore });
|
|
328557
328559
|
this.onPartialTranscript(text);
|
|
328558
328560
|
if (this.silenceTimer) clearTimeout(this.silenceTimer);
|
|
328559
|
-
|
|
328560
|
-
|
|
328561
|
-
|
|
328562
|
-
|
|
328563
|
-
|
|
328564
|
-
|
|
328565
|
-
}
|
|
328566
|
-
}, VAD_SILENCE_MS);
|
|
328567
|
-
}
|
|
328561
|
+
const waitMs = this._vadSilenceMs ?? VAD_SILENCE_MS;
|
|
328562
|
+
this.silenceTimer = setTimeout(() => {
|
|
328563
|
+
if (this._state === "CAPTURING") {
|
|
328564
|
+
this.finalizeSegment();
|
|
328565
|
+
}
|
|
328566
|
+
}, waitMs);
|
|
328568
328567
|
}
|
|
328569
328568
|
// ---------------------------------------------------------------------------
|
|
328570
328569
|
// Segment finalization → Transcribing → Thinking → Speaking
|
package/package.json
CHANGED