pub struct SessionBuilder { /* private fields */ }Expand description
Builder for an RealtimeSession.
Produced by super::client::RealtimeClient::session. Configure the
session defaults, then SessionBuilder::build opens the WebSocket and
sends the initial session.update.
Implementations§
Source§impl SessionBuilder
impl SessionBuilder
Sourcepub fn instructions(self, instructions: impl Into<String>) -> Self
pub fn instructions(self, instructions: impl Into<String>) -> Self
System instructions guiding the model.
Sourcepub fn turn_detection(self, vad: TurnDetectionType) -> Self
pub fn turn_detection(self, vad: TurnDetectionType) -> Self
VAD strategy (defaults to client-VAD).
Sourcepub fn output_audio_format(self, format: OutputAudioFormat) -> Self
pub fn output_audio_format(self, format: OutputAudioFormat) -> Self
Output audio format (defaults to PCM).
Sourcepub fn auto_search(self, enabled: bool) -> Self
pub fn auto_search(self, enabled: bool) -> Self
Enable/disable the server-side built-in web search.
Sourcepub fn tools(self, tools: Vec<RealtimeTool>) -> Self
pub fn tools(self, tools: Vec<RealtimeTool>) -> Self
Register function tools.
Sourcepub fn session_config(self, config: SessionConfig) -> Self
pub fn session_config(self, config: SessionConfig) -> Self
Override the entire session config.
Sourcepub async fn build(self) -> ZaiResult<RealtimeSession>
pub async fn build(self) -> ZaiResult<RealtimeSession>
Open the WebSocket, send session.update, and spawn the event loop.
Auto Trait Implementations§
impl Freeze for SessionBuilder
impl RefUnwindSafe for SessionBuilder
impl Send for SessionBuilder
impl Sync for SessionBuilder
impl Unpin for SessionBuilder
impl UnsafeUnpin for SessionBuilder
impl UnwindSafe for SessionBuilder
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