LiveConnection
An open bidirectional (live) connection to a model, obtained from Model.connect.
A connection outlives a single turn: opened once, carrying many turns, closed when the conversation ends.
Send methods are called by one writer at a time, but closeSession must be safe to call while a send is in flight.
Inheritors
Functions
Blocking AutoCloseable bridge to closeSession, for callers outside a coroutine.
Closes the connection; collectors of receive complete normally.
The model's responses for the current turn, completing when the turn ends; collect it again for the next turn. A collection that completes with no response means the connection has ended. Unlike Model.generateContent, where each collection makes its own request, every collection here reads the same open connection, so only one is allowed at a time: implementations reject a concurrent one with IllegalStateException.
Sends user content, which completes the turn and prompts a response unless partial is true.
Seeds the session with prior conversation; Model.connect does not call it, so the caller invokes it at most once, right after connecting and before any other send. The model responds only if the last content is from the user, and otherwise waits for new input.
Sends realtime input: a chunk of media, or a signal marking the edge of user activity.