pub trait InterruptionStrategy: Send {
// Required methods
fn should_interrupt(&self) -> bool;
fn append_transcription(&mut self, frame: &Frame);
fn reset(&mut self);
// Provided method
fn append_audio_volume(&mut self, _volume: f32) { ... }
}Expand description
Whether a detected user turn during bot speech should actually interrupt the
bot. Mirrors pipecat’s interruption-strategy family: a turn-start
(UserStartedSpeaking) is proposed by a TurnStartStrategy, and an
interruption strategy is the final gate deciding whether to broadcast a
Frame::Interruption. Pure + synchronous.
Required Methods§
Sourcefn should_interrupt(&self) -> bool
fn should_interrupt(&self) -> bool
Should the accumulated user speech-so-far interrupt the bot? Called when a turn-start is proposed while the bot is speaking.
Sourcefn append_transcription(&mut self, frame: &Frame)
fn append_transcription(&mut self, frame: &Frame)
Feed a transcription frame so word/char-count strategies accumulate.
Provided Methods§
Sourcefn append_audio_volume(&mut self, _volume: f32)
fn append_audio_volume(&mut self, _volume: f32)
Feed an audio frame’s volume so amplitude strategies accumulate.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".