Skip to main content

RealtimeSessionExt

Trait RealtimeSessionExt 

Source
pub trait RealtimeSessionExt: RealtimeSession {
    // Provided methods
    fn send_audio_and_wait<'life0, 'life1, 'async_trait>(
        &'life0 self,
        audio: &'life1 AudioChunk,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ServerEvent>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn send_text_and_wait<'life0, 'life1, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ServerEvent>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn collect_audio<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Extension trait for RealtimeSession with convenience methods.

Provided Methods§

Source

fn send_audio_and_wait<'life0, 'life1, 'async_trait>( &'life0 self, audio: &'life1 AudioChunk, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServerEvent>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send audio and wait for the response to complete.

Source

fn send_text_and_wait<'life0, 'life1, 'async_trait>( &'life0 self, text: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServerEvent>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send text and wait for the response to complete.

Source

fn collect_audio<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Collect all audio chunks from a response (as raw bytes).

Implementors§