tts_realtime or
stt_realtime), two parameters control how the connection initialises.
Both work identically across TTS and STT.
For the full protocol lifecycle, including raw WebSocket messages,
browser tokens, multiplexing, and error behavior, see
WebSocket Lifecycle.
send_setup_on_start
Controls whether the setup message is automatically sent when the
context manager is entered. Defaults to True.
Set this to False when you need to send setup manually, for example
when using multiplexing where each request has
its own setup with a unique client_req_id.
wait_for_ready_on_start
Controls whether the client blocks waiting for the server’s ready
message after sending setup. Defaults to False.
When set to False, the ready message is captured lazily during the
normal receive loop. This reduces connection latency since you can
start sending data immediately after setup without waiting for a
round-trip.
When set to True, stream.ready is guaranteed to be populated before
you start sending data, which can be useful if you need
server-provided metadata (like sample rate) before proceeding.
stt_realtime: