Optional parent: SpeechHandleOptional Readonly parentStatic SPEECH_Priority for important messages that should be played before others.
Static SPEECH_Priority for messages that should be played after all other messages in the queue
Static SPEECH_Every speech generates by the VoiceAgent defaults to this priority.
Allow or disallow interruptions on this SpeechHandle.
When set to false, the SpeechHandle will no longer accept any incoming interruption requests until re-enabled. If the handle is already interrupted, clearing interruptions is not allowed.
true to allow interruptions, false to disallow
Error If attempting to disable interruptions when already interrupted
Interrupt the current speech generation.
The same speech handle that was interrupted.
Error If this speech handle is still running and does not allow interruptions.
Makes the SpeechHandle awaitable: await handle resolves to the handle
itself once its playout has finished.
Implementation note: naively returning this from onFulfilled would
trigger infinite Promise assimilation recursion (the returned thenable
gets unwrapped, calling .then() again, forever). We side-step this by
shadowing .then with undefined on the instance for the duration of
the synchronous Resolve(this) call. The spec-level IsCallable check
reads undefined, fulfills the outer promise with this as a plain
value, and we restore the prototype method immediately after.
Waits for the entire assistant turn to complete playback.
This method waits until the assistant has fully finished speaking, including any finalization steps beyond initial response generation. This is appropriate to call when you want to ensure the speech output has entirely played out, including any tool calls and response follow-ups.
SpeechHandleCircularWaitError if called on the SpeechHandle
that owns the currently-running function tool — that would be a real
circular wait (the tool is blocked waiting for this handle, and the handle
cannot finish until the tool returns). Awaiting a different handle
scheduled from inside a tool (e.g.
session.generateReply().waitForPlayout()) is safe, because the main
speech-queue loop frees the owning handle's generation slot via
_markGenerationDone() before awaiting tool execution.
Static createOptional options: { Optional allowOptional inputOptional parent?: SpeechHandleOptional step
Controls and observes one agent speech turn.