pub struct RealtimeSessionBuilder { /* private fields */ }Expand description
Configuration of a realtime session before it connects.
Implementations§
Source§impl RealtimeSessionBuilder
impl RealtimeSessionBuilder
Sourcepub fn client_secret(self, secret: ClientSecret) -> Self
pub fn client_secret(self, secret: ClientSecret) -> Self
Uses an existing client secret instead of creating one through the model.
Sourcepub fn expires_after_seconds(self, seconds: u64) -> Self
pub fn expires_after_seconds(self, seconds: u64) -> Self
Requested lifetime of the client secret created on connect.
Sourcepub fn config(self, config: RealtimeSessionConfig) -> Self
pub fn config(self, config: RealtimeSessionConfig) -> Self
Sets the initial session configuration. Tool definitions derived from
tools are appended to config.tools on connect.
Sourcepub fn instructions(self, instructions: impl Into<String>) -> Self
pub fn instructions(self, instructions: impl Into<String>) -> Self
Sets the system instructions of the session.
Sourcepub fn tools(self, tools: ToolSet) -> Self
pub fn tools(self, tools: ToolSet) -> Self
Local tools. Function and dynamic tools are advertised to the model;
executable ones run inside the session and their outputs are sent
back automatically. Tools without an executor are advertised only;
the application answers them with RealtimeHandle::add_tool_output.
Sourcepub fn tools_context(self, context: JsonValue) -> Self
pub fn tools_context(self, context: JsonValue) -> Self
Context passed to dynamic tool descriptions and executions.
Sourcepub fn cancellation(self, cancellation: CancellationToken) -> Self
pub fn cancellation(self, cancellation: CancellationToken) -> Self
Cancellation token; cancelling it closes the session.
Sourcepub fn event_buffer(self, capacity: usize) -> Self
pub fn event_buffer(self, capacity: usize) -> Self
Capacity of the server event buffer (default 256). Reading from the connection pauses while the buffer is full.