Expand description
Thin reqwest wrapper around the studio API.
Every call goes through ApiClient::check, which:
- emits a structured
tracingevent on success (debug) and failure (warn) so operators can see what the worker is talking to without having to enable wire-level logging in reqwest (completealso logs the upload byte size before the request so the attempted payload size is visible even when it never finishes), and - turns non-2xx responses into an
anyhowerror tagged with the operation name so the existing log shipper messages stay legible.
Structs§
- ApiClient
- Http
Status Error - Typed non-2xx response error so callers can branch on the status
class (e.g. retry 5xx, never retry 4xx) without sniffing message
strings. The rendered message keeps the legacy
<op> failed: <status> — <body>shape existing tests and log consumers expect.
Functions§
- is_
transient_ upload_ error - True when the upload failed for a reason a short retry can fix: a 5xx from the studio or a transport-level error (connect refused, timeout, broken pipe). 4xx contract errors return false.
- mime_
for_ ext - Map a binary output’s file extension to the MIME type sent as the
multipart
completeupload’sContent-Type. Single source of truth: every engine that emits aTaskResultbinary extension (synthetic image →png/webp, sd-cpp →webp, tts →wav, synthetic video →webp, thevideofeature →gif) routes through here, so a new extension can’t silently drift intoapplication/octet-streamand break the studio’s stored content-type.