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.
Files changed (330) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/helpers/live.d.mts +2 -0
  11. package/helpers/live.d.mts.map +1 -0
  12. package/helpers/live.d.ts +2 -0
  13. package/helpers/live.d.ts.map +1 -0
  14. package/helpers/live.js +6 -0
  15. package/helpers/live.js.map +1 -0
  16. package/helpers/live.mjs +2 -0
  17. package/helpers/live.mjs.map +1 -0
  18. package/lib/live/transcript-grouper.d.mts +96 -0
  19. package/lib/live/transcript-grouper.d.mts.map +1 -0
  20. package/lib/live/transcript-grouper.d.ts +96 -0
  21. package/lib/live/transcript-grouper.d.ts.map +1 -0
  22. package/lib/live/transcript-grouper.js +223 -0
  23. package/lib/live/transcript-grouper.js.map +1 -0
  24. package/lib/live/transcript-grouper.mjs +219 -0
  25. package/lib/live/transcript-grouper.mjs.map +1 -0
  26. package/lib/live/transcript-grouping.d.mts +49 -0
  27. package/lib/live/transcript-grouping.d.mts.map +1 -0
  28. package/lib/live/transcript-grouping.d.ts +49 -0
  29. package/lib/live/transcript-grouping.d.ts.map +1 -0
  30. package/lib/live/transcript-grouping.js +287 -0
  31. package/lib/live/transcript-grouping.js.map +1 -0
  32. package/lib/live/transcript-grouping.mjs +283 -0
  33. package/lib/live/transcript-grouping.mjs.map +1 -0
  34. package/lib/live/webrtc.d.mts +13 -0
  35. package/lib/live/webrtc.d.mts.map +1 -0
  36. package/lib/live/webrtc.d.ts +13 -0
  37. package/lib/live/webrtc.d.ts.map +1 -0
  38. package/lib/live/webrtc.js +16 -0
  39. package/lib/live/webrtc.js.map +1 -0
  40. package/lib/live/webrtc.mjs +10 -0
  41. package/lib/live/webrtc.mjs.map +1 -0
  42. package/lib/realtime/webrtc.d.mts +13 -0
  43. package/lib/realtime/webrtc.d.mts.map +1 -0
  44. package/lib/realtime/webrtc.d.ts +13 -0
  45. package/lib/realtime/webrtc.d.ts.map +1 -0
  46. package/lib/realtime/webrtc.js +16 -0
  47. package/lib/realtime/webrtc.js.map +1 -0
  48. package/lib/realtime/webrtc.mjs +10 -0
  49. package/lib/realtime/webrtc.mjs.map +1 -0
  50. package/lib/webrtc/connection.d.mts +40 -0
  51. package/lib/webrtc/connection.d.mts.map +1 -0
  52. package/lib/webrtc/connection.d.ts +40 -0
  53. package/lib/webrtc/connection.d.ts.map +1 -0
  54. package/lib/webrtc/connection.js +228 -0
  55. package/lib/webrtc/connection.js.map +1 -0
  56. package/lib/webrtc/connection.mjs +224 -0
  57. package/lib/webrtc/connection.mjs.map +1 -0
  58. package/lib/webrtc/data-channel.d.mts +32 -0
  59. package/lib/webrtc/data-channel.d.mts.map +1 -0
  60. package/lib/webrtc/data-channel.d.ts +32 -0
  61. package/lib/webrtc/data-channel.d.ts.map +1 -0
  62. package/lib/webrtc/data-channel.js +125 -0
  63. package/lib/webrtc/data-channel.js.map +1 -0
  64. package/lib/webrtc/data-channel.mjs +121 -0
  65. package/lib/webrtc/data-channel.mjs.map +1 -0
  66. package/lib/webrtc/errors.d.mts +19 -0
  67. package/lib/webrtc/errors.d.mts.map +1 -0
  68. package/lib/webrtc/errors.d.ts +19 -0
  69. package/lib/webrtc/errors.d.ts.map +1 -0
  70. package/lib/webrtc/errors.js +18 -0
  71. package/lib/webrtc/errors.js.map +1 -0
  72. package/lib/webrtc/errors.mjs +14 -0
  73. package/lib/webrtc/errors.mjs.map +1 -0
  74. package/lib/webrtc/subscriptions.d.mts +13 -0
  75. package/lib/webrtc/subscriptions.d.mts.map +1 -0
  76. package/lib/webrtc/subscriptions.d.ts +13 -0
  77. package/lib/webrtc/subscriptions.d.ts.map +1 -0
  78. package/lib/webrtc/subscriptions.js +62 -0
  79. package/lib/webrtc/subscriptions.js.map +1 -0
  80. package/lib/webrtc/subscriptions.mjs +58 -0
  81. package/lib/webrtc/subscriptions.mjs.map +1 -0
  82. package/lib/webrtc/types.d.mts +99 -0
  83. package/lib/webrtc/types.d.mts.map +1 -0
  84. package/lib/webrtc/types.d.ts +99 -0
  85. package/lib/webrtc/types.d.ts.map +1 -0
  86. package/lib/webrtc/types.js +3 -0
  87. package/lib/webrtc/types.js.map +1 -0
  88. package/lib/webrtc/types.mjs +2 -0
  89. package/lib/webrtc/types.mjs.map +1 -0
  90. package/live/webrtc.d.mts +3 -0
  91. package/live/webrtc.d.mts.map +1 -0
  92. package/live/webrtc.d.ts +3 -0
  93. package/live/webrtc.d.ts.map +1 -0
  94. package/live/webrtc.js +8 -0
  95. package/live/webrtc.js.map +1 -0
  96. package/live/webrtc.mjs +2 -0
  97. package/live/webrtc.mjs.map +1 -0
  98. package/package.json +11 -1
  99. package/realtime/webrtc.d.mts +3 -0
  100. package/realtime/webrtc.d.mts.map +1 -0
  101. package/realtime/webrtc.d.ts +3 -0
  102. package/realtime/webrtc.d.ts.map +1 -0
  103. package/realtime/webrtc.js +8 -0
  104. package/realtime/webrtc.js.map +1 -0
  105. package/realtime/webrtc.mjs +2 -0
  106. package/realtime/webrtc.mjs.map +1 -0
  107. package/resources/beta/responses/responses.d.mts +48 -0
  108. package/resources/beta/responses/responses.d.mts.map +1 -1
  109. package/resources/beta/responses/responses.d.ts +48 -0
  110. package/resources/beta/responses/responses.d.ts.map +1 -1
  111. package/resources/beta/responses/responses.js.map +1 -1
  112. package/resources/beta/responses/responses.mjs.map +1 -1
  113. package/resources/conversations/items.d.mts +16 -0
  114. package/resources/conversations/items.d.mts.map +1 -1
  115. package/resources/conversations/items.d.ts +16 -0
  116. package/resources/conversations/items.d.ts.map +1 -1
  117. package/resources/index.d.mts +1 -0
  118. package/resources/index.d.mts.map +1 -1
  119. package/resources/index.d.ts +1 -0
  120. package/resources/index.d.ts.map +1 -1
  121. package/resources/index.js +3 -1
  122. package/resources/index.js.map +1 -1
  123. package/resources/index.mjs +1 -0
  124. package/resources/index.mjs.map +1 -1
  125. package/resources/live/forks/forks.d.mts +110 -0
  126. package/resources/live/forks/forks.d.mts.map +1 -0
  127. package/resources/live/forks/forks.d.ts +110 -0
  128. package/resources/live/forks/forks.d.ts.map +1 -0
  129. package/resources/live/forks/forks.js +9 -0
  130. package/resources/live/forks/forks.js.map +1 -0
  131. package/resources/live/forks/forks.mjs +5 -0
  132. package/resources/live/forks/forks.mjs.map +1 -0
  133. package/resources/live/forks/index.d.mts +4 -0
  134. package/resources/live/forks/index.d.mts.map +1 -0
  135. package/resources/live/forks/index.d.ts +4 -0
  136. package/resources/live/forks/index.d.ts.map +1 -0
  137. package/resources/live/forks/index.js +7 -0
  138. package/resources/live/forks/index.js.map +1 -0
  139. package/resources/live/forks/index.mjs +3 -0
  140. package/resources/live/forks/index.mjs.map +1 -0
  141. package/resources/live/forks/internal-base.d.mts +73 -0
  142. package/resources/live/forks/internal-base.d.mts.map +1 -0
  143. package/resources/live/forks/internal-base.d.ts +73 -0
  144. package/resources/live/forks/internal-base.d.ts.map +1 -0
  145. package/resources/live/forks/internal-base.js +49 -0
  146. package/resources/live/forks/internal-base.js.map +1 -0
  147. package/resources/live/forks/internal-base.mjs +43 -0
  148. package/resources/live/forks/internal-base.mjs.map +1 -0
  149. package/resources/live/forks/ws-base.d.mts +109 -0
  150. package/resources/live/forks/ws-base.d.mts.map +1 -0
  151. package/resources/live/forks/ws-base.d.ts +109 -0
  152. package/resources/live/forks/ws-base.d.ts.map +1 -0
  153. package/resources/live/forks/ws-base.js +476 -0
  154. package/resources/live/forks/ws-base.js.map +1 -0
  155. package/resources/live/forks/ws-base.mjs +472 -0
  156. package/resources/live/forks/ws-base.mjs.map +1 -0
  157. package/resources/live/forks/ws.d.mts +13 -0
  158. package/resources/live/forks/ws.d.mts.map +1 -0
  159. package/resources/live/forks/ws.d.ts +13 -0
  160. package/resources/live/forks/ws.d.ts.map +1 -0
  161. package/resources/live/forks/ws.js +34 -0
  162. package/resources/live/forks/ws.js.map +1 -0
  163. package/resources/live/forks/ws.mjs +29 -0
  164. package/resources/live/forks/ws.mjs.map +1 -0
  165. package/resources/live/forks.d.mts +2 -0
  166. package/resources/live/forks.d.mts.map +1 -0
  167. package/resources/live/forks.d.ts +2 -0
  168. package/resources/live/forks.d.ts.map +1 -0
  169. package/resources/live/forks.js +6 -0
  170. package/resources/live/forks.js.map +1 -0
  171. package/resources/live/forks.mjs +3 -0
  172. package/resources/live/forks.mjs.map +1 -0
  173. package/resources/live/index.d.mts +7 -0
  174. package/resources/live/index.d.mts.map +1 -0
  175. package/resources/live/index.d.ts +7 -0
  176. package/resources/live/index.d.ts.map +1 -0
  177. package/resources/live/index.js +13 -0
  178. package/resources/live/index.js.map +1 -0
  179. package/resources/live/index.mjs +6 -0
  180. package/resources/live/index.mjs.map +1 -0
  181. package/resources/live/internal-base.d.mts +71 -0
  182. package/resources/live/internal-base.d.mts.map +1 -0
  183. package/resources/live/internal-base.d.ts +71 -0
  184. package/resources/live/internal-base.d.ts.map +1 -0
  185. package/resources/live/internal-base.js +48 -0
  186. package/resources/live/internal-base.js.map +1 -0
  187. package/resources/live/internal-base.mjs +42 -0
  188. package/resources/live/internal-base.mjs.map +1 -0
  189. package/resources/live/live.d.mts +1864 -0
  190. package/resources/live/live.d.mts.map +1 -0
  191. package/resources/live/live.d.ts +1864 -0
  192. package/resources/live/live.d.ts.map +1 -0
  193. package/resources/live/live.js +40 -0
  194. package/resources/live/live.js.map +1 -0
  195. package/resources/live/live.mjs +35 -0
  196. package/resources/live/live.mjs.map +1 -0
  197. package/resources/live/sessions.d.mts +254 -0
  198. package/resources/live/sessions.d.mts.map +1 -0
  199. package/resources/live/sessions.d.ts +254 -0
  200. package/resources/live/sessions.d.ts.map +1 -0
  201. package/resources/live/sessions.js +118 -0
  202. package/resources/live/sessions.js.map +1 -0
  203. package/resources/live/sessions.mjs +114 -0
  204. package/resources/live/sessions.mjs.map +1 -0
  205. package/resources/live/sideband/index.d.mts +4 -0
  206. package/resources/live/sideband/index.d.mts.map +1 -0
  207. package/resources/live/sideband/index.d.ts +4 -0
  208. package/resources/live/sideband/index.d.ts.map +1 -0
  209. package/resources/live/sideband/index.js +7 -0
  210. package/resources/live/sideband/index.js.map +1 -0
  211. package/resources/live/sideband/index.mjs +3 -0
  212. package/resources/live/sideband/index.mjs.map +1 -0
  213. package/resources/live/sideband/internal-base.d.mts +73 -0
  214. package/resources/live/sideband/internal-base.d.mts.map +1 -0
  215. package/resources/live/sideband/internal-base.d.ts +73 -0
  216. package/resources/live/sideband/internal-base.d.ts.map +1 -0
  217. package/resources/live/sideband/internal-base.js +49 -0
  218. package/resources/live/sideband/internal-base.js.map +1 -0
  219. package/resources/live/sideband/internal-base.mjs +43 -0
  220. package/resources/live/sideband/internal-base.mjs.map +1 -0
  221. package/resources/live/sideband/sideband.d.mts +25 -0
  222. package/resources/live/sideband/sideband.d.mts.map +1 -0
  223. package/resources/live/sideband/sideband.d.ts +25 -0
  224. package/resources/live/sideband/sideband.d.ts.map +1 -0
  225. package/resources/live/sideband/sideband.js +9 -0
  226. package/resources/live/sideband/sideband.js.map +1 -0
  227. package/resources/live/sideband/sideband.mjs +5 -0
  228. package/resources/live/sideband/sideband.mjs.map +1 -0
  229. package/resources/live/sideband/ws-base.d.mts +114 -0
  230. package/resources/live/sideband/ws-base.d.mts.map +1 -0
  231. package/resources/live/sideband/ws-base.d.ts +114 -0
  232. package/resources/live/sideband/ws-base.d.ts.map +1 -0
  233. package/resources/live/sideband/ws-base.js +476 -0
  234. package/resources/live/sideband/ws-base.js.map +1 -0
  235. package/resources/live/sideband/ws-base.mjs +472 -0
  236. package/resources/live/sideband/ws-base.mjs.map +1 -0
  237. package/resources/live/sideband/ws.d.mts +13 -0
  238. package/resources/live/sideband/ws.d.mts.map +1 -0
  239. package/resources/live/sideband/ws.d.ts +13 -0
  240. package/resources/live/sideband/ws.d.ts.map +1 -0
  241. package/resources/live/sideband/ws.js +34 -0
  242. package/resources/live/sideband/ws.js.map +1 -0
  243. package/resources/live/sideband/ws.mjs +29 -0
  244. package/resources/live/sideband/ws.mjs.map +1 -0
  245. package/resources/live/sideband.d.mts +2 -0
  246. package/resources/live/sideband.d.mts.map +1 -0
  247. package/resources/live/sideband.d.ts +2 -0
  248. package/resources/live/sideband.d.ts.map +1 -0
  249. package/resources/live/sideband.js +6 -0
  250. package/resources/live/sideband.js.map +1 -0
  251. package/resources/live/sideband.mjs +3 -0
  252. package/resources/live/sideband.mjs.map +1 -0
  253. package/resources/live/ws-base.d.mts +106 -0
  254. package/resources/live/ws-base.d.mts.map +1 -0
  255. package/resources/live/ws-base.d.ts +106 -0
  256. package/resources/live/ws-base.d.ts.map +1 -0
  257. package/resources/live/ws-base.js +476 -0
  258. package/resources/live/ws-base.js.map +1 -0
  259. package/resources/live/ws-base.mjs +472 -0
  260. package/resources/live/ws-base.mjs.map +1 -0
  261. package/resources/live/ws.d.mts +13 -0
  262. package/resources/live/ws.d.mts.map +1 -0
  263. package/resources/live/ws.d.ts +13 -0
  264. package/resources/live/ws.d.ts.map +1 -0
  265. package/resources/live/ws.js +34 -0
  266. package/resources/live/ws.js.map +1 -0
  267. package/resources/live/ws.mjs +29 -0
  268. package/resources/live/ws.mjs.map +1 -0
  269. package/resources/live.d.mts +2 -0
  270. package/resources/live.d.mts.map +1 -0
  271. package/resources/live.d.ts +2 -0
  272. package/resources/live.d.ts.map +1 -0
  273. package/resources/live.js +6 -0
  274. package/resources/live.js.map +1 -0
  275. package/resources/live.mjs +3 -0
  276. package/resources/live.mjs.map +1 -0
  277. package/resources/responses/responses.d.mts +48 -0
  278. package/resources/responses/responses.d.mts.map +1 -1
  279. package/resources/responses/responses.d.ts +48 -0
  280. package/resources/responses/responses.d.ts.map +1 -1
  281. package/resources/responses/responses.js.map +1 -1
  282. package/resources/responses/responses.mjs.map +1 -1
  283. package/resources/webhooks/webhooks.d.mts +72 -5
  284. package/resources/webhooks/webhooks.d.mts.map +1 -1
  285. package/resources/webhooks/webhooks.d.ts +72 -5
  286. package/resources/webhooks/webhooks.d.ts.map +1 -1
  287. package/src/client.ts +5 -0
  288. package/src/helpers/live.ts +8 -0
  289. package/src/lib/live/transcript-grouper.ts +303 -0
  290. package/src/lib/live/transcript-grouping.ts +362 -0
  291. package/src/lib/live/webrtc.ts +23 -0
  292. package/src/lib/realtime/webrtc.ts +20 -0
  293. package/src/lib/webrtc/connection.ts +309 -0
  294. package/src/lib/webrtc/data-channel.ts +144 -0
  295. package/src/lib/webrtc/errors.ts +38 -0
  296. package/src/lib/webrtc/subscriptions.ts +62 -0
  297. package/src/lib/webrtc/types.ts +109 -0
  298. package/src/live/webrtc.ts +10 -0
  299. package/src/realtime/webrtc.ts +10 -0
  300. package/src/resources/beta/responses/responses.ts +60 -0
  301. package/src/resources/conversations/items.ts +20 -0
  302. package/src/resources/index.ts +1 -0
  303. package/src/resources/live/api.md +87 -0
  304. package/src/resources/live/forks/forks.ts +169 -0
  305. package/src/resources/live/forks/index.ts +5 -0
  306. package/src/resources/live/forks/internal-base.ts +107 -0
  307. package/src/resources/live/forks/ws-base.ts +611 -0
  308. package/src/resources/live/forks/ws.ts +46 -0
  309. package/src/resources/live/forks.ts +3 -0
  310. package/src/resources/live/index.ts +20 -0
  311. package/src/resources/live/internal-base.ts +104 -0
  312. package/src/resources/live/live.ts +2296 -0
  313. package/src/resources/live/sessions.ts +337 -0
  314. package/src/resources/live/sideband/index.ts +10 -0
  315. package/src/resources/live/sideband/internal-base.ts +107 -0
  316. package/src/resources/live/sideband/sideband.ts +58 -0
  317. package/src/resources/live/sideband/ws-base.ts +621 -0
  318. package/src/resources/live/sideband/ws.ts +46 -0
  319. package/src/resources/live/sideband.ts +3 -0
  320. package/src/resources/live/ws-base.ts +607 -0
  321. package/src/resources/live/ws.ts +42 -0
  322. package/src/resources/live.ts +3 -0
  323. package/src/resources/responses/responses.ts +60 -0
  324. package/src/resources/webhooks/api.md +1 -0
  325. package/src/resources/webhooks/webhooks.ts +82 -3
  326. package/src/version.ts +1 -1
  327. package/version.d.mts +1 -1
  328. package/version.d.ts +1 -1
  329. package/version.js +1 -1
  330. package/version.mjs +1 -1
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Sessions = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Sessions extends resource_1.APIResource {
9
+ /**
10
+ * Accept an incoming SIP call with Live startup configuration.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * await client.live.sessions.accept('session_id', {
15
+ * session: { model: 'gpt-live-1', type: 'live' },
16
+ * });
17
+ * ```
18
+ */
19
+ accept(sessionID, body, options) {
20
+ return this._client.post((0, path_1.path) `/live/sessions/${sessionID}/accept`, {
21
+ body,
22
+ ...options,
23
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
24
+ __security: { bearerAuth: true },
25
+ });
26
+ }
27
+ /**
28
+ * Get Live session content
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response =
33
+ * await client.live.sessions.downloadRecording('live_SQ');
34
+ *
35
+ * const content = await response.blob();
36
+ * console.log(content);
37
+ * ```
38
+ */
39
+ downloadRecording(sessionID, options) {
40
+ return this._client.get((0, path_1.path) `/live/sessions/${sessionID}/content`, {
41
+ ...options,
42
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'application/binary' }, options?.headers]),
43
+ __security: { bearerAuth: true },
44
+ __binaryResponse: true,
45
+ });
46
+ }
47
+ /**
48
+ * Fork a stored Live session onto a new WebRTC connection.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const response = await client.live.sessions.fork(
53
+ * 'session_id',
54
+ * { transport: { sdp: 'x', type: 'webrtc' } },
55
+ * );
56
+ * ```
57
+ */
58
+ fork(sessionID, body, options) {
59
+ return this._client.post((0, path_1.path) `/live/sessions/${sessionID}/fork`, {
60
+ body,
61
+ ...options,
62
+ __security: { bearerAuth: true },
63
+ });
64
+ }
65
+ /**
66
+ * Hang up a Live session.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * await client.live.sessions.hangup('session_id');
71
+ * ```
72
+ */
73
+ hangup(sessionID, options) {
74
+ return this._client.post((0, path_1.path) `/live/sessions/${sessionID}/hangup`, {
75
+ ...options,
76
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
77
+ __security: { bearerAuth: true },
78
+ });
79
+ }
80
+ /**
81
+ * Transfer a Live SIP call to another destination.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await client.live.sessions.refer('session_id', {
86
+ * target_uri: 'tel:+14155550123',
87
+ * });
88
+ * ```
89
+ */
90
+ refer(sessionID, body, options) {
91
+ return this._client.post((0, path_1.path) `/live/sessions/${sessionID}/refer`, {
92
+ body,
93
+ ...options,
94
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
95
+ __security: { bearerAuth: true },
96
+ });
97
+ }
98
+ /**
99
+ * Reject an incoming SIP call.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * await client.live.sessions.reject('session_id', {
104
+ * status_code: 486,
105
+ * });
106
+ * ```
107
+ */
108
+ reject(sessionID, body, options) {
109
+ return this._client.post((0, path_1.path) `/live/sessions/${sessionID}/reject`, {
110
+ body,
111
+ ...options,
112
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
113
+ __security: { bearerAuth: true },
114
+ });
115
+ }
116
+ }
117
+ exports.Sessions = Sessions;
118
+ //# sourceMappingURL=sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/resources/live/sessions.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,qDAAkD;AAGlD,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AS,SAAS,EAAE;YACjE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,SAAiB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,SAAS,QAAQ,EAAE;YAChE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,SAAS,SAAS,EAAE;YACjE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AArHD,4BAqHC"}
@@ -0,0 +1,114 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Sessions extends APIResource {
6
+ /**
7
+ * Accept an incoming SIP call with Live startup configuration.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * await client.live.sessions.accept('session_id', {
12
+ * session: { model: 'gpt-live-1', type: 'live' },
13
+ * });
14
+ * ```
15
+ */
16
+ accept(sessionID, body, options) {
17
+ return this._client.post(path `/live/sessions/${sessionID}/accept`, {
18
+ body,
19
+ ...options,
20
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
+ __security: { bearerAuth: true },
22
+ });
23
+ }
24
+ /**
25
+ * Get Live session content
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const response =
30
+ * await client.live.sessions.downloadRecording('live_SQ');
31
+ *
32
+ * const content = await response.blob();
33
+ * console.log(content);
34
+ * ```
35
+ */
36
+ downloadRecording(sessionID, options) {
37
+ return this._client.get(path `/live/sessions/${sessionID}/content`, {
38
+ ...options,
39
+ headers: buildHeaders([{ Accept: 'application/binary' }, options?.headers]),
40
+ __security: { bearerAuth: true },
41
+ __binaryResponse: true,
42
+ });
43
+ }
44
+ /**
45
+ * Fork a stored Live session onto a new WebRTC connection.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const response = await client.live.sessions.fork(
50
+ * 'session_id',
51
+ * { transport: { sdp: 'x', type: 'webrtc' } },
52
+ * );
53
+ * ```
54
+ */
55
+ fork(sessionID, body, options) {
56
+ return this._client.post(path `/live/sessions/${sessionID}/fork`, {
57
+ body,
58
+ ...options,
59
+ __security: { bearerAuth: true },
60
+ });
61
+ }
62
+ /**
63
+ * Hang up a Live session.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * await client.live.sessions.hangup('session_id');
68
+ * ```
69
+ */
70
+ hangup(sessionID, options) {
71
+ return this._client.post(path `/live/sessions/${sessionID}/hangup`, {
72
+ ...options,
73
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
74
+ __security: { bearerAuth: true },
75
+ });
76
+ }
77
+ /**
78
+ * Transfer a Live SIP call to another destination.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * await client.live.sessions.refer('session_id', {
83
+ * target_uri: 'tel:+14155550123',
84
+ * });
85
+ * ```
86
+ */
87
+ refer(sessionID, body, options) {
88
+ return this._client.post(path `/live/sessions/${sessionID}/refer`, {
89
+ body,
90
+ ...options,
91
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
92
+ __security: { bearerAuth: true },
93
+ });
94
+ }
95
+ /**
96
+ * Reject an incoming SIP call.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * await client.live.sessions.reject('session_id', {
101
+ * status_code: 486,
102
+ * });
103
+ * ```
104
+ */
105
+ reject(sessionID, body, options) {
106
+ return this._client.post(path `/live/sessions/${sessionID}/reject`, {
107
+ body,
108
+ ...options,
109
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
110
+ __security: { bearerAuth: true },
111
+ });
112
+ }
113
+ }
114
+ //# sourceMappingURL=sessions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.mjs","sourceRoot":"","sources":["../../src/resources/live/sessions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,SAAS,SAAS,EAAE;YACjE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,SAAiB,EAAE,OAAwB;QAC3D,OAAO,I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AI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,SAAS,SAAS,EAAE;YACjE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { Sideband, type ConnectClientEvent, type ConnectServerEvent, type SidebandConnectParams, } from "./sideband.mjs";
2
+ export { type SidebandWSClientOptions } from "./ws.mjs";
3
+ export { type SidebandWSReconnectOptions, type SidebandWSParameters } from "./ws-base.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/live/sideband/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,uBAAmB;AACpB,OAAO,EAAE,KAAK,uBAAuB,EAAE,iBAAa;AACpD,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,sBAAkB"}
@@ -0,0 +1,4 @@
1
+ export { Sideband, type ConnectClientEvent, type ConnectServerEvent, type SidebandConnectParams, } from "./sideband.js";
2
+ export { type SidebandWSClientOptions } from "./ws.js";
3
+ export { type SidebandWSReconnectOptions, type SidebandWSParameters } from "./ws-base.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/live/sideband/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,sBAAmB;AACpB,OAAO,EAAE,KAAK,uBAAuB,EAAE,gBAAa;AACpD,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,qBAAkB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Sideband = void 0;
5
+ var sideband_1 = require("./sideband.js");
6
+ Object.defineProperty(exports, "Sideband", { enumerable: true, get: function () { return sideband_1.Sideband; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/live/sideband/index.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,0CAKoB;AAJlB,oGAAA,QAAQ,OAAA"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+ export { Sideband, } from "./sideband.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/live/sideband/index.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EACL,QAAQ,GAIT,uBAAmB"}
@@ -0,0 +1,73 @@
1
+ import * as LiveAPI from "../live.mjs";
2
+ import * as SidebandAPI from "./sideband.mjs";
3
+ import { OpenAI } from "../../../client.mjs";
4
+ import { EventEmitter } from "../../../core/EventEmitter.mjs";
5
+ import { OpenAIError } from "../../../core/error.mjs";
6
+ import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from "../../../internal/ws.mjs";
7
+ import { SidebandWSParameters } from "./ws-base.mjs";
8
+ export type SidebandStreamMessage = {
9
+ type: 'connecting' | 'open' | 'closing';
10
+ } | {
11
+ type: 'close';
12
+ code: number;
13
+ reason: string;
14
+ unsent: UnsentMessage<SidebandAPI.ConnectClientEvent>[];
15
+ } | {
16
+ type: 'reconnecting';
17
+ reconnect: ReconnectingEvent<SidebandWSParameters>;
18
+ } | {
19
+ type: 'reconnected';
20
+ } | {
21
+ type: 'message';
22
+ message: SidebandAPI.ConnectServerEvent;
23
+ } | {
24
+ type: 'raw';
25
+ data: RawWebSocketData;
26
+ } | {
27
+ type: 'error';
28
+ error: WebSocketError;
29
+ };
30
+ export declare class WebSocketError extends OpenAIError {
31
+ /**
32
+ * The error data that the API sent back in an error event.
33
+ */
34
+ error?: LiveAPI.ErrorEvent | undefined;
35
+ constructor(message: string, event: LiveAPI.ErrorEvent | null);
36
+ }
37
+ type Simplify<T> = {
38
+ [KeyType in keyof T]: T[KeyType];
39
+ } & {};
40
+ type WebSocketEvents = Simplify<{
41
+ event: (event: SidebandAPI.ConnectServerEvent) => void;
42
+ raw: (data: RawWebSocketData) => void;
43
+ error: (error: WebSocketError) => void;
44
+ close: (code: number, reason: string, unsent: UnsentMessage<SidebandAPI.ConnectClientEvent>[]) => void;
45
+ reconnecting: (event: ReconnectingEvent<SidebandWSParameters>) => void;
46
+ reconnected: () => void;
47
+ } & {
48
+ [EventType in Exclude<NonNullable<SidebandAPI.ConnectServerEvent['type']>, 'error'>]: (event: Extract<SidebandAPI.ConnectServerEvent, {
49
+ type?: EventType;
50
+ }>) => unknown;
51
+ }>;
52
+ export declare abstract class SidebandEmitter extends EventEmitter<WebSocketEvents> {
53
+ /**
54
+ * Send an event to the API.
55
+ */
56
+ abstract send(event: SidebandAPI.ConnectClientEvent): void;
57
+ /**
58
+ * Send raw data over the WebSocket without JSON serialization.
59
+ */
60
+ abstract sendRaw(data: RawWebSocketData): void;
61
+ /**
62
+ * Close the WebSocket connection.
63
+ */
64
+ abstract close(props?: {
65
+ code: number;
66
+ reason: string;
67
+ }): void;
68
+ protected _onError(event: null, message: string, cause: any): void;
69
+ protected _onError(event: LiveAPI.ErrorEvent, message?: string | undefined): void;
70
+ }
71
+ export declare function buildURL(client: OpenAI, parameters: Record<string, unknown>): URL;
72
+ export {};
73
+ //# sourceMappingURL=internal-base.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-base.d.mts","sourceRoot":"","sources":["../../../src/resources/live/sideband/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,oBAAgB;AACnC,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAE,MAAM,EAAE,4BAAwB;AACzC,OAAO,EAAE,YAAY,EAAE,uCAAmC;AAC1D,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,iCAA6B;AAC/F,OAAO,EAAE,oBAAoB,EAAE,sBAAkB;AAEjD,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,CAAA;CAAE,GACxG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAA;CAAE,GAC5E;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7C,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,OAA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,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAE9D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAClE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAsBlF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAMjF"}
@@ -0,0 +1,73 @@
1
+ import * as LiveAPI from "../live.js";
2
+ import * as SidebandAPI from "./sideband.js";
3
+ import { OpenAI } from "../../../client.js";
4
+ import { EventEmitter } from "../../../core/EventEmitter.js";
5
+ import { OpenAIError } from "../../../core/error.js";
6
+ import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from "../../../internal/ws.js";
7
+ import { SidebandWSParameters } from "./ws-base.js";
8
+ export type SidebandStreamMessage = {
9
+ type: 'connecting' | 'open' | 'closing';
10
+ } | {
11
+ type: 'close';
12
+ code: number;
13
+ reason: string;
14
+ unsent: UnsentMessage<SidebandAPI.ConnectClientEvent>[];
15
+ } | {
16
+ type: 'reconnecting';
17
+ reconnect: ReconnectingEvent<SidebandWSParameters>;
18
+ } | {
19
+ type: 'reconnected';
20
+ } | {
21
+ type: 'message';
22
+ message: SidebandAPI.ConnectServerEvent;
23
+ } | {
24
+ type: 'raw';
25
+ data: RawWebSocketData;
26
+ } | {
27
+ type: 'error';
28
+ error: WebSocketError;
29
+ };
30
+ export declare class WebSocketError extends OpenAIError {
31
+ /**
32
+ * The error data that the API sent back in an error event.
33
+ */
34
+ error?: LiveAPI.ErrorEvent | undefined;
35
+ constructor(message: string, event: LiveAPI.ErrorEvent | null);
36
+ }
37
+ type Simplify<T> = {
38
+ [KeyType in keyof T]: T[KeyType];
39
+ } & {};
40
+ type WebSocketEvents = Simplify<{
41
+ event: (event: SidebandAPI.ConnectServerEvent) => void;
42
+ raw: (data: RawWebSocketData) => void;
43
+ error: (error: WebSocketError) => void;
44
+ close: (code: number, reason: string, unsent: UnsentMessage<SidebandAPI.ConnectClientEvent>[]) => void;
45
+ reconnecting: (event: ReconnectingEvent<SidebandWSParameters>) => void;
46
+ reconnected: () => void;
47
+ } & {
48
+ [EventType in Exclude<NonNullable<SidebandAPI.ConnectServerEvent['type']>, 'error'>]: (event: Extract<SidebandAPI.ConnectServerEvent, {
49
+ type?: EventType;
50
+ }>) => unknown;
51
+ }>;
52
+ export declare abstract class SidebandEmitter extends EventEmitter<WebSocketEvents> {
53
+ /**
54
+ * Send an event to the API.
55
+ */
56
+ abstract send(event: SidebandAPI.ConnectClientEvent): void;
57
+ /**
58
+ * Send raw data over the WebSocket without JSON serialization.
59
+ */
60
+ abstract sendRaw(data: RawWebSocketData): void;
61
+ /**
62
+ * Close the WebSocket connection.
63
+ */
64
+ abstract close(props?: {
65
+ code: number;
66
+ reason: string;
67
+ }): void;
68
+ protected _onError(event: null, message: string, cause: any): void;
69
+ protected _onError(event: LiveAPI.ErrorEvent, message?: string | undefined): void;
70
+ }
71
+ export declare function buildURL(client: OpenAI, parameters: Record<string, unknown>): URL;
72
+ export {};
73
+ //# sourceMappingURL=internal-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-base.d.ts","sourceRoot":"","sources":["../../../src/resources/live/sideband/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,mBAAgB;AACnC,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EAAE,MAAM,EAAE,2BAAwB;AACzC,OAAO,EAAE,YAAY,EAAE,sCAAmC;AAC1D,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAGlD,OAAO,KAAK,EAAE,gBAA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,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAMjF"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SidebandEmitter = exports.WebSocketError = void 0;
5
+ exports.buildURL = buildURL;
6
+ const EventEmitter_1 = require("../../../core/EventEmitter.js");
7
+ const error_1 = require("../../../core/error.js");
8
+ const path_1 = require("../../../internal/utils/path.js");
9
+ class WebSocketError extends error_1.OpenAIError {
10
+ constructor(message, event) {
11
+ super(message);
12
+ this.error = event ?? undefined;
13
+ }
14
+ }
15
+ exports.WebSocketError = WebSocketError;
16
+ class SidebandEmitter extends EventEmitter_1.EventEmitter {
17
+ _onError(event, message, cause) {
18
+ message = message ?? safeJSONStringify(event) ?? 'unknown error';
19
+ if (!this._hasListener('error')) {
20
+ const error = new WebSocketError(message +
21
+ `\n\nTo resolve these unhandled rejection errors you should bind an \`error\` callback, e.g. \`ws.on('error', (error) => ...)\` `, event);
22
+ // @ts-ignore
23
+ error.cause = cause;
24
+ Promise.reject(error);
25
+ return;
26
+ }
27
+ const error = new WebSocketError(message, event);
28
+ // @ts-ignore
29
+ error.cause = cause;
30
+ this._emit('error', error);
31
+ }
32
+ }
33
+ exports.SidebandEmitter = SidebandEmitter;
34
+ function buildURL(client, parameters) {
35
+ const { session_id: path0, ...query } = parameters;
36
+ const endpoint = (0, path_1.path) `/live/sessions/${path0}/attach`;
37
+ const url = new URL(client.buildURL(endpoint, query, undefined));
38
+ url.protocol = url.protocol === 'http:' || url.protocol === 'ws:' ? 'ws:' : 'wss:';
39
+ return url;
40
+ }
41
+ function safeJSONStringify(value) {
42
+ try {
43
+ return JSON.stringify(value);
44
+ }
45
+ catch {
46
+ return null;
47
+ }
48
+ }
49
+ //# sourceMappingURL=internal-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-base.js","sourceRoot":"","sources":["../../../src/resources/live/s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AAK,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACnF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,43 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+ import { EventEmitter } from "../../../core/EventEmitter.mjs";
3
+ import { OpenAIError } from "../../../core/error.mjs";
4
+ import { path } from "../../../internal/utils/path.mjs";
5
+ export class WebSocketError extends OpenAIError {
6
+ constructor(message, event) {
7
+ super(message);
8
+ this.error = event ?? undefined;
9
+ }
10
+ }
11
+ export class SidebandEmitter extends EventEmitter {
12
+ _onError(event, message, cause) {
13
+ message = message ?? safeJSONStringify(event) ?? 'unknown error';
14
+ if (!this._hasListener('error')) {
15
+ const error = new WebSocketError(message +
16
+ `\n\nTo resolve these unhandled rejection errors you should bind an \`error\` callback, e.g. \`ws.on('error', (error) => ...)\` `, event);
17
+ // @ts-ignore
18
+ error.cause = cause;
19
+ Promise.reject(error);
20
+ return;
21
+ }
22
+ const error = new WebSocketError(message, event);
23
+ // @ts-ignore
24
+ error.cause = cause;
25
+ this._emit('error', error);
26
+ }
27
+ }
28
+ export function buildURL(client, parameters) {
29
+ const { session_id: path0, ...query } = parameters;
30
+ const endpoint = path `/live/sessions/${path0}/attach`;
31
+ const url = new URL(client.buildURL(endpoint, query, undefined));
32
+ url.protocol = url.protocol === 'http:' || url.protocol === 'ws:' ? 'ws:' : 'wss:';
33
+ return url;
34
+ }
35
+ function safeJSONStringify(value) {
36
+ try {
37
+ return JSON.stringify(value);
38
+ }
39
+ catch {
40
+ return null;
41
+ }
42
+ }
43
+ //# sourceMappingURL=internal-base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-base.mjs","sourceRoot":"","sources":["../../../src/resources/live/sideband/internal-base.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAKrF,OAAO,EAAE,YAAY,EAAE,uCAAmC;AAC1D,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAcpD,MAAM,OAAO,cAAe,SAAQ,WAAW;IAM7C,YAAY,OAAe,EAAE,KAAgC;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC;IAClC,CAAC;CACF;AAmBD,MAAM,OAAgB,eAAgB,SAAQ,YAA6B;IAkB/D,QAAQ,CAAC,KAAgC,EAAE,OAA4B,EAAE,KAAW;QAC5F,OAAO,GAAG,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC;QAEjE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,KAAK,GAAG,IAAI,cAAc,CAC9B,OAAO;gBACL,iIAAiI,EACnI,KAAK,CACN,CAAC;YACF,aAAa;YACb,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtB,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACjD,aAAa;QACb,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,UAAmC;IAC1E,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAA,kBAAkB,KAAK,SAAS,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACnF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as LiveAPI from "../live.mjs";
3
+ export declare class Sideband extends APIResource {
4
+ }
5
+ /**
6
+ * Client events accepted by an attached Live sideband WebSocket. The session is
7
+ * already started; send audio over the primary connection.
8
+ */
9
+ export type ConnectClientEvent = LiveAPI.SessionUpdateEvent | LiveAPI.InputAudioMuteEvent | LiveAPI.InputAudioUnmuteEvent | LiveAPI.InstructionsAppendEvent | LiveAPI.ThinkingAppendEvent | LiveAPI.CommentaryAppendEvent | LiveAPI.ResponseItemCreateEvent | LiveAPI.ResponseCreateEvent | LiveAPI.SessionCloseEvent;
10
+ /**
11
+ * Server events received by an attached Live sideband WebSocket. Audio deltas are
12
+ * delivered over the primary connection.
13
+ */
14
+ export type ConnectServerEvent = LiveAPI.SessionStartedEvent | LiveAPI.SessionUpdatedEvent | LiveAPI.InputAudioMutedEvent | LiveAPI.InputAudioUnmutedEvent | LiveAPI.InstructionsAppendedEvent | LiveAPI.ThinkingAppendedEvent | LiveAPI.CommentaryAppendedEvent | LiveAPI.InputTranscriptDeltaEvent | LiveAPI.OutputTranscriptDeltaEvent | LiveAPI.DelegationCreatedEvent | LiveAPI.ResponseEvent | LiveAPI.SessionUsageUpdatedEvent | LiveAPI.SessionClosedEvent | LiveAPI.ErrorEvent | LiveAPI.InfoEvent;
15
+ export interface SidebandConnectParams {
16
+ /**
17
+ * Opt in to the graceful WebSocket closing handshake when the session ends. The
18
+ * server may also enable this behavior by default.
19
+ */
20
+ graceful_close?: boolean;
21
+ }
22
+ export declare namespace Sideband {
23
+ export { type ConnectClientEvent as ConnectClientEvent, type ConnectServerEvent as ConnectServerEvent, type SidebandConnectParams as SidebandConnectParams, };
24
+ }
25
+ //# sourceMappingURL=sideband.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sideband.d.mts","sourceRoot":"","sources":["../../../src/resources/live/sideband/sideband.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,OAAO,oBAAgB;AAEnC,qBAAa,QAAS,SAAQ,WAAW;CAAG;AAE5C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,iBAAiB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,GAC9B,OAAO,CAAC,yBAAyB,GACjC,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,GAC9B,OAAO,CAAC,aAAa,GACrB,OAAO,CAAC,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,GAC1B,OAAO,CAAC,UAAU,GAClB,OAAO,CAAC,SAAS,CAAC;AAEtB,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,25 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as LiveAPI from "../live.js";
3
+ export declare class Sideband extends APIResource {
4
+ }
5
+ /**
6
+ * Client events accepted by an attached Live sideband WebSocket. The session is
7
+ * already started; send audio over the primary connection.
8
+ */
9
+ export type ConnectClientEvent = LiveAPI.SessionUpdateEvent | LiveAPI.InputAudioMuteEvent | LiveAPI.InputAudioUnmuteEvent | LiveAPI.InstructionsAppendEvent | LiveAPI.ThinkingAppendEvent | LiveAPI.CommentaryAppendEvent | LiveAPI.ResponseItemCreateEvent | LiveAPI.ResponseCreateEvent | LiveAPI.SessionCloseEvent;
10
+ /**
11
+ * Server events received by an attached Live sideband WebSocket. Audio deltas are
12
+ * delivered over the primary connection.
13
+ */
14
+ export type ConnectServerEvent = LiveAPI.SessionStartedEvent | LiveAPI.SessionUpdatedEvent | LiveAPI.InputAudioMutedEvent | LiveAPI.InputAudioUnmutedEvent | LiveAPI.InstructionsAppendedEvent | LiveAPI.ThinkingAppendedEvent | LiveAPI.CommentaryAppendedEvent | LiveAPI.InputTranscriptDeltaEvent | LiveAPI.OutputTranscriptDeltaEvent | LiveAPI.DelegationCreatedEvent | LiveAPI.ResponseEvent | LiveAPI.SessionUsageUpdatedEvent | LiveAPI.SessionClosedEvent | LiveAPI.ErrorEvent | LiveAPI.InfoEvent;
15
+ export interface SidebandConnectParams {
16
+ /**
17
+ * Opt in to the graceful WebSocket closing handshake when the session ends. The
18
+ * server may also enable this behavior by default.
19
+ */
20
+ graceful_close?: boolean;
21
+ }
22
+ export declare namespace Sideband {
23
+ export { type ConnectClientEvent as ConnectClientEvent, type ConnectServerEvent as ConnectServerEvent, type SidebandConnectParams as SidebandConnectParams, };
24
+ }
25
+ //# sourceMappingURL=sideband.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sideband.d.ts","sourceRoot":"","sources":["../../../src/resources/live/sideband/sideband.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,OAAO,mBAAgB;AAEnC,qBAAa,QAAS,SAAQ,WAAW;CAAG;AAE5C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,iBAAiB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,GAC9B,OAAO,CAAC,yBAAyB,GACjC,OAAO,CAAC,qBAAqB,GAC7B,OAAO,CAAC,uBAAuB,GAC/B,OAAO,CAAC,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,GAC9B,OAAO,CAAC,aAAa,GACrB,OAAO,CAAC,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,GAC1B,OAAO,CAAC,UAAU,GAClB,OAAO,CAAC,SAAS,CAAC;AAEtB,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Sideband = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ class Sideband extends resource_1.APIResource {
7
+ }
8
+ exports.Sideband = Sideband;
9
+ //# sourceMappingURL=sideband.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sideband.js","sourceRoot":"","sources":["../../../src/resources/live/sideband/sideband.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,wDAAqD;AAGrD,MAAa,QAAS,SAAQ,sBAAW;CAAG;AAA5C,4BAA4C"}
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ export class Sideband extends APIResource {
4
+ }
5
+ //# sourceMappingURL=sideband.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sideband.mjs","sourceRoot":"","sources":["../../../src/resources/live/sideband/sideband.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,MAAM,OAAO,QAAS,SAAQ,WAAW;CAAG"}