diff --git a/core/http/endpoints/openai/realtime_client_commit_test.go b/core/http/endpoints/openai/realtime_client_commit_test.go index 272dea2de..85021ab3c 100644 --- a/core/http/endpoints/openai/realtime_client_commit_test.go +++ b/core/http/endpoints/openai/realtime_client_commit_test.go @@ -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. diff --git a/docs/content/features/openai-realtime.md b/docs/content/features/openai-realtime.md index ce44ae92f..290f7e9bf 100644 --- a/docs/content/features/openai-realtime.md +++ b/docs/content/features/openai-realtime.md @@ -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.