跳转到内容

OpenAIRealtimeWebSocketOptions

此内容尚不支持你的语言。

type OpenAIRealtimeWebSocketOptions = object & OpenAIRealtimeBaseOptions;

The options for the OpenAI Realtime WebSocket transport layer.

optional createWebSocket: (options) => Promise<WebSocket>;

Builds a new WebSocket connection.

Parameter Type Description

options

CreateWebSocketOptions

The options for the WebSocket connection.

Promise<WebSocket>

The WebSocket connection.

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.

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