pub struct SessionConfig {
pub instructions: String,
pub voice: String,
pub tools: Vec<GrokToolDefinition>,
pub temperature: f32,
pub audio_format: AudioFormat,
pub turn_detection: TurnDetection,
}Expand description
Configuration for a Grok Realtime session
Fields§
§instructions: String§voice: String§tools: Vec<GrokToolDefinition>§temperature: f32§audio_format: AudioFormat§turn_detection: TurnDetectionImplementations§
Source§impl SessionConfig
impl SessionConfig
pub fn new(instructions: impl Into<String>) -> Self
pub fn with_voice(self, voice: impl Into<String>) -> Self
pub fn with_tools(self, tools: Vec<GrokToolDefinition>) -> Self
pub fn with_rustic_tools(self, tools: &[ToolDefinition]) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_audio_format( self, format_type: impl Into<String>, rate: Option<u32>, ) -> Self
pub fn with_turn_detection(self, detection: TurnDetection) -> Self
Sourcepub fn to_update_payload(&self) -> SessionUpdatePayload
pub fn to_update_payload(&self) -> SessionUpdatePayload
Convert to session update payload for the API
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionConfig
impl Debug for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnwindSafe for SessionConfig
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