pub struct SessionConfig {
pub modalities: Option<Vec<Modality>>,
pub instructions: Option<String>,
pub voice: Option<Voice>,
pub input_audio_format: Option<AudioFormat>,
pub output_audio_format: Option<AudioFormat>,
pub input_audio_transcription: Option<InputAudioTranscription>,
pub input_audio_noise_reduction: Option<InputAudioNoiseReduction>,
pub turn_detection: Option<TurnDetection>,
pub tools: Option<Vec<RealtimeTool>>,
pub tool_choice: Option<ToolChoice>,
pub temperature: Option<f32>,
pub max_response_output_tokens: Option<MaxTokens>,
}Expand description
Session configuration sent in session.update events.
Fields§
§modalities: Option<Vec<Modality>>Supported modalities for this session.
instructions: Option<String>System instructions for the model.
voice: Option<Voice>Voice for audio output.
input_audio_format: Option<AudioFormat>Format for input audio.
output_audio_format: Option<AudioFormat>Format for output audio.
input_audio_transcription: Option<InputAudioTranscription>Configuration for input audio transcription.
input_audio_noise_reduction: Option<InputAudioNoiseReduction>Noise reduction configuration.
turn_detection: Option<TurnDetection>Turn detection configuration.
tools: Option<Vec<RealtimeTool>>Available tools for function calling.
tool_choice: Option<ToolChoice>How to select tools.
temperature: Option<f32>Sampling temperature (0.6 to 1.2).
max_response_output_tokens: Option<MaxTokens>Maximum tokens in a response.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn with_modalities(self, modalities: Vec<Modality>) -> Self
pub fn with_modalities(self, modalities: Vec<Modality>) -> Self
Set the modalities.
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_instructions(self, instructions: impl Into<String>) -> Self
Set the instructions.
Sourcepub fn with_voice(self, voice: Voice) -> Self
pub fn with_voice(self, voice: Voice) -> Self
Set the voice.
Sourcepub fn with_input_audio_format(self, format: AudioFormat) -> Self
pub fn with_input_audio_format(self, format: AudioFormat) -> Self
Set the input audio format.
Sourcepub fn with_output_audio_format(self, format: AudioFormat) -> Self
pub fn with_output_audio_format(self, format: AudioFormat) -> Self
Set the output audio format.
Sourcepub fn with_transcription(self, config: InputAudioTranscription) -> Self
pub fn with_transcription(self, config: InputAudioTranscription) -> Self
Set the transcription configuration.
Sourcepub fn with_turn_detection(self, config: TurnDetection) -> Self
pub fn with_turn_detection(self, config: TurnDetection) -> Self
Set the turn detection configuration.
Sourcepub fn with_tools(self, tools: Vec<Tool>) -> Self
pub fn with_tools(self, tools: Vec<Tool>) -> Self
Set the available tools.
Accepts Tool from the common module and converts to RealtimeTool.
Sourcepub fn with_realtime_tools(self, tools: Vec<RealtimeTool>) -> Self
pub fn with_realtime_tools(self, tools: Vec<RealtimeTool>) -> Self
Set the available realtime tools directly.
Sourcepub fn with_tool_choice(self, choice: ToolChoice) -> Self
pub fn with_tool_choice(self, choice: ToolChoice) -> Self
Set the tool choice.
Sourcepub fn with_temperature(self, temp: f32) -> Self
pub fn with_temperature(self, temp: f32) -> Self
Set the temperature.
Sourcepub fn with_max_tokens(self, max: MaxTokens) -> Self
pub fn with_max_tokens(self, max: MaxTokens) -> Self
Set the maximum response tokens.
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more