pub struct LiveClient { /* private fields */ }Expand description
Builder for a primary or forked Live WebSocket session.
Implementations§
Source§impl LiveClient
impl LiveClient
Sourcepub fn with_api_key(api_key: impl Into<String>) -> Self
pub fn with_api_key(api_key: impl Into<String>) -> Self
Creates a client using an explicit OpenAI API key.
Sourcepub fn with_auth(auth: AuthProvider) -> Self
pub fn with_auth(auth: AuthProvider) -> Self
Creates a client with an authentication provider.
The Live API currently supports only AuthProvider::OpenAI. Passing
Azure authentication is allowed here so that configuration can be
shared, but connect and fork reject it.
Sourcepub fn instructions(&mut self, instructions: impl Into<String>) -> &mut Self
pub fn instructions(&mut self, instructions: impl Into<String>) -> &mut Self
Sets immutable frontend instructions.
Sourcepub fn audio_format(&mut self, format: LiveAudioFormat) -> &mut Self
pub fn audio_format(&mut self, format: LiveAudioFormat) -> &mut Self
Selects the common input/output audio format.
Sourcepub fn delegation(&mut self, delegation: Delegation) -> &mut Self
pub fn delegation(&mut self, delegation: Delegation) -> &mut Self
Selects the delegation strategy.
Sourcepub fn input(&mut self, input: Vec<Value>) -> &mut Self
pub fn input(&mut self, input: Vec<Value>) -> &mut Self
Supplies initial Responses-style input items.
Sourcepub async fn connect(&self) -> Result<LiveSession>
pub async fn connect(&self) -> Result<LiveSession>
Starts a new primary Live WebSocket session.
Sourcepub async fn fork(&self, session_id: &str) -> Result<LiveSession>
pub async fn fork(&self, session_id: &str) -> Result<LiveSession>
Forks a stored Live session, applying only explicitly configured fields.
Trait Implementations§
Source§impl Clone for LiveClient
impl Clone for LiveClient
Source§impl Debug for LiveClient
impl Debug for LiveClient
Auto Trait Implementations§
impl Freeze for LiveClient
impl RefUnwindSafe for LiveClient
impl Send for LiveClient
impl Sync for LiveClient
impl Unpin for LiveClient
impl UnsafeUnpin for LiveClient
impl UnwindSafe for LiveClient
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