Class Live
Live class encapsulates the logic for connecting to Google's GenAI Live API. Use ConnectAsync(string, LiveConnectConfig, CancellationToken) to establish a websocket connection session.
public class Live
- Inheritance
-
Live
- Inherited Members
Constructors
Live(ApiClient)
public Live(ApiClient apiClient)
Parameters
apiClientApiClient
Methods
ConnectAsync(string, LiveConnectConfig, CancellationToken)
Establishes a websocket connection to the specified model with the given configuration.
public Task<AsyncSession> ConnectAsync(string model, LiveConnectConfig config, CancellationToken cancellationToken = default)
Parameters
modelstringThe name of the model to connect to. For example "gemini-2.0-flash-live-preview-04-09".
configLiveConnectConfigThe parameters for establishing a connection to the model.
cancellationTokenCancellationTokenThe cancellation token to use for the connection.