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.
Sourcepub fn upload_file(&self) -> UploadFileBuilder
pub fn upload_file(&self) -> UploadFileBuilder
Start building a file upload (spec §6) — for videos too large to send
inline. Returns an UploadFileOutput whose uri can be referenced
in VideoSource::Uri.
Sourcepub fn generate_image(&self) -> GenerateImageBuilder
pub fn generate_image(&self) -> GenerateImageBuilder
Start building an image generation (spec §8) — a text prompt in, generated image(s) out (signed URL or inline base64).