openai
Version:
The official TypeScript library for the OpenAI API
187 lines • 7.87 kB
TypeScript
import { APIResource } from "../../../core/resource.js";
import * as LiveAPI from "../live.js";
export declare class Sideband extends APIResource {
}
export type SidebandClientEvent = ConnectClientEvent;
export type SidebandServerEvent = ConnectServerEvent;
/**
* Client events accepted by an attached Live sideband WebSocket. The session has
* already started. Send input audio over the primary connection.
*/
export type ConnectClientEvent = LiveAPI.SessionUpdateEvent | LiveAPI.InputAudioMuteEvent | LiveAPI.InputAudioUnmuteEvent | LiveAPI.OutputAudioFixturePlayEvent | ConnectClientEvent.TransportDtmfSend | LiveAPI.InstructionsAppendEvent | LiveAPI.ThinkingAppendEvent | LiveAPI.CommentaryAppendEvent | LiveAPI.DecisionCreateEvent | LiveAPI.DecisionItemCreateEvent | LiveAPI.DecisionItemDeleteEvent | LiveAPI.ResponseItemCreateEvent | LiveAPI.ResponseCreateEvent | LiveAPI.SessionCloseEvent;
export declare namespace ConnectClientEvent {
/**
* Send one DTMF keypress to the SIP trunk through a Live sideband connection. This
* command is supported only for SIP calls. A successful send emits
* `transport.dtmf.sent` on sideband. If you provide `event_id`, the success
* notification includes it as `client_event_id`; a failure includes it as
* `error.client_event_id`. Send separate events for multiple keypresses.
*/
interface TransportDtmfSend {
/**
* The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.
*/
event: string;
type: 'transport.dtmf.send';
/**
* Optional client identifier for correlating this command with a server event's
* client_event_id or error.client_event_id.
*/
event_id?: string | null;
}
}
/**
* Server events received by an attached Live sideband WebSocket, including
* reflected input and output audio and transport notifications.
*/
export type ConnectServerEvent = LiveAPI.SessionStartedEvent | LiveAPI.SessionUpdatedEvent | ConnectServerEvent.SessionResumed | ConnectServerEvent.SessionPaused | LiveAPI.InputAudioMutedEvent | LiveAPI.InputAudioUnmutedEvent | LiveAPI.OutputAudioFixturePlayingEvent | LiveAPI.OutputAudioFixturePlayedEvent | LiveAPI.InstructionsAppendedEvent | LiveAPI.ThinkingAppendedEvent | LiveAPI.CommentaryAppendedEvent | LiveAPI.InputTranscriptDeltaEvent | LiveAPI.OutputTranscriptDeltaEvent | LiveAPI.DelegationCreatedEvent | LiveAPI.DecisionEvent | LiveAPI.DecisionItemCreatedEvent | LiveAPI.DecisionItemDeletedEvent | LiveAPI.ResponseEvent | LiveAPI.SessionUsageUpdatedEvent | LiveAPI.SessionClosedEvent | LiveAPI.ErrorEvent | LiveAPI.InfoEvent | ConnectServerEvent.SessionInputAudioAppend | LiveAPI.OutputAudioDeltaEvent | ConnectServerEvent.TransportDtmfReceived | ConnectServerEvent.TransportDtmfSend | ConnectServerEvent.TransportDtmfSent | ConnectServerEvent.TransportRinging | ConnectServerEvent.TransportAnswered | ConnectServerEvent.TransportFailed;
export declare namespace ConnectServerEvent {
/**
* Sent when speech resumes paused inference and it is ready for audio in a Live
* WebRTC session. Delivered to the sideband and, when permitted by its event
* settings, the data channel.
*/
interface SessionResumed {
/**
* The unique ID of the Live server event.
*/
event_id: string;
type: 'session.resumed';
/**
* The event_id of the client command associated with this server event, when
* supplied.
*/
client_event_id?: string;
}
/**
* Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC
* connection, sideband, and session ID persist. Delivered to the sideband and,
* when permitted by its event settings, the data channel.
*/
interface SessionPaused {
/**
* The unique ID of the Live server event.
*/
event_id: string;
type: 'session.paused';
/**
* The event_id of the client command associated with this server event, when
* supplied.
*/
client_event_id?: string;
}
/**
* Input audio received from the primary transport and reflected to a Live sideband
* connection before model-input muting.
*/
interface SessionInputAudioAppend {
/**
* Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
* reflected to the sideband before model-input muting. This server event uses the
* same audio key as the client command, but is not an acknowledgment of it.
*/
audio: string;
/**
* The event type, always `session.input_audio.append`.
*/
type: 'session.input_audio.append';
}
/**
* A SIP DTMF keypress received from the caller. Delivered only to sideband
* observers.
*/
interface TransportDtmfReceived {
event: string;
event_id: string;
type: 'transport.dtmf.received';
}
/**
* Legacy SIP DTMF delivery notification retained for SDK compatibility and saved
* events. Current servers confirm delivery with transport.dtmf.sent;
* transport.dtmf.send is now the client command.
*/
interface TransportDtmfSend {
event: string;
event_id: string;
type: 'transport.dtmf.send';
/**
* The event_id of the client command, when supplied.
*/
client_event_id?: string;
}
/**
* A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
* sideband observers; this is not a client command.
*/
interface TransportDtmfSent {
event: string;
event_id: string;
type: 'transport.dtmf.sent';
/**
* The event_id of the client command, when supplied.
*/
client_event_id?: string;
}
/**
* The outbound SIP provider leg is ringing or providing early media. Delivered
* only to sideband observers.
*/
interface TransportRinging {
event_id: string;
/**
* The canonical Live session ID.
*/
session_id: string;
type: 'transport.ringing';
}
/**
* The outbound SIP provider leg answered and media is established. Delivered only
* to sideband observers.
*/
interface TransportAnswered {
event_id: string;
/**
* The canonical Live session ID.
*/
session_id: string;
type: 'transport.answered';
}
/**
* An asynchronous outbound SIP setup failure. Delivered only to sideband
* observers.
*/
interface TransportFailed {
error: TransportFailed.Error;
event_id: string;
/**
* The canonical Live session ID.
*/
session_id: string;
type: 'transport.failed';
}
namespace TransportFailed {
interface Error {
/**
* The call setup failure code.
*/
code: string;
message: string;
type: 'call_error';
/**
* The parameter related to the error, if any. Empty when no parameter applies.
*/
param?: string;
}
}
}
export interface SidebandConnectParams {
/**
* Opt in to the graceful WebSocket closing handshake when the session ends. The
* server may also enable this behavior by default.
*/
graceful_close?: boolean;
}
export declare namespace Sideband {
export { type ConnectClientEvent as ConnectClientEvent, type SidebandClientEvent as SidebandClientEvent, type ConnectServerEvent as ConnectServerEvent, type SidebandServerEvent as SidebandServerEvent, type SidebandConnectParams as SidebandConnectParams, };
}
//# sourceMappingURL=sideband.d.ts.map