pub struct RealtimeSession { /* private fields */ }Expand description
Outbound handle returned by RealtimeSession::run.
Implementations§
Source§impl RealtimeSession
impl RealtimeSession
Sourcepub async fn next_event(&mut self) -> Option<RealtimeEvent>
pub async fn next_event(&mut self) -> Option<RealtimeEvent>
Receive the next vendor-neutral event from the session.
pub fn send_text(&self, text: impl Into<String>) -> Result<(), &'static str>
pub fn send_audio_frame(&self, samples: Vec<i16>) -> Result<(), &'static str>
pub fn commit_audio(&self) -> Result<(), &'static str>
pub fn interrupt(&self) -> Result<(), &'static str>
pub fn update_instructions( &self, instructions: impl Into<String>, ) -> Result<(), &'static str>
pub fn close(&self) -> Result<(), &'static str>
Sourcepub async fn run(
gateway: Box<dyn RealtimeGatewaySession>,
config: RealtimeVoiceConfig,
tool_runner: Arc<dyn ToolRunner>,
tracer: Option<Arc<TracerSystem>>,
correlation_id: String,
) -> Self
pub async fn run( gateway: Box<dyn RealtimeGatewaySession>, config: RealtimeVoiceConfig, tool_runner: Arc<dyn ToolRunner>, tracer: Option<Arc<TracerSystem>>, correlation_id: String, ) -> Self
Spawn a session driver that orchestrates the gateway. Returns
the session handle; the driver task lives until the gateway
session closes or RealtimeSession::close is called.
Auto Trait Implementations§
impl Freeze for RealtimeSession
impl RefUnwindSafe for RealtimeSession
impl Send for RealtimeSession
impl Sync for RealtimeSession
impl Unpin for RealtimeSession
impl UnsafeUnpin for RealtimeSession
impl UnwindSafe for RealtimeSession
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
Mutably borrows from an owned value. Read more