Interface: OpenAIRealtimeTranscriptionRollover
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:157
When and how a session moves to a new connection before OpenAI's session limit (60 minutes for a Realtime session). Ages are counted from the moment a connection's session update was confirmed.
With server turn detection, a connection older than afterMs opens the
next one at its first end of speech, or at deadlineMs whatever is being
said. Both connections receive the same audio for at least overlapMs; the
old one keeps receiving audio until it is between utterances (or until
hardStopMs, when its buffer is committed), finishes the items it holds and
closes. An utterance both connections transcribed is emitted once: from the
old connection, or from the new one when the old connection's transcription
of it fails, comes back empty or never arrives. The new connection's interim
text for utterances that began while the old one was open is not emitted.
With client commits (turnDetection: null) the switch happens at the first
flush() after afterMs, or with a commit at deadlineMs, and the
connections do not overlap.
Properties
afterMs?
optionalafterMs:number
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:159
Connection age after which the first end of speech opens the next connection.
Default Value
3_300_000 (55 minutes)
approve()?
optionalapprove: (request) =>boolean|Promise<boolean>
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:184
Called before a rollover opens the next connection. Resolve false, or
throw, to refuse it: the session keeps its current connection until
hardStopMs, finishes the items it holds, and closes. An answer that has
not come by hardStopMs counts as a refusal, and a later one opens
nothing. It is a policy check beside the funding: a host that pays for
audio per connection reserves each one, rollovers included, through
StreamingSTTConfig.connectionHooks.authorize, keyed by the connection's
connectionId rather than this numeric index.
Parameters
request
Returns
boolean | Promise<boolean>
deadlineMs?
optionaldeadlineMs:number
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:161
Connection age at which the next connection opens whatever is being said.
Default Value
3_480_000 (58 minutes)
hardStopMs?
optionalhardStopMs:number
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:171
Connection age at which an old connection still in speech is committed and drained, and at which a connection whose rollover was refused, or has not opened its next connection yet, ends the session. Keep it under the provider's 60-minute limit.
Default Value
3_570_000 (59.5 minutes)
matchToleranceMs?
optionalmatchToleranceMs:number
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:173
Slack, in milliseconds, when matching an utterance of the new connection to one of the old.
Default Value
500
overlapMs?
optionaloverlapMs:number
Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:163
Least time both connections receive the same audio.
Default Value
3_000