OpenAIRealtimeWebSocketOptions
이 콘텐츠는 아직 번역되지 않았습니다.
type OpenAIRealtimeWebSocketOptions = object & OpenAIRealtimeBaseOptions;
The options for the OpenAI Realtime WebSocket transport layer.
Type Declaration
Section titled “Type Declaration”createWebSocket()?
Section titled “createWebSocket()?”optional createWebSocket: (options) => Promise<WebSocket>;
Builds a new WebSocket connection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
|
|
The options for the WebSocket connection. |
Returns
Section titled “Returns”Promise
<WebSocket
>
The WebSocket connection.
skipOpenEventListeners?
Section titled “skipOpenEventListeners?”optional skipOpenEventListeners: boolean;
When you pass your own createWebSocket function, which completes the connection state transition,
you can set this to true to skip registering the open
event listener for the same purpose.
If this flag is set to true, the constructor will immediately call the internal operation
to mark the internal connection state to connected
. Otherwise, the constructor will register
the open
event listener and wait for it to be triggered.
By default (meaning if this property is absent), this is set to false.
optional url: string;
The URL to use for the WebSocket connection.
useInsecureApiKey?
Section titled “useInsecureApiKey?”optional useInsecureApiKey: boolean;
Important: Do not use this option unless you know what you are doing.
Whether to use an insecure API key. This has to be set if you are trying to use a regular OpenAI API key instead of a client ephemeral key.
https://platform.openai.com/docs/guides/realtime#creating-an-ephemeral-token