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 moreSource§impl Debug for SessionConfig
impl Debug for SessionConfig
Source§impl Default for SessionConfig
impl Default for SessionConfig
Source§fn default() -> SessionConfig
fn default() -> SessionConfig
Source§impl<'de> Deserialize<'de> for SessionConfig
impl<'de> Deserialize<'de> for SessionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().