RealtimeConnection

Scoped bidirectional GA Realtime connection. Audio capture/playback and media encoding belong to the caller.

Properties

Link copied to clipboard
abstract val events: Flow<RealtimeEvent>

Single-consumer server events. Cancelling collection closes the socket. Service errors remain protocol events.

Functions

Link copied to clipboard
abstract suspend fun close()

Closes the connection. Safe to call more than once.

Link copied to clipboard
abstract suspend fun send(event: RealtimeEvent)

Sends one JSON event. Audio bytes must already be encoded as base64 by the caller.