mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
test(realtime): sample pending response events
Poll the event count during the held transcription instead of checking\na captured value. Document the client commit and response ordering.
Assisted-by: Codex:gpt-6
Signed-off-by: nexxtmobile.de <kai@nexxtmobile.de>
(cherry picked from commit 034086d3b0)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
1 parent
c27848c8c7
commit
2aa8821876
2 files changed
+8
-1
No files matched your search
@@ -79,7 +79,9 @@ var _ = Describe("realtime client-commit LLM/STT ordering", func() {
|
||||
// With the fix it WAITS for the held STT: no response is created while
|
||||
// the transcription is in flight.
|
||||
session.issueClientResponse(types.ResponseCreateParams{}, conv, tr)
|
||||
Consistently(tr.countEvents(types.ServerEventTypeResponseCreated), 200*time.Millisecond).Should(BeZero())
|
||||
Consistently(func() int {
|
||||
return tr.countEvents(types.ServerEventTypeResponseCreated)
|
||||
}, 200*time.Millisecond).Should(BeZero())
|
||||
|
||||
// Release the STT; the commit appends its user item and the waiting
|
||||
// response now starts on the real transcript.
|
||||
|
||||
@@ -127,6 +127,11 @@ or set it to `true` to enable interruption again.
|
||||
|
||||
### Turn detection
|
||||
|
||||
For client-controlled turns, set `turn_detection` to `null` in `session.update`.
|
||||
After sending audio, send `input_audio_buffer.commit`, followed by `response.create`.
|
||||
If transcription is still running, the response waits for the committed user item before starting the LLM.
|
||||
A standalone `response.create` with no pending client commit starts without this wait.
|
||||
|
||||
Turn detection decides when the user has finished speaking and the pipeline should respond. Two modes are supported, matching the OpenAI session schema:
|
||||
|
||||
- **`server_vad`** (default): silence-based. The VAD model watches the audio and the turn commits after `silence_duration_ms` (default 500 ms) of silence. Simple and model-agnostic, but a fixed silence window must trade interrupting mid-sentence pauses against sluggish responses.
|
||||
|
||||
Reference in new issue
Block a user