LiveSession class

Manages asynchronous communication with Gemini model over a WebSocket connection.

Constructors

LiveSession(WebSocketChannel _ws)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the WebSocket connection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
receive() Stream<LiveServerResponse>
Receives messages from the server.
send({Content? input, bool turnComplete = false}) Future<void>
Sends content to the server.
sendAudioRealtime(InlineDataPart audio) Future<void>
Sends audio data to the server in realtime.
sendMediaChunks({required List<InlineDataPart> mediaChunks}) Future<void>
Sends realtime input (media chunks) to the server.
sendMediaStream(Stream<InlineDataPart> mediaChunkStream) Future<void>
Starts streaming media chunks to the server from the provided mediaChunkStream.
sendTextRealtime(String text) Future<void>
Sends text data to the server in realtime.
sendToolResponse(List<FunctionResponse>? functionResponses) Future<void>
Sends tool responses for function calling to the server.
sendVideoRealtime(InlineDataPart video) Future<void>
Sends video data to the server in realtime.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited