pub struct RealtimeRunnerBuilder { /* private fields */ }Available on crate feature
realtime only.Expand description
Builder for RealtimeRunner.
Implementations§
Source§impl RealtimeRunnerBuilder
impl RealtimeRunnerBuilder
Sourcepub fn new() -> RealtimeRunnerBuilder
pub fn new() -> RealtimeRunnerBuilder
Create a new builder.
Sourcepub fn model(self, model: Arc<dyn RealtimeModel>) -> RealtimeRunnerBuilder
pub fn model(self, model: Arc<dyn RealtimeModel>) -> RealtimeRunnerBuilder
Set the realtime model.
Sourcepub fn config(self, config: RealtimeConfig) -> RealtimeRunnerBuilder
pub fn config(self, config: RealtimeConfig) -> RealtimeRunnerBuilder
Set the session configuration.
Sourcepub fn runner_config(self, config: RunnerConfig) -> RealtimeRunnerBuilder
pub fn runner_config(self, config: RunnerConfig) -> RealtimeRunnerBuilder
Set the runner configuration.
Sourcepub fn instruction(
self,
instruction: impl Into<String>,
) -> RealtimeRunnerBuilder
pub fn instruction( self, instruction: impl Into<String>, ) -> RealtimeRunnerBuilder
Set the system instruction.
Sourcepub fn voice(self, voice: impl Into<String>) -> RealtimeRunnerBuilder
pub fn voice(self, voice: impl Into<String>) -> RealtimeRunnerBuilder
Set the voice.
Sourcepub fn tool(
self,
definition: ToolDefinition,
handler: impl ToolHandler + 'static,
) -> RealtimeRunnerBuilder
pub fn tool( self, definition: ToolDefinition, handler: impl ToolHandler + 'static, ) -> RealtimeRunnerBuilder
Register a tool with its handler.
Sourcepub fn tool_fn<F>(
self,
definition: ToolDefinition,
handler: F,
) -> RealtimeRunnerBuilder
pub fn tool_fn<F>( self, definition: ToolDefinition, handler: F, ) -> RealtimeRunnerBuilder
Register a tool with a sync function handler.
Sourcepub fn event_handler(
self,
handler: impl EventHandler + 'static,
) -> RealtimeRunnerBuilder
pub fn event_handler( self, handler: impl EventHandler + 'static, ) -> RealtimeRunnerBuilder
Set the event handler.
Sourcepub fn build(self) -> Result<RealtimeRunner, RealtimeError>
pub fn build(self) -> Result<RealtimeRunner, RealtimeError>
Build the runner (does not connect yet).
Trait Implementations§
Source§impl Default for RealtimeRunnerBuilder
impl Default for RealtimeRunnerBuilder
Source§fn default() -> RealtimeRunnerBuilder
fn default() -> RealtimeRunnerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RealtimeRunnerBuilder
impl !RefUnwindSafe for RealtimeRunnerBuilder
impl Send for RealtimeRunnerBuilder
impl Sync for RealtimeRunnerBuilder
impl Unpin for RealtimeRunnerBuilder
impl UnsafeUnpin for RealtimeRunnerBuilder
impl !UnwindSafe for RealtimeRunnerBuilder
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.