BetaRealtimeConnectionManager Class

Context manager that opens a BetaRealtimeConnection.

Returned by connect; you normally use it as with client.beta.voice_agents.realtime.connect(...) as conn:.

Constructor

BetaRealtimeConnectionManager(*, endpoint: str, credential: TokenCredential, credential_scopes: List[str], api_version: str, agent_name: str, agent_session_id: str | None = None, structured_inputs: Mapping[str, Any] | None = None, connection_url: str | None = None, extra_query: Mapping[str, str] | None = None, extra_headers: Mapping[str, str] | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
endpoint
Required
credential
Required
credential_scopes
Required
api_version
Required
agent_name
Required
agent_session_id
Default value: None
structured_inputs
Default value: None
connection_url
Default value: None
extra_query
Default value: None
extra_headers
Default value: None

Methods

enter

Open the connection.

enter

Open the connection.

enter() -> BetaRealtimeConnection

Returns

Type Description
<xref:azure.ai.projects.BetaRealtimeConnection>

The live realtime connection.

Exceptions

Type Description

If websockets is not installed.

If the computed or supplied WebSocket URL does not use wss://

If the WebSocket upgrade handshake fails (for example, a network error, DNS failure, or a non-101 response from the service).