Share via


OpenAIRealtimeClientSession.ConnectAsync(CancellationToken) Method

Definition

Connects the WebSocket to the OpenAI Realtime API.

public System.Threading.Tasks.Task ConnectAsync(System.Threading.CancellationToken cancellationToken = default);
member this.ConnectAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ConnectAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests.

Returns

A task representing the asynchronous connect operation.

Exceptions

The session was not created with an owned realtime client.

Applies to