pub enum InterruptionDetection {
Manual,
Automatic,
}realtime only.Expand description
Controls how the realtime session handles user interruptions during agent audio output.
When set to Automatic, the session
uses voice activity detection to detect user speech onset and immediately
cancels the current agent audio output, enabling natural conversational
turn-taking.
When set to Manual (the default), the
session relies on explicit API calls (e.g. response.cancel) to signal
that the user is interrupting. This gives the application full control
over interruption behavior.
Variants§
Manual
Rely on explicit API calls to signal interruptions.
The application is responsible for detecting user speech and calling the appropriate cancellation method on the session. No automatic voice activity detection is performed for interruption purposes.
Automatic
Detect user speech onset and cancel the current agent audio output.
The session monitors incoming audio for voice activity. When user speech is detected while the agent is producing audio, the agent’s audio output is automatically cancelled, allowing the user to take the conversational turn.
Trait Implementations§
Source§impl Clone for InterruptionDetection
impl Clone for InterruptionDetection
Source§fn clone(&self) -> InterruptionDetection
fn clone(&self) -> InterruptionDetection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InterruptionDetection
impl Debug for InterruptionDetection
Source§impl Default for InterruptionDetection
impl Default for InterruptionDetection
Source§fn default() -> InterruptionDetection
fn default() -> InterruptionDetection
Source§impl<'de> Deserialize<'de> for InterruptionDetection
impl<'de> Deserialize<'de> for InterruptionDetection
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InterruptionDetection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InterruptionDetection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for InterruptionDetection
impl PartialEq for InterruptionDetection
Source§impl Serialize for InterruptionDetection
impl Serialize for InterruptionDetection
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for InterruptionDetection
impl Eq for InterruptionDetection
impl StructuralPartialEq for InterruptionDetection
Auto Trait Implementations§
impl Freeze for InterruptionDetection
impl RefUnwindSafe for InterruptionDetection
impl Send for InterruptionDetection
impl Sync for InterruptionDetection
impl Unpin for InterruptionDetection
impl UnsafeUnpin for InterruptionDetection
impl UnwindSafe for InterruptionDetection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request