UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

30 lines (25 loc) • 1.19 kB
/* oxlint-disable max-classes-per-file -- Both thin facades belong to the same public Live WebRTC entrypoint. */ import type { ConnectClientEvent, ConnectServerEvent as ServerEvent, } from '../../resources/live/sideband/sideband'; import { WebRTCConnection } from '../webrtc/connection'; import { DataChannel } from '../webrtc/data-channel'; export { WebRTCError } from '../webrtc/errors'; export type { WebRTCErrorCode, WebRTCErrorPhase } from '../webrtc/errors'; export type { ExchangeSdp, WebRTCConnectOptions, WebRTCConnectionEvent, WebRTCConfiguration, WebRTCState, } from '../webrtc/types'; /** Fixture playback requires WebSocket; DTMF commands require a SIP sideband. */ type ClientEvent = Exclude< ConnectClientEvent, { type: 'session.output_audio.fixture.play' | 'transport.dtmf.send' } >; /** Browser Live connection with application-owned SDP exchange and typed server-event subscriptions. */ export class OpenAILiveWebRTC extends WebRTCConnection<ClientEvent, ServerEvent> {} /** Typed Live events on a borrowed data channel; dispose() never closes application resources. */ export class LiveDataChannel extends DataChannel<ClientEvent, ServerEvent> {}