LiveService class

Service for connecting to the Gemini Live API via WebSocket

Constructors

LiveService({required String apiKey, String apiVersion = 'v1beta', void logger(String message)?, WebSocketConnector? connector, Duration setupTimeout = const Duration(seconds: 10), String dartVersionProvider()?})

Properties

apiKey String
final
apiVersion String
final
hashCode int
The hash code for this object.
no setterinherited
logger → void Function(String message)?
Optional logger for WebSocket traffic. When null (default), logging is disabled. Set to print to restore the previous verbose behavior.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect(LiveConnectParameters params) Future<LiveSession>
Establishes a WebSocket connection to the Live API
handleWebSocketDataForTesting(dynamic data, LiveCallbacks callbacks) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

buildSetupMessage(LiveConnectParameters params) LiveClientMessage
dartVersion() String
Returns the current Dart version
validateFunctionResponses(List<FunctionResponse> functionResponses) List<FunctionResponse>
validateRealtimeBlob(Blob blob, {required String expectedPrefix}) → void