pub struct Client { /* private fields */ }Expand description
The Audacity SDK client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: &Config) -> Result<Self, Error>
pub fn new(config: &Config) -> Result<Self, Error>
Create a new client from an explicit Config.
No client-wide timeout is set: per spec §1 the configured timeout bounds
each converse attempt (including the body read) via a per-request
timeout, and a converse_stream attempt only up to the response
headers — the SSE body read is unbounded so long generations are never
killed mid-stream.
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
Create a client from the environment (AUDACITY_API_KEY, AUDACITY_BASE_URL).
Returns Err(Error::MissingApiKey) if no key is found.
Sourcepub fn converse(&self) -> ConverseBuilder
pub fn converse(&self) -> ConverseBuilder
Start building a converse request.
Sourcepub fn converse_stream(&self) -> ConverseStreamBuilder
pub fn converse_stream(&self) -> ConverseStreamBuilder
Start building a converse_stream request.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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