Skip to content

tts

tts

TTS evaluation client — httpx + httpx-sse + httpx-ws under the hood.

TTSClient

TTSClient(*, url: str, timeout: float = 30.0)

TTS evaluation client — HTTP batch, streaming, and SSE.

post async

post(
    *, json: dict[str, Any] | None = None, **kwargs: Any
) -> httpx.Response

Batch POST to TTS endpoint. Returns raw httpx.Response.

stream async

stream(
    *, json: dict[str, Any] | None = None, **kwargs: Any
) -> AsyncIterator[httpx.Response]

Chunked streaming POST. Yields httpx.Response for aiter_bytes/aiter_lines.

sse async

sse(
    *, json: dict[str, Any] | None = None, **kwargs: Any
) -> AsyncIterator[EventSource]

SSE streaming POST. Yields EventSource for aiter_sse().

ws async

ws(**kwargs: Any) -> AsyncIterator[AsyncWebSocketSession]

Open WebSocket session for TTS streaming (e.g. WebSocket-based TTS servers).

aclose async

aclose() -> None

No-op — clients are created per-call.