Expand description
Network clients for the pipeline: ElevenLabs (text-to-speech, sound effects, user quota, voices, Studio), Anthropic (the publish stage) and Google Translate TTS (gTTS, the free draft voice backend).
Each client speaks the same HTTP the Python SDKs do, so the requests a
Rust run makes can be compared against a Python run’s request for request
(see tools/parity/mockapi.py). Base URLs can be redirected with
XIL_ELEVENLABS_BASE_URL, ANTHROPIC_BASE_URL and XIL_GTTS_BASE_URL.
Modules§
- anthropic
- Anthropic Messages API, as
anthropic.Anthropic().messages.createcalls it. - elevenlabs
- The ElevenLabs endpoints the pipeline calls, shaped as
elevenlabs2.x sends them. - gtts
- Google Translate TTS, driven exactly as
gTTS2.5 drives it.
Enums§
- ApiError
- A failed call, split the way the pipeline’s retry logic needs it.
Functions§
- agent 🔒
- One shared agent: connection reuse, and a generous read timeout for long TTS renders.
- base_
url 🔒 $namewhen set and non-empty, else the default.- call 🔒
- As
call_loggedbut silent —requests(gTTS) logs nothing at INFO. - call_
logged 🔒 - Run a request, logging the response like httpx and turning HTTP errors
into
ApiError. - log_
response 🔒 - httpx logs every response at INFO, and the pipeline’s root logger
passes it to both sinks:
HTTP Request: GET <url> "HTTP/1.1 200 OK". - read_
bytes 🔒 - read_
json 🔒 - send_
json 🔒 - POST a JSON body. The result goes straight into
call_logged, soureq::Errorstays unboxed.