Interface GeminiLiveTransport
public interface GeminiLiveTransport
The bidirectional live transport that
GeminiLlmConnection drives.
GeminiLlmConnection holds the translation logic; this is the transport beneath it, so
the connection can drive any implementation. The default one delegates to a genai live session.
-
Method Summary
Modifier and TypeMethodDescriptionclose()Closes the transport.Registers the callback for messages the transport yields and a callback for when its receive stream ends.sendClientContent(com.google.genai.types.LiveSendClientContentParameters params) Sends a client-content turn to the transport.sendRealtimeInput(com.google.genai.types.LiveSendRealtimeInputParameters params) Sends realtime input (audio, video, or text) to the transport.sendToolResponse(com.google.genai.types.LiveSendToolResponseParameters params) Sends a tool response to the transport.
-
Method Details
-
sendClientContent
CompletableFuture<Void> sendClientContent(com.google.genai.types.LiveSendClientContentParameters params) Sends a client-content turn to the transport. -
sendRealtimeInput
CompletableFuture<Void> sendRealtimeInput(com.google.genai.types.LiveSendRealtimeInputParameters params) Sends realtime input (audio, video, or text) to the transport. -
sendToolResponse
CompletableFuture<Void> sendToolResponse(com.google.genai.types.LiveSendToolResponseParameters params) Sends a tool response to the transport. -
receive
CompletableFuture<Void> receive(Consumer<com.google.genai.types.LiveServerMessage> onMessage, Runnable onStreamEnd) Registers the callback for messages the transport yields and a callback for when its receive stream ends. An implementation whose stream ends only when the client closes never invokesonStreamEnd; one backed by a finite script invokes it when the script is exhausted, so the run can end. -
close
CompletableFuture<Void> close()Closes the transport.
-