pub struct RealtimeConfig {Show 15 fields
pub model: Option<String>,
pub instruction: Option<String>,
pub voice: Option<String>,
pub modalities: Option<Vec<String>>,
pub input_audio_format: Option<AudioEncoding>,
pub output_audio_format: Option<AudioEncoding>,
pub turn_detection: Option<VadConfig>,
pub tools: Option<Vec<ToolDefinition>>,
pub tool_choice: Option<String>,
pub input_audio_transcription: Option<TranscriptionConfig>,
pub temperature: Option<f32>,
pub max_response_output_tokens: Option<u32>,
pub cached_content: Option<String>,
pub interruption_detection: Option<InterruptionDetection>,
pub extra: Option<Value>,
}Expand description
Configuration for a realtime session.
Fields§
§model: Option<String>Model to use (provider-specific).
instruction: Option<String>System instruction for the agent.
voice: Option<String>Voice to use for audio output.
modalities: Option<Vec<String>>Output modalities: [“text”], [“audio”], or [“text”, “audio”].
input_audio_format: Option<AudioEncoding>Input audio format.
output_audio_format: Option<AudioEncoding>Output audio format.
turn_detection: Option<VadConfig>VAD configuration.
tools: Option<Vec<ToolDefinition>>Available tools/functions.
tool_choice: Option<String>Tool selection mode: “auto”, “none”, “required”.
input_audio_transcription: Option<TranscriptionConfig>Whether to include input audio transcription.
temperature: Option<f32>Temperature for response generation.
max_response_output_tokens: Option<u32>Maximum output tokens.
cached_content: Option<String>Cached content resource name (e.g. cachedContents/1234).
interruption_detection: Option<InterruptionDetection>Interruption detection mode for voice sessions.
Controls whether the session automatically detects user speech to
cancel agent audio output, or relies on explicit API calls.
Defaults to Manual when None.
extra: Option<Value>Provider-specific options.
Implementations§
Source§impl RealtimeConfig
impl RealtimeConfig
Sourcepub fn builder() -> RealtimeConfigBuilder
pub fn builder() -> RealtimeConfigBuilder
Create a builder for RealtimeConfig.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model.
Sourcepub fn with_instruction(self, instruction: impl Into<String>) -> Self
pub fn with_instruction(self, instruction: impl Into<String>) -> Self
Set the system instruction.
Sourcepub fn with_voice(self, voice: impl Into<String>) -> Self
pub fn with_voice(self, voice: impl Into<String>) -> Self
Set the voice.
Sourcepub fn with_modalities(self, modalities: Vec<String>) -> Self
pub fn with_modalities(self, modalities: Vec<String>) -> Self
Set output modalities.
Sourcepub fn with_text_and_audio(self) -> Self
pub fn with_text_and_audio(self) -> Self
Enable text and audio output.
Sourcepub fn with_audio_only(self) -> Self
pub fn with_audio_only(self) -> Self
Enable audio-only output.
Sourcepub fn with_server_vad(self) -> Self
pub fn with_server_vad(self) -> Self
Enable server-side VAD with default settings.
Sourcepub fn without_vad(self) -> Self
pub fn without_vad(self) -> Self
Disable VAD (manual turn management).
Sourcepub fn with_tool(self, tool: ToolDefinition) -> Self
pub fn with_tool(self, tool: ToolDefinition) -> Self
Add a tool definition.
Sourcepub fn with_tools(self, tools: Vec<ToolDefinition>) -> Self
pub fn with_tools(self, tools: Vec<ToolDefinition>) -> Self
Set multiple tools.
Sourcepub fn with_transcription(self) -> Self
pub fn with_transcription(self) -> Self
Enable input audio transcription.
Sourcepub fn with_temperature(self, temp: f32) -> Self
pub fn with_temperature(self, temp: f32) -> Self
Set temperature.
Sourcepub fn with_cached_content(self, content: impl Into<String>) -> Self
pub fn with_cached_content(self, content: impl Into<String>) -> Self
Set cached content resource.
Sourcepub fn with_interruption_detection(self, mode: InterruptionDetection) -> Self
pub fn with_interruption_detection(self, mode: InterruptionDetection) -> Self
Set the interruption detection mode.
See InterruptionDetection for details on each variant.
Sourcepub fn with_automatic_interruption(self) -> Self
pub fn with_automatic_interruption(self) -> Self
Enable automatic interruption detection.
The session will detect user speech onset and cancel the current agent audio output automatically.
Trait Implementations§
Source§impl Clone for RealtimeConfig
impl Clone for RealtimeConfig
Source§fn clone(&self) -> RealtimeConfig
fn clone(&self) -> RealtimeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more