pub struct RealtimeHandle { /* private fields */ }Expand description
Sends events into a realtime session and closes it.
Handles are cheap to clone and remain valid until the session ends.
Implementations§
Source§impl RealtimeHandle
impl RealtimeHandle
Sourcepub async fn send(&self, event: RealtimeClientEvent) -> Result<(), Error>
pub async fn send(&self, event: RealtimeClientEvent) -> Result<(), Error>
Sends a client event.
§Errors
Fails when the model cannot serialize the event or the session is closed.
Sourcepub async fn add_tool_output(
&self,
call_id: &str,
output: &JsonValue,
) -> Result<(), Error>
pub async fn add_tool_output( &self, call_id: &str, output: &JsonValue, ) -> Result<(), Error>
Submits the output of a tool call. A follow-up response is requested once every tool call of the response has an output.
§Errors
See RealtimeHandle::send.
Sourcepub async fn request_response(&self) -> Result<(), Error>
pub async fn request_response(&self) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for RealtimeHandle
impl Clone for RealtimeHandle
Source§fn clone(&self) -> RealtimeHandle
fn clone(&self) -> RealtimeHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RealtimeHandle
impl !UnwindSafe for RealtimeHandle
impl Freeze for RealtimeHandle
impl Send for RealtimeHandle
impl Sync for RealtimeHandle
impl Unpin for RealtimeHandle
impl UnsafeUnpin for RealtimeHandle
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