pub struct RealtimeSender { /* private fields */ }Expand description
Write half of a realtime session — send audio and control messages.
Implementations§
Source§impl RealtimeSender
impl RealtimeSender
Sourcepub async fn send_audio(&self, base64_pcm: &str) -> Result<()>
pub async fn send_audio(&self, base64_pcm: &str) -> Result<()>
Send a base64-encoded PCM audio chunk.
Sourcepub async fn send_text(&self, text: &str) -> Result<()>
pub async fn send_text(&self, text: &str) -> Result<()>
Send a text message (creates a conversation item and requests a response).
Sourcepub async fn send_function_result(
&self,
call_id: &str,
output: &str,
) -> Result<()>
pub async fn send_function_result( &self, call_id: &str, output: &str, ) -> Result<()>
Send a function/tool call result back to the model.
Sourcepub async fn cancel_response(&self) -> Result<()>
pub async fn cancel_response(&self) -> Result<()>
Cancel the current response (interrupt the model).
Trait Implementations§
impl Send for RealtimeSender
impl Sync for RealtimeSender
Auto Trait Implementations§
impl !Freeze for RealtimeSender
impl !RefUnwindSafe for RealtimeSender
impl Unpin for RealtimeSender
impl UnsafeUnpin for RealtimeSender
impl !UnwindSafe for RealtimeSender
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