Table of Contents

Class Live

Namespace
Google.GenAI
Assembly
Google.GenAI.dll

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

apiClient ApiClient

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

model string

The name of the model to connect to. For example "gemini-2.0-flash-live-preview-04-09".

config LiveConnectConfig

The parameters for establishing a connection to the model.

cancellationToken CancellationToken

The cancellation token to use for the connection.

Returns

Task<AsyncSession>

AsyncSession