openai 7.13.0 → 7.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/helpers/live.d.mts +2 -0
- package/helpers/live.d.mts.map +1 -0
- package/helpers/live.d.ts +2 -0
- package/helpers/live.d.ts.map +1 -0
- package/helpers/live.js +6 -0
- package/helpers/live.js.map +1 -0
- package/helpers/live.mjs +2 -0
- package/helpers/live.mjs.map +1 -0
- package/lib/live/transcript-grouper.d.mts +96 -0
- package/lib/live/transcript-grouper.d.mts.map +1 -0
- package/lib/live/transcript-grouper.d.ts +96 -0
- package/lib/live/transcript-grouper.d.ts.map +1 -0
- package/lib/live/transcript-grouper.js +223 -0
- package/lib/live/transcript-grouper.js.map +1 -0
- package/lib/live/transcript-grouper.mjs +219 -0
- package/lib/live/transcript-grouper.mjs.map +1 -0
- package/lib/live/transcript-grouping.d.mts +49 -0
- package/lib/live/transcript-grouping.d.mts.map +1 -0
- package/lib/live/transcript-grouping.d.ts +49 -0
- package/lib/live/transcript-grouping.d.ts.map +1 -0
- package/lib/live/transcript-grouping.js +287 -0
- package/lib/live/transcript-grouping.js.map +1 -0
- package/lib/live/transcript-grouping.mjs +283 -0
- package/lib/live/transcript-grouping.mjs.map +1 -0
- package/lib/live/webrtc.d.mts +13 -0
- package/lib/live/webrtc.d.mts.map +1 -0
- package/lib/live/webrtc.d.ts +13 -0
- package/lib/live/webrtc.d.ts.map +1 -0
- package/lib/live/webrtc.js +16 -0
- package/lib/live/webrtc.js.map +1 -0
- package/lib/live/webrtc.mjs +10 -0
- package/lib/live/webrtc.mjs.map +1 -0
- package/lib/realtime/webrtc.d.mts +13 -0
- package/lib/realtime/webrtc.d.mts.map +1 -0
- package/lib/realtime/webrtc.d.ts +13 -0
- package/lib/realtime/webrtc.d.ts.map +1 -0
- package/lib/realtime/webrtc.js +16 -0
- package/lib/realtime/webrtc.js.map +1 -0
- package/lib/realtime/webrtc.mjs +10 -0
- package/lib/realtime/webrtc.mjs.map +1 -0
- package/lib/webrtc/connection.d.mts +40 -0
- package/lib/webrtc/connection.d.mts.map +1 -0
- package/lib/webrtc/connection.d.ts +40 -0
- package/lib/webrtc/connection.d.ts.map +1 -0
- package/lib/webrtc/connection.js +228 -0
- package/lib/webrtc/connection.js.map +1 -0
- package/lib/webrtc/connection.mjs +224 -0
- package/lib/webrtc/connection.mjs.map +1 -0
- package/lib/webrtc/data-channel.d.mts +32 -0
- package/lib/webrtc/data-channel.d.mts.map +1 -0
- package/lib/webrtc/data-channel.d.ts +32 -0
- package/lib/webrtc/data-channel.d.ts.map +1 -0
- package/lib/webrtc/data-channel.js +125 -0
- package/lib/webrtc/data-channel.js.map +1 -0
- package/lib/webrtc/data-channel.mjs +121 -0
- package/lib/webrtc/data-channel.mjs.map +1 -0
- package/lib/webrtc/errors.d.mts +19 -0
- package/lib/webrtc/errors.d.mts.map +1 -0
- package/lib/webrtc/errors.d.ts +19 -0
- package/lib/webrtc/errors.d.ts.map +1 -0
- package/lib/webrtc/errors.js +18 -0
- package/lib/webrtc/errors.js.map +1 -0
- package/lib/webrtc/errors.mjs +14 -0
- package/lib/webrtc/errors.mjs.map +1 -0
- package/lib/webrtc/subscriptions.d.mts +13 -0
- package/lib/webrtc/subscriptions.d.mts.map +1 -0
- package/lib/webrtc/subscriptions.d.ts +13 -0
- package/lib/webrtc/subscriptions.d.ts.map +1 -0
- package/lib/webrtc/subscriptions.js +62 -0
- package/lib/webrtc/subscriptions.js.map +1 -0
- package/lib/webrtc/subscriptions.mjs +58 -0
- package/lib/webrtc/subscriptions.mjs.map +1 -0
- package/lib/webrtc/types.d.mts +99 -0
- package/lib/webrtc/types.d.mts.map +1 -0
- package/lib/webrtc/types.d.ts +99 -0
- package/lib/webrtc/types.d.ts.map +1 -0
- package/lib/webrtc/types.js +3 -0
- package/lib/webrtc/types.js.map +1 -0
- package/lib/webrtc/types.mjs +2 -0
- package/lib/webrtc/types.mjs.map +1 -0
- package/live/webrtc.d.mts +3 -0
- package/live/webrtc.d.mts.map +1 -0
- package/live/webrtc.d.ts +3 -0
- package/live/webrtc.d.ts.map +1 -0
- package/live/webrtc.js +8 -0
- package/live/webrtc.js.map +1 -0
- package/live/webrtc.mjs +2 -0
- package/live/webrtc.mjs.map +1 -0
- package/package.json +11 -1
- package/realtime/webrtc.d.mts +3 -0
- package/realtime/webrtc.d.mts.map +1 -0
- package/realtime/webrtc.d.ts +3 -0
- package/realtime/webrtc.d.ts.map +1 -0
- package/realtime/webrtc.js +8 -0
- package/realtime/webrtc.js.map +1 -0
- package/realtime/webrtc.mjs +2 -0
- package/realtime/webrtc.mjs.map +1 -0
- package/resources/beta/responses/responses.d.mts +48 -0
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +48 -0
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/conversations/items.d.mts +16 -0
- package/resources/conversations/items.d.mts.map +1 -1
- package/resources/conversations/items.d.ts +16 -0
- package/resources/conversations/items.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/live/forks/forks.d.mts +110 -0
- package/resources/live/forks/forks.d.mts.map +1 -0
- package/resources/live/forks/forks.d.ts +110 -0
- package/resources/live/forks/forks.d.ts.map +1 -0
- package/resources/live/forks/forks.js +9 -0
- package/resources/live/forks/forks.js.map +1 -0
- package/resources/live/forks/forks.mjs +5 -0
- package/resources/live/forks/forks.mjs.map +1 -0
- package/resources/live/forks/index.d.mts +4 -0
- package/resources/live/forks/index.d.mts.map +1 -0
- package/resources/live/forks/index.d.ts +4 -0
- package/resources/live/forks/index.d.ts.map +1 -0
- package/resources/live/forks/index.js +7 -0
- package/resources/live/forks/index.js.map +1 -0
- package/resources/live/forks/index.mjs +3 -0
- package/resources/live/forks/index.mjs.map +1 -0
- package/resources/live/forks/internal-base.d.mts +73 -0
- package/resources/live/forks/internal-base.d.mts.map +1 -0
- package/resources/live/forks/internal-base.d.ts +73 -0
- package/resources/live/forks/internal-base.d.ts.map +1 -0
- package/resources/live/forks/internal-base.js +49 -0
- package/resources/live/forks/internal-base.js.map +1 -0
- package/resources/live/forks/internal-base.mjs +43 -0
- package/resources/live/forks/internal-base.mjs.map +1 -0
- package/resources/live/forks/ws-base.d.mts +109 -0
- package/resources/live/forks/ws-base.d.mts.map +1 -0
- package/resources/live/forks/ws-base.d.ts +109 -0
- package/resources/live/forks/ws-base.d.ts.map +1 -0
- package/resources/live/forks/ws-base.js +476 -0
- package/resources/live/forks/ws-base.js.map +1 -0
- package/resources/live/forks/ws-base.mjs +472 -0
- package/resources/live/forks/ws-base.mjs.map +1 -0
- package/resources/live/forks/ws.d.mts +13 -0
- package/resources/live/forks/ws.d.mts.map +1 -0
- package/resources/live/forks/ws.d.ts +13 -0
- package/resources/live/forks/ws.d.ts.map +1 -0
- package/resources/live/forks/ws.js +34 -0
- package/resources/live/forks/ws.js.map +1 -0
- package/resources/live/forks/ws.mjs +29 -0
- package/resources/live/forks/ws.mjs.map +1 -0
- package/resources/live/forks.d.mts +2 -0
- package/resources/live/forks.d.mts.map +1 -0
- package/resources/live/forks.d.ts +2 -0
- package/resources/live/forks.d.ts.map +1 -0
- package/resources/live/forks.js +6 -0
- package/resources/live/forks.js.map +1 -0
- package/resources/live/forks.mjs +3 -0
- package/resources/live/forks.mjs.map +1 -0
- package/resources/live/index.d.mts +7 -0
- package/resources/live/index.d.mts.map +1 -0
- package/resources/live/index.d.ts +7 -0
- package/resources/live/index.d.ts.map +1 -0
- package/resources/live/index.js +13 -0
- package/resources/live/index.js.map +1 -0
- package/resources/live/index.mjs +6 -0
- package/resources/live/index.mjs.map +1 -0
- package/resources/live/internal-base.d.mts +71 -0
- package/resources/live/internal-base.d.mts.map +1 -0
- package/resources/live/internal-base.d.ts +71 -0
- package/resources/live/internal-base.d.ts.map +1 -0
- package/resources/live/internal-base.js +48 -0
- package/resources/live/internal-base.js.map +1 -0
- package/resources/live/internal-base.mjs +42 -0
- package/resources/live/internal-base.mjs.map +1 -0
- package/resources/live/live.d.mts +1864 -0
- package/resources/live/live.d.mts.map +1 -0
- package/resources/live/live.d.ts +1864 -0
- package/resources/live/live.d.ts.map +1 -0
- package/resources/live/live.js +40 -0
- package/resources/live/live.js.map +1 -0
- package/resources/live/live.mjs +35 -0
- package/resources/live/live.mjs.map +1 -0
- package/resources/live/sessions.d.mts +254 -0
- package/resources/live/sessions.d.mts.map +1 -0
- package/resources/live/sessions.d.ts +254 -0
- package/resources/live/sessions.d.ts.map +1 -0
- package/resources/live/sessions.js +118 -0
- package/resources/live/sessions.js.map +1 -0
- package/resources/live/sessions.mjs +114 -0
- package/resources/live/sessions.mjs.map +1 -0
- package/resources/live/sideband/index.d.mts +4 -0
- package/resources/live/sideband/index.d.mts.map +1 -0
- package/resources/live/sideband/index.d.ts +4 -0
- package/resources/live/sideband/index.d.ts.map +1 -0
- package/resources/live/sideband/index.js +7 -0
- package/resources/live/sideband/index.js.map +1 -0
- package/resources/live/sideband/index.mjs +3 -0
- package/resources/live/sideband/index.mjs.map +1 -0
- package/resources/live/sideband/internal-base.d.mts +73 -0
- package/resources/live/sideband/internal-base.d.mts.map +1 -0
- package/resources/live/sideband/internal-base.d.ts +73 -0
- package/resources/live/sideband/internal-base.d.ts.map +1 -0
- package/resources/live/sideband/internal-base.js +49 -0
- package/resources/live/sideband/internal-base.js.map +1 -0
- package/resources/live/sideband/internal-base.mjs +43 -0
- package/resources/live/sideband/internal-base.mjs.map +1 -0
- package/resources/live/sideband/sideband.d.mts +25 -0
- package/resources/live/sideband/sideband.d.mts.map +1 -0
- package/resources/live/sideband/sideband.d.ts +25 -0
- package/resources/live/sideband/sideband.d.ts.map +1 -0
- package/resources/live/sideband/sideband.js +9 -0
- package/resources/live/sideband/sideband.js.map +1 -0
- package/resources/live/sideband/sideband.mjs +5 -0
- package/resources/live/sideband/sideband.mjs.map +1 -0
- package/resources/live/sideband/ws-base.d.mts +114 -0
- package/resources/live/sideband/ws-base.d.mts.map +1 -0
- package/resources/live/sideband/ws-base.d.ts +114 -0
- package/resources/live/sideband/ws-base.d.ts.map +1 -0
- package/resources/live/sideband/ws-base.js +476 -0
- package/resources/live/sideband/ws-base.js.map +1 -0
- package/resources/live/sideband/ws-base.mjs +472 -0
- package/resources/live/sideband/ws-base.mjs.map +1 -0
- package/resources/live/sideband/ws.d.mts +13 -0
- package/resources/live/sideband/ws.d.mts.map +1 -0
- package/resources/live/sideband/ws.d.ts +13 -0
- package/resources/live/sideband/ws.d.ts.map +1 -0
- package/resources/live/sideband/ws.js +34 -0
- package/resources/live/sideband/ws.js.map +1 -0
- package/resources/live/sideband/ws.mjs +29 -0
- package/resources/live/sideband/ws.mjs.map +1 -0
- package/resources/live/sideband.d.mts +2 -0
- package/resources/live/sideband.d.mts.map +1 -0
- package/resources/live/sideband.d.ts +2 -0
- package/resources/live/sideband.d.ts.map +1 -0
- package/resources/live/sideband.js +6 -0
- package/resources/live/sideband.js.map +1 -0
- package/resources/live/sideband.mjs +3 -0
- package/resources/live/sideband.mjs.map +1 -0
- package/resources/live/ws-base.d.mts +106 -0
- package/resources/live/ws-base.d.mts.map +1 -0
- package/resources/live/ws-base.d.ts +106 -0
- package/resources/live/ws-base.d.ts.map +1 -0
- package/resources/live/ws-base.js +476 -0
- package/resources/live/ws-base.js.map +1 -0
- package/resources/live/ws-base.mjs +472 -0
- package/resources/live/ws-base.mjs.map +1 -0
- package/resources/live/ws.d.mts +13 -0
- package/resources/live/ws.d.mts.map +1 -0
- package/resources/live/ws.d.ts +13 -0
- package/resources/live/ws.d.ts.map +1 -0
- package/resources/live/ws.js +34 -0
- package/resources/live/ws.js.map +1 -0
- package/resources/live/ws.mjs +29 -0
- package/resources/live/ws.mjs.map +1 -0
- package/resources/live.d.mts +2 -0
- package/resources/live.d.mts.map +1 -0
- package/resources/live.d.ts +2 -0
- package/resources/live.d.ts.map +1 -0
- package/resources/live.js +6 -0
- package/resources/live.js.map +1 -0
- package/resources/live.mjs +3 -0
- package/resources/live.mjs.map +1 -0
- package/resources/responses/responses.d.mts +48 -0
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +48 -0
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +72 -5
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +72 -5
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/src/client.ts +5 -0
- package/src/helpers/live.ts +8 -0
- package/src/lib/live/transcript-grouper.ts +303 -0
- package/src/lib/live/transcript-grouping.ts +362 -0
- package/src/lib/live/webrtc.ts +23 -0
- package/src/lib/realtime/webrtc.ts +20 -0
- package/src/lib/webrtc/connection.ts +309 -0
- package/src/lib/webrtc/data-channel.ts +144 -0
- package/src/lib/webrtc/errors.ts +38 -0
- package/src/lib/webrtc/subscriptions.ts +62 -0
- package/src/lib/webrtc/types.ts +109 -0
- package/src/live/webrtc.ts +10 -0
- package/src/realtime/webrtc.ts +10 -0
- package/src/resources/beta/responses/responses.ts +60 -0
- package/src/resources/conversations/items.ts +20 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/live/api.md +87 -0
- package/src/resources/live/forks/forks.ts +169 -0
- package/src/resources/live/forks/index.ts +5 -0
- package/src/resources/live/forks/internal-base.ts +107 -0
- package/src/resources/live/forks/ws-base.ts +611 -0
- package/src/resources/live/forks/ws.ts +46 -0
- package/src/resources/live/forks.ts +3 -0
- package/src/resources/live/index.ts +20 -0
- package/src/resources/live/internal-base.ts +104 -0
- package/src/resources/live/live.ts +2296 -0
- package/src/resources/live/sessions.ts +337 -0
- package/src/resources/live/sideband/index.ts +10 -0
- package/src/resources/live/sideband/internal-base.ts +107 -0
- package/src/resources/live/sideband/sideband.ts +58 -0
- package/src/resources/live/sideband/ws-base.ts +621 -0
- package/src/resources/live/sideband/ws.ts +46 -0
- package/src/resources/live/sideband.ts +3 -0
- package/src/resources/live/ws-base.ts +607 -0
- package/src/resources/live/ws.ts +42 -0
- package/src/resources/live.ts +3 -0
- package/src/resources/responses/responses.ts +60 -0
- package/src/resources/webhooks/api.md +1 -0
- package/src/resources/webhooks/webhooks.ts +82 -3
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { OpenAIRealtimeWebRTC, RealtimeDataChannel, WebRTCError } from '../lib/realtime/webrtc';
|
|
2
|
+
export type {
|
|
3
|
+
ExchangeSdp,
|
|
4
|
+
WebRTCConnectOptions,
|
|
5
|
+
WebRTCConnectionEvent,
|
|
6
|
+
WebRTCConfiguration,
|
|
7
|
+
WebRTCErrorCode,
|
|
8
|
+
WebRTCErrorPhase,
|
|
9
|
+
WebRTCState,
|
|
10
|
+
} from '../lib/realtime/webrtc';
|
|
@@ -5783,17 +5783,37 @@ export namespace BetaResponseInputItem {
|
|
|
5783
5783
|
*/
|
|
5784
5784
|
type: 'image_generation_call';
|
|
5785
5785
|
|
|
5786
|
+
/**
|
|
5787
|
+
* The action used for image generation.
|
|
5788
|
+
*/
|
|
5789
|
+
action?: 'generate' | 'edit' | 'auto' | null;
|
|
5790
|
+
|
|
5786
5791
|
/**
|
|
5787
5792
|
* The agent that produced this item.
|
|
5788
5793
|
*/
|
|
5789
5794
|
agent?: ImageGenerationCall.Agent | null;
|
|
5790
5795
|
|
|
5796
|
+
/**
|
|
5797
|
+
* The background setting used for generation.
|
|
5798
|
+
*/
|
|
5799
|
+
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
5800
|
+
|
|
5801
|
+
/**
|
|
5802
|
+
* The output format used for generation.
|
|
5803
|
+
*/
|
|
5804
|
+
output_format?: 'png' | 'webp' | 'jpeg' | null;
|
|
5805
|
+
|
|
5791
5806
|
/**
|
|
5792
5807
|
* The quality of the image generated by the image generation tool call. One of
|
|
5793
5808
|
* `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
|
|
5794
5809
|
*/
|
|
5795
5810
|
quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
|
|
5796
5811
|
|
|
5812
|
+
/**
|
|
5813
|
+
* The prompt that was used after any model prompt rewriting.
|
|
5814
|
+
*/
|
|
5815
|
+
revised_prompt?: string | null;
|
|
5816
|
+
|
|
5797
5817
|
/**
|
|
5798
5818
|
* The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
5799
5819
|
*/
|
|
@@ -7272,17 +7292,37 @@ export namespace BetaResponseItem {
|
|
|
7272
7292
|
*/
|
|
7273
7293
|
type: 'image_generation_call';
|
|
7274
7294
|
|
|
7295
|
+
/**
|
|
7296
|
+
* The action used for image generation.
|
|
7297
|
+
*/
|
|
7298
|
+
action?: 'generate' | 'edit' | 'auto' | null;
|
|
7299
|
+
|
|
7275
7300
|
/**
|
|
7276
7301
|
* The agent that produced this item.
|
|
7277
7302
|
*/
|
|
7278
7303
|
agent?: ImageGenerationCall.Agent | null;
|
|
7279
7304
|
|
|
7305
|
+
/**
|
|
7306
|
+
* The background setting used for generation.
|
|
7307
|
+
*/
|
|
7308
|
+
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
7309
|
+
|
|
7310
|
+
/**
|
|
7311
|
+
* The output format used for generation.
|
|
7312
|
+
*/
|
|
7313
|
+
output_format?: 'png' | 'webp' | 'jpeg' | null;
|
|
7314
|
+
|
|
7280
7315
|
/**
|
|
7281
7316
|
* The quality of the image generated by the image generation tool call. One of
|
|
7282
7317
|
* `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
|
|
7283
7318
|
*/
|
|
7284
7319
|
quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
|
|
7285
7320
|
|
|
7321
|
+
/**
|
|
7322
|
+
* The prompt that was used after any model prompt rewriting.
|
|
7323
|
+
*/
|
|
7324
|
+
revised_prompt?: string | null;
|
|
7325
|
+
|
|
7286
7326
|
/**
|
|
7287
7327
|
* The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
7288
7328
|
*/
|
|
@@ -8487,17 +8527,37 @@ export namespace BetaResponseOutputItem {
|
|
|
8487
8527
|
*/
|
|
8488
8528
|
type: 'image_generation_call';
|
|
8489
8529
|
|
|
8530
|
+
/**
|
|
8531
|
+
* The action used for image generation.
|
|
8532
|
+
*/
|
|
8533
|
+
action?: 'generate' | 'edit' | 'auto' | null;
|
|
8534
|
+
|
|
8490
8535
|
/**
|
|
8491
8536
|
* The agent that produced this item.
|
|
8492
8537
|
*/
|
|
8493
8538
|
agent?: ImageGenerationCall.Agent | null;
|
|
8494
8539
|
|
|
8540
|
+
/**
|
|
8541
|
+
* The background setting used for generation.
|
|
8542
|
+
*/
|
|
8543
|
+
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
8544
|
+
|
|
8545
|
+
/**
|
|
8546
|
+
* The output format used for generation.
|
|
8547
|
+
*/
|
|
8548
|
+
output_format?: 'png' | 'webp' | 'jpeg' | null;
|
|
8549
|
+
|
|
8495
8550
|
/**
|
|
8496
8551
|
* The quality of the image generated by the image generation tool call. One of
|
|
8497
8552
|
* `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
|
|
8498
8553
|
*/
|
|
8499
8554
|
quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
|
|
8500
8555
|
|
|
8556
|
+
/**
|
|
8557
|
+
* The prompt that was used after any model prompt rewriting.
|
|
8558
|
+
*/
|
|
8559
|
+
revised_prompt?: string | null;
|
|
8560
|
+
|
|
8501
8561
|
/**
|
|
8502
8562
|
* The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
8503
8563
|
*/
|
|
@@ -143,12 +143,32 @@ export namespace ConversationItem {
|
|
|
143
143
|
*/
|
|
144
144
|
type: 'image_generation_call';
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* The action used for image generation.
|
|
148
|
+
*/
|
|
149
|
+
action?: 'generate' | 'edit' | 'auto' | null;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The background setting used for generation.
|
|
153
|
+
*/
|
|
154
|
+
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The output format used for generation.
|
|
158
|
+
*/
|
|
159
|
+
output_format?: 'png' | 'webp' | 'jpeg' | null;
|
|
160
|
+
|
|
146
161
|
/**
|
|
147
162
|
* The quality of the image generated by the image generation tool call. One of
|
|
148
163
|
* `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
|
|
149
164
|
*/
|
|
150
165
|
quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
|
|
151
166
|
|
|
167
|
+
/**
|
|
168
|
+
* The prompt that was used after any model prompt rewriting.
|
|
169
|
+
*/
|
|
170
|
+
revised_prompt?: string | null;
|
|
171
|
+
|
|
152
172
|
/**
|
|
153
173
|
* The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
154
174
|
*/
|
package/src/resources/index.ts
CHANGED
|
@@ -91,6 +91,7 @@ export {
|
|
|
91
91
|
type ImageGenerateParamsNonStreaming,
|
|
92
92
|
type ImageGenerateParamsStreaming,
|
|
93
93
|
} from './images';
|
|
94
|
+
export { Live } from './live/live';
|
|
94
95
|
export { Models, type Model, type ModelDeleted, type ModelsPage } from './models';
|
|
95
96
|
export {
|
|
96
97
|
Moderations,
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Live
|
|
2
|
+
|
|
3
|
+
Types:
|
|
4
|
+
|
|
5
|
+
- <code><a href="./src/resources/live/live.ts">AudioFormat</a></code>
|
|
6
|
+
- <code><a href="./src/resources/live/live.ts">BuiltInVoice</a></code>
|
|
7
|
+
- <code><a href="./src/resources/live/live.ts">ClientConfig</a></code>
|
|
8
|
+
- <code><a href="./src/resources/live/live.ts">ClientDelegation</a></code>
|
|
9
|
+
- <code><a href="./src/resources/live/live.ts">ClientEvent</a></code>
|
|
10
|
+
- <code><a href="./src/resources/live/live.ts">CommentaryAppendEvent</a></code>
|
|
11
|
+
- <code><a href="./src/resources/live/live.ts">CommentaryAppendedEvent</a></code>
|
|
12
|
+
- <code><a href="./src/resources/live/live.ts">CustomVoice</a></code>
|
|
13
|
+
- <code><a href="./src/resources/live/live.ts">DataChannelConfig</a></code>
|
|
14
|
+
- <code><a href="./src/resources/live/live.ts">DelegationCreatedEvent</a></code>
|
|
15
|
+
- <code><a href="./src/resources/live/live.ts">Error</a></code>
|
|
16
|
+
- <code><a href="./src/resources/live/live.ts">ErrorEvent</a></code>
|
|
17
|
+
- <code><a href="./src/resources/live/live.ts">ForkSessionConfig</a></code>
|
|
18
|
+
- <code><a href="./src/resources/live/live.ts">ForkSessionStartEvent</a></code>
|
|
19
|
+
- <code><a href="./src/resources/live/live.ts">FunctionTool</a></code>
|
|
20
|
+
- <code><a href="./src/resources/live/live.ts">InfoEvent</a></code>
|
|
21
|
+
- <code><a href="./src/resources/live/live.ts">InitialItem</a></code>
|
|
22
|
+
- <code><a href="./src/resources/live/live.ts">InputAudioAppendEvent</a></code>
|
|
23
|
+
- <code><a href="./src/resources/live/live.ts">InputAudioMuteEvent</a></code>
|
|
24
|
+
- <code><a href="./src/resources/live/live.ts">InputAudioMutedEvent</a></code>
|
|
25
|
+
- <code><a href="./src/resources/live/live.ts">InputAudioUnmuteEvent</a></code>
|
|
26
|
+
- <code><a href="./src/resources/live/live.ts">InputAudioUnmutedEvent</a></code>
|
|
27
|
+
- <code><a href="./src/resources/live/live.ts">InputTranscriptDeltaEvent</a></code>
|
|
28
|
+
- <code><a href="./src/resources/live/live.ts">InstructionsAppendEvent</a></code>
|
|
29
|
+
- <code><a href="./src/resources/live/live.ts">InstructionsAppendedEvent</a></code>
|
|
30
|
+
- <code><a href="./src/resources/live/live.ts">MediaSessionConfig</a></code>
|
|
31
|
+
- <code><a href="./src/resources/live/live.ts">MediaSessionForkConfig</a></code>
|
|
32
|
+
- <code><a href="./src/resources/live/live.ts">OutputAudioDeltaEvent</a></code>
|
|
33
|
+
- <code><a href="./src/resources/live/live.ts">OutputTranscriptDeltaEvent</a></code>
|
|
34
|
+
- <code><a href="./src/resources/live/live.ts">ResponseCreateEvent</a></code>
|
|
35
|
+
- <code><a href="./src/resources/live/live.ts">ResponseEvent</a></code>
|
|
36
|
+
- <code><a href="./src/resources/live/live.ts">ResponseItemCreateEvent</a></code>
|
|
37
|
+
- <code><a href="./src/resources/live/live.ts">ResponsesDelegationConfig</a></code>
|
|
38
|
+
- <code><a href="./src/resources/live/live.ts">ResponsesDelegationUpdateConfig</a></code>
|
|
39
|
+
- <code><a href="./src/resources/live/live.ts">ServerEvent</a></code>
|
|
40
|
+
- <code><a href="./src/resources/live/live.ts">ServerEventSelector</a></code>
|
|
41
|
+
- <code><a href="./src/resources/live/live.ts">SessionCloseEvent</a></code>
|
|
42
|
+
- <code><a href="./src/resources/live/live.ts">SessionClosedEvent</a></code>
|
|
43
|
+
- <code><a href="./src/resources/live/live.ts">SessionConfig</a></code>
|
|
44
|
+
- <code><a href="./src/resources/live/live.ts">SessionResource</a></code>
|
|
45
|
+
- <code><a href="./src/resources/live/live.ts">SessionStartEvent</a></code>
|
|
46
|
+
- <code><a href="./src/resources/live/live.ts">SessionStartedEvent</a></code>
|
|
47
|
+
- <code><a href="./src/resources/live/live.ts">SessionUpdateConfig</a></code>
|
|
48
|
+
- <code><a href="./src/resources/live/live.ts">SessionUpdateEvent</a></code>
|
|
49
|
+
- <code><a href="./src/resources/live/live.ts">SessionUpdatedEvent</a></code>
|
|
50
|
+
- <code><a href="./src/resources/live/live.ts">SessionUsage</a></code>
|
|
51
|
+
- <code><a href="./src/resources/live/live.ts">SessionUsageUpdatedEvent</a></code>
|
|
52
|
+
- <code><a href="./src/resources/live/live.ts">ThinkingAppendEvent</a></code>
|
|
53
|
+
- <code><a href="./src/resources/live/live.ts">ThinkingAppendedEvent</a></code>
|
|
54
|
+
- <code><a href="./src/resources/live/live.ts">LiveCreateResponse</a></code>
|
|
55
|
+
|
|
56
|
+
Methods:
|
|
57
|
+
|
|
58
|
+
- <code title="post /live/sessions">client.live.<a href="./src/resources/live/live.ts">create</a>({ ...params }) -> LiveCreateResponse</code>
|
|
59
|
+
|
|
60
|
+
## Sideband
|
|
61
|
+
|
|
62
|
+
Types:
|
|
63
|
+
|
|
64
|
+
- <code><a href="./src/resources/live/sideband.ts">ConnectClientEvent</a></code>
|
|
65
|
+
- <code><a href="./src/resources/live/sideband.ts">ConnectServerEvent</a></code>
|
|
66
|
+
|
|
67
|
+
## Forks
|
|
68
|
+
|
|
69
|
+
Types:
|
|
70
|
+
|
|
71
|
+
- <code><a href="./src/resources/live/forks.ts">ForkClientEvent</a></code>
|
|
72
|
+
- <code><a href="./src/resources/live/forks.ts">ForkServerEvent</a></code>
|
|
73
|
+
|
|
74
|
+
## Sessions
|
|
75
|
+
|
|
76
|
+
Types:
|
|
77
|
+
|
|
78
|
+
- <code><a href="./src/resources/live/sessions.ts">SessionForkResponse</a></code>
|
|
79
|
+
|
|
80
|
+
Methods:
|
|
81
|
+
|
|
82
|
+
- <code title="post /live/sessions/{session_id}/accept">client.live.sessions.<a href="./src/resources/live/sessions.ts">accept</a>(sessionID, { ...params }) -> void</code>
|
|
83
|
+
- <code title="get /live/sessions/{session_id}/content">client.live.sessions.<a href="./src/resources/live/sessions.ts">downloadRecording</a>(sessionID) -> Response</code>
|
|
84
|
+
- <code title="post /live/sessions/{session_id}/fork">client.live.sessions.<a href="./src/resources/live/sessions.ts">fork</a>(sessionID, { ...params }) -> SessionForkResponse</code>
|
|
85
|
+
- <code title="post /live/sessions/{session_id}/hangup">client.live.sessions.<a href="./src/resources/live/sessions.ts">hangup</a>(sessionID) -> void</code>
|
|
86
|
+
- <code title="post /live/sessions/{session_id}/refer">client.live.sessions.<a href="./src/resources/live/sessions.ts">refer</a>(sessionID, { ...params }) -> void</code>
|
|
87
|
+
- <code title="post /live/sessions/{session_id}/reject">client.live.sessions.<a href="./src/resources/live/sessions.ts">reject</a>(sessionID, { ...params }) -> void</code>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as LiveAPI from '../live';
|
|
5
|
+
|
|
6
|
+
export class Forks extends APIResource {}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Client events for a Live fork WebSocket. First send session.start with an
|
|
10
|
+
* overrides object (which may be empty), then wait for session.started before
|
|
11
|
+
* sending other commands. The model and conversation are inherited from the stored
|
|
12
|
+
* session.
|
|
13
|
+
*/
|
|
14
|
+
export type ForkClientEvent =
|
|
15
|
+
| LiveAPI.ForkSessionStartEvent
|
|
16
|
+
| LiveAPI.SessionUpdateEvent
|
|
17
|
+
| LiveAPI.InputAudioAppendEvent
|
|
18
|
+
| LiveAPI.InputAudioMuteEvent
|
|
19
|
+
| LiveAPI.InputAudioUnmuteEvent
|
|
20
|
+
| LiveAPI.InstructionsAppendEvent
|
|
21
|
+
| LiveAPI.ThinkingAppendEvent
|
|
22
|
+
| LiveAPI.CommentaryAppendEvent
|
|
23
|
+
| LiveAPI.ResponseItemCreateEvent
|
|
24
|
+
| LiveAPI.ResponseCreateEvent
|
|
25
|
+
| LiveAPI.SessionCloseEvent;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Server events for Live. Response lifecycle events are wrapped inside
|
|
29
|
+
* response.event; dispatch the nested event by its full type and tolerate new
|
|
30
|
+
* response event types. Follow the
|
|
31
|
+
* [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting)
|
|
32
|
+
* when designing the conversation and delegation policy.
|
|
33
|
+
*/
|
|
34
|
+
export type ForkServerEvent =
|
|
35
|
+
| LiveAPI.SessionStartedEvent
|
|
36
|
+
| LiveAPI.SessionUpdatedEvent
|
|
37
|
+
| LiveAPI.InputAudioMutedEvent
|
|
38
|
+
| LiveAPI.InputAudioUnmutedEvent
|
|
39
|
+
| LiveAPI.InstructionsAppendedEvent
|
|
40
|
+
| LiveAPI.ThinkingAppendedEvent
|
|
41
|
+
| LiveAPI.CommentaryAppendedEvent
|
|
42
|
+
| ForkServerEvent.SessionInputAudioAppend
|
|
43
|
+
| LiveAPI.OutputAudioDeltaEvent
|
|
44
|
+
| LiveAPI.InputTranscriptDeltaEvent
|
|
45
|
+
| LiveAPI.OutputTranscriptDeltaEvent
|
|
46
|
+
| LiveAPI.DelegationCreatedEvent
|
|
47
|
+
| LiveAPI.ResponseEvent
|
|
48
|
+
| LiveAPI.SessionUsageUpdatedEvent
|
|
49
|
+
| LiveAPI.SessionClosedEvent
|
|
50
|
+
| LiveAPI.ErrorEvent
|
|
51
|
+
| LiveAPI.InfoEvent
|
|
52
|
+
| ForkServerEvent.TransportDtmfReceived
|
|
53
|
+
| ForkServerEvent.TransportDtmfSend
|
|
54
|
+
| ForkServerEvent.TransportRinging
|
|
55
|
+
| ForkServerEvent.TransportAnswered
|
|
56
|
+
| ForkServerEvent.TransportFailed;
|
|
57
|
+
|
|
58
|
+
export namespace ForkServerEvent {
|
|
59
|
+
/**
|
|
60
|
+
* Input audio received from the primary transport and reflected to a Live sideband
|
|
61
|
+
* connection before model-input muting.
|
|
62
|
+
*/
|
|
63
|
+
export interface SessionInputAudioAppend {
|
|
64
|
+
/**
|
|
65
|
+
* Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
|
|
66
|
+
* reflected to the sideband before model-input muting. This server event uses the
|
|
67
|
+
* same audio key as the client command, but is not an acknowledgment of it.
|
|
68
|
+
*/
|
|
69
|
+
audio: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The event type, always `session.input_audio.append`.
|
|
73
|
+
*/
|
|
74
|
+
type: 'session.input_audio.append';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A SIP DTMF keypress received from the caller. Delivered only to sideband
|
|
79
|
+
* observers.
|
|
80
|
+
*/
|
|
81
|
+
export interface TransportDtmfReceived {
|
|
82
|
+
event: string;
|
|
83
|
+
|
|
84
|
+
event_id: string;
|
|
85
|
+
|
|
86
|
+
type: 'transport.dtmf.received';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to
|
|
91
|
+
* sideband observers; this is not a client command.
|
|
92
|
+
*/
|
|
93
|
+
export interface TransportDtmfSend {
|
|
94
|
+
event: string;
|
|
95
|
+
|
|
96
|
+
event_id: string;
|
|
97
|
+
|
|
98
|
+
type: 'transport.dtmf.send';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The outbound SIP provider leg is ringing or providing early media. Delivered
|
|
103
|
+
* only to sideband observers.
|
|
104
|
+
*/
|
|
105
|
+
export interface TransportRinging {
|
|
106
|
+
event_id: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The canonical Live session ID.
|
|
110
|
+
*/
|
|
111
|
+
session_id: string;
|
|
112
|
+
|
|
113
|
+
type: 'transport.ringing';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The outbound SIP provider leg answered and media is established. Delivered only
|
|
118
|
+
* to sideband observers.
|
|
119
|
+
*/
|
|
120
|
+
export interface TransportAnswered {
|
|
121
|
+
event_id: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The canonical Live session ID.
|
|
125
|
+
*/
|
|
126
|
+
session_id: string;
|
|
127
|
+
|
|
128
|
+
type: 'transport.answered';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* An asynchronous outbound SIP setup failure. Delivered only to sideband
|
|
133
|
+
* observers.
|
|
134
|
+
*/
|
|
135
|
+
export interface TransportFailed {
|
|
136
|
+
error: TransportFailed.Error;
|
|
137
|
+
|
|
138
|
+
event_id: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The canonical Live session ID.
|
|
142
|
+
*/
|
|
143
|
+
session_id: string;
|
|
144
|
+
|
|
145
|
+
type: 'transport.failed';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export namespace TransportFailed {
|
|
149
|
+
export interface Error {
|
|
150
|
+
/**
|
|
151
|
+
* The call setup failure code.
|
|
152
|
+
*/
|
|
153
|
+
code: string;
|
|
154
|
+
|
|
155
|
+
message: string;
|
|
156
|
+
|
|
157
|
+
type: 'call_error';
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The parameter related to the error, if any. Empty when no parameter applies.
|
|
161
|
+
*/
|
|
162
|
+
param?: string;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare namespace Forks {
|
|
168
|
+
export { type ForkClientEvent as ForkClientEvent, type ForkServerEvent as ForkServerEvent };
|
|
169
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Forks, type ForkClientEvent, type ForkServerEvent } from './forks';
|
|
4
|
+
export { type ForksWSClientOptions } from './ws';
|
|
5
|
+
export { type ForksWSReconnectOptions } from './ws-base';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as ForksAPI from './forks';
|
|
4
|
+
import * as LiveAPI from '../live';
|
|
5
|
+
import { OpenAI } from '../../../client';
|
|
6
|
+
import { EventEmitter } from '../../../core/EventEmitter';
|
|
7
|
+
import { OpenAIError } from '../../../core/error';
|
|
8
|
+
import { path } from '../../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from '../../../internal/ws';
|
|
11
|
+
import { ForksWSParameters } from './ws-base';
|
|
12
|
+
|
|
13
|
+
export type ForksStreamMessage =
|
|
14
|
+
| { type: 'connecting' | 'open' | 'closing' }
|
|
15
|
+
| { type: 'close'; code: number; reason: string; unsent: UnsentMessage<ForksAPI.ForkClientEvent>[] }
|
|
16
|
+
| { type: 'reconnecting'; reconnect: ReconnectingEvent<ForksWSParameters> }
|
|
17
|
+
| { type: 'reconnected' }
|
|
18
|
+
| { type: 'message'; message: ForksAPI.ForkServerEvent }
|
|
19
|
+
| { type: 'raw'; data: RawWebSocketData }
|
|
20
|
+
| { type: 'error'; error: WebSocketError };
|
|
21
|
+
|
|
22
|
+
export class WebSocketError extends OpenAIError {
|
|
23
|
+
/**
|
|
24
|
+
* The error data that the API sent back in an error event.
|
|
25
|
+
*/
|
|
26
|
+
error?: LiveAPI.ErrorEvent | undefined;
|
|
27
|
+
|
|
28
|
+
constructor(message: string, event: LiveAPI.ErrorEvent | null) {
|
|
29
|
+
super(message);
|
|
30
|
+
|
|
31
|
+
this.error = event ?? undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
36
|
+
|
|
37
|
+
type WebSocketEvents = Simplify<
|
|
38
|
+
{
|
|
39
|
+
event: (event: ForksAPI.ForkServerEvent) => void;
|
|
40
|
+
raw: (data: RawWebSocketData) => void;
|
|
41
|
+
error: (error: WebSocketError) => void;
|
|
42
|
+
close: (code: number, reason: string, unsent: UnsentMessage<ForksAPI.ForkClientEvent>[]) => void;
|
|
43
|
+
reconnecting: (event: ReconnectingEvent<ForksWSParameters>) => void;
|
|
44
|
+
reconnected: () => void;
|
|
45
|
+
} & {
|
|
46
|
+
[EventType in Exclude<NonNullable<ForksAPI.ForkServerEvent['type']>, 'error'>]: (
|
|
47
|
+
event: Extract<ForksAPI.ForkServerEvent, { type?: EventType }>,
|
|
48
|
+
) => unknown;
|
|
49
|
+
}
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
export abstract class ForksEmitter extends EventEmitter<WebSocketEvents> {
|
|
53
|
+
/**
|
|
54
|
+
* Send an event to the API.
|
|
55
|
+
*/
|
|
56
|
+
abstract send(event: ForksAPI.ForkClientEvent): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Send raw data over the WebSocket without JSON serialization.
|
|
60
|
+
*/
|
|
61
|
+
abstract sendRaw(data: RawWebSocketData): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Close the WebSocket connection.
|
|
65
|
+
*/
|
|
66
|
+
abstract close(props?: { code: number; reason: string }): void;
|
|
67
|
+
|
|
68
|
+
protected _onError(event: null, message: string, cause: any): void;
|
|
69
|
+
protected _onError(event: LiveAPI.ErrorEvent, message?: string | undefined): void;
|
|
70
|
+
protected _onError(event: LiveAPI.ErrorEvent | null, message?: string | undefined, cause?: any): void {
|
|
71
|
+
message = message ?? safeJSONStringify(event) ?? 'unknown error';
|
|
72
|
+
|
|
73
|
+
if (!this._hasListener('error')) {
|
|
74
|
+
const error = new WebSocketError(
|
|
75
|
+
message +
|
|
76
|
+
`\n\nTo resolve these unhandled rejection errors you should bind an \`error\` callback, e.g. \`ws.on('error', (error) => ...)\` `,
|
|
77
|
+
event,
|
|
78
|
+
);
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
error.cause = cause;
|
|
81
|
+
Promise.reject(error);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const error = new WebSocketError(message, event);
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
error.cause = cause;
|
|
88
|
+
|
|
89
|
+
this._emit('error', error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function buildURL(client: OpenAI, parameters: Record<string, unknown>): URL {
|
|
94
|
+
const { session_id: path0, ...query } = parameters;
|
|
95
|
+
const endpoint = path`/live/sessions/${path0}/fork`;
|
|
96
|
+
const url = new URL(client.buildURL(endpoint, query, undefined));
|
|
97
|
+
url.protocol = url.protocol === 'http:' || url.protocol === 'ws:' ? 'ws:' : 'wss:';
|
|
98
|
+
return url;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function safeJSONStringify(value: unknown): string | null {
|
|
102
|
+
try {
|
|
103
|
+
return JSON.stringify(value);
|
|
104
|
+
} catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|