Language

ProjectsRealtimeSessionClient.ConnectAsync Method

Definition

Connects to the Foundry voice-agent endpoint this instance was constructed with. Only the Foundry-specific query string (api-version, merged with any caller-supplied query string -- see queryString -- such as ProjectsRealtimeClient.StartSessionAsync's "store" option) and headers (Foundry-Features, bearer Authorization) are computed here; the WebSocket handshake itself (subprotocol negotiation, applying the headers, connecting, assigning OpenAI.Realtime.RealtimeSessionClient.WebSocket) is entirely delegated to OpenAI.Realtime.RealtimeSessionClient.ConnectAsync(System.String,System.Collections.Generic.IDictionary{System.String,System.String},System.Threading.CancellationToken).

protected override System.Threading.Tasks.Task ConnectAsync(string queryString = default, System.Collections.Generic.IDictionary<string,string> headers = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ConnectAsync : string * System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ConnectAsync : string * System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overrides Function ConnectAsync (Optional queryString As String = Nothing, Optional headers As IDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

queryString
String

An additional query string merged in after api-version.

headers
IDictionary<String,String>

Additional headers to merge with the ones this override computes.

cancellationToken
CancellationToken

Returns

Applies to