Trait SessionWriter
pub trait SessionWriter:
Send
+ Sync
+ 'static {
// Required methods
fn send_audio<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_text<'life0, 'async_trait>(
&'life0 self,
text: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_tool_response<'life0, 'async_trait>(
&'life0 self,
responses: Vec<FunctionResponse>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_client_content<'life0, 'async_trait>(
&'life0 self,
turns: Vec<Content>,
turn_complete: bool,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_video<'life0, 'async_trait>(
&'life0 self,
jpeg_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn update_instruction<'life0, 'async_trait>(
&'life0 self,
instruction: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn signal_activity_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn signal_activity_end<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Write-side of a session — send commands without owning the full handle.
Required Methods§
fn send_audio<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_audio<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send raw PCM16 audio bytes.
fn send_text<'life0, 'async_trait>(
&'life0 self,
text: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_text<'life0, 'async_trait>(
&'life0 self,
text: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send a text message.
fn send_tool_response<'life0, 'async_trait>(
&'life0 self,
responses: Vec<FunctionResponse>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_tool_response<'life0, 'async_trait>(
&'life0 self,
responses: Vec<FunctionResponse>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send tool/function call responses back to the model.
fn send_client_content<'life0, 'async_trait>(
&'life0 self,
turns: Vec<Content>,
turn_complete: bool,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_client_content<'life0, 'async_trait>(
&'life0 self,
turns: Vec<Content>,
turn_complete: bool,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send client content (conversation history or context).
fn send_video<'life0, 'async_trait>(
&'life0 self,
jpeg_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_video<'life0, 'async_trait>(
&'life0 self,
jpeg_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send a video/image frame (raw JPEG bytes).
fn update_instruction<'life0, 'async_trait>(
&'life0 self,
instruction: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn update_instruction<'life0, 'async_trait>(
&'life0 self,
instruction: String,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Update the system instruction mid-session.
fn signal_activity_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn signal_activity_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Signal that user speech activity has started.
fn signal_activity_end<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn signal_activity_end<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Signal that user speech activity has ended.
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gracefully disconnect the session.