BetaLive Class

Connect to GPT Live through client.beta.voice_agents.live.

Foundry starts the session from the saved agent settings. Wait for session.started before sending commands; do not send session.start.

Constructor

BetaLive(*args: Any, **kwargs: Any)

Methods

connect

Connect to a GPT Live agent when entering the context manager.

connect

Connect to a GPT Live agent when entering the context manager.

connect(*, agent_name: str, agent_version: str | None = None, structured_inputs: Mapping[str, Any] | None = None, store: bool | None = None, connection_url: str | None = None, api_version: str | None = None, credential_scopes: list[str] | None = None, extra_query: Mapping[str, str] | None = None, extra_headers: Mapping[str, str] | None = None, **kwargs: Any) -> BetaLiveConnectionManager

Keyword-Only Parameters

Name Description
agent_name
str

The name of an existing GPT Live agent.

agent_version
str or None

A specific agent version, if needed.

Default value: None
structured_inputs

Values for placeholders in the agent's instructions and greeting.

Default value: None
store
bool or None

Save conversation content and audio. None uses the agent's setting.

Default value: None
connection_url
str or None

A wss URL on the project endpoint's origin, instead of the default route.

Default value: None
api_version
str or None

API version override.

Default value: None
credential_scopes
list[str] or None

Token scope override.

Default value: None
extra_query

Additional handshake query values.

Default value: None
extra_headers

Additional handshake headers.

Default value: None

Returns

Type Description

A Live connection context manager.