Interface: RealtimeModel
Defined in: packages/protocol/src/realtime/model.ts:28
A realtime model that can establish bidirectional streaming connections.
Models are reusable - each call to connect() creates a new connection. Providers implement this interface.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
modelId | readonly | string | Model ID (e.g., "gpt-4o-realtime", "gemini-2.0-flash"). | packages/protocol/src/realtime/model.ts:42 |
provider | readonly | string | Provider ID (e.g., "openai", "google", "elevenlabs"). | packages/protocol/src/realtime/model.ts:37 |
spec | readonly | "1.0" | The realtime model spec version. | packages/protocol/src/realtime/model.ts:32 |
Methods
authenticate()
authenticate(options?: RealtimeAuthenticateOptions): Promise<ClientCredential>;Defined in: packages/protocol/src/realtime/model.ts:57
Create ephemeral credential for client-side connections.
Call server-side where API key is available, pass result to client. Client then uses credential in connect() options.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | RealtimeAuthenticateOptions | Provider-specific options (e.g., agentId for ElevenLabs) |
Returns
Promise<ClientCredential>
connect()
connect(options?: RealtimeConnectOptions): Promise<RealtimeConnection>;Defined in: packages/protocol/src/realtime/model.ts:47
Establish a connection and return a connection instance.
Parameters
| Parameter | Type |
|---|---|
options? | RealtimeConnectOptions |
Returns
Promise<RealtimeConnection>