openai 7.12.1 → 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 (517) hide show
  1. package/CHANGELOG.md +22 -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/admin/organization/audit-logs.d.mts +1 -1
  108. package/resources/admin/organization/audit-logs.d.ts +1 -1
  109. package/resources/admin/organization/projects/api-keys.d.mts +5 -0
  110. package/resources/admin/organization/projects/api-keys.d.mts.map +1 -1
  111. package/resources/admin/organization/projects/api-keys.d.ts +5 -0
  112. package/resources/admin/organization/projects/api-keys.d.ts.map +1 -1
  113. package/resources/admin/organization/projects/projects.d.mts +2 -2
  114. package/resources/admin/organization/projects/projects.d.ts +2 -2
  115. package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts +13 -0
  116. package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts.map +1 -1
  117. package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts +13 -0
  118. package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts.map +1 -1
  119. package/resources/admin/organization/projects/service-accounts/service-accounts.js.map +1 -1
  120. package/resources/admin/organization/projects/service-accounts/service-accounts.mjs.map +1 -1
  121. package/resources/audio/speech.d.mts +3 -2
  122. package/resources/audio/speech.d.mts.map +1 -1
  123. package/resources/audio/speech.d.ts +3 -2
  124. package/resources/audio/speech.d.ts.map +1 -1
  125. package/resources/audio/transcriptions.d.mts +10 -10
  126. package/resources/audio/transcriptions.d.ts +10 -10
  127. package/resources/audio/translations.d.mts +1 -1
  128. package/resources/audio/translations.d.ts +1 -1
  129. package/resources/batches.d.mts +6 -5
  130. package/resources/batches.d.mts.map +1 -1
  131. package/resources/batches.d.ts +6 -5
  132. package/resources/batches.d.ts.map +1 -1
  133. package/resources/beta/assistants.d.mts +143 -147
  134. package/resources/beta/assistants.d.mts.map +1 -1
  135. package/resources/beta/assistants.d.ts +143 -147
  136. package/resources/beta/assistants.d.ts.map +1 -1
  137. package/resources/beta/responses/input-tokens.d.mts +11 -11
  138. package/resources/beta/responses/input-tokens.d.ts +11 -11
  139. package/resources/beta/responses/responses.d.mts +229 -170
  140. package/resources/beta/responses/responses.d.mts.map +1 -1
  141. package/resources/beta/responses/responses.d.ts +229 -170
  142. package/resources/beta/responses/responses.d.ts.map +1 -1
  143. package/resources/beta/responses/responses.js +3 -3
  144. package/resources/beta/responses/responses.js.map +1 -1
  145. package/resources/beta/responses/responses.mjs +3 -3
  146. package/resources/beta/responses/responses.mjs.map +1 -1
  147. package/resources/beta/threads/messages.d.mts +29 -23
  148. package/resources/beta/threads/messages.d.mts.map +1 -1
  149. package/resources/beta/threads/messages.d.ts +29 -23
  150. package/resources/beta/threads/messages.d.ts.map +1 -1
  151. package/resources/beta/threads/runs/runs.d.mts +39 -35
  152. package/resources/beta/threads/runs/runs.d.mts.map +1 -1
  153. package/resources/beta/threads/runs/runs.d.ts +39 -35
  154. package/resources/beta/threads/runs/runs.d.ts.map +1 -1
  155. package/resources/beta/threads/runs/runs.js.map +1 -1
  156. package/resources/beta/threads/runs/runs.mjs.map +1 -1
  157. package/resources/beta/threads/runs/steps.d.mts +14 -15
  158. package/resources/beta/threads/runs/steps.d.mts.map +1 -1
  159. package/resources/beta/threads/runs/steps.d.ts +14 -15
  160. package/resources/beta/threads/runs/steps.d.ts.map +1 -1
  161. package/resources/beta/threads/threads.d.mts +53 -50
  162. package/resources/beta/threads/threads.d.mts.map +1 -1
  163. package/resources/beta/threads/threads.d.ts +53 -50
  164. package/resources/beta/threads/threads.d.ts.map +1 -1
  165. package/resources/beta/threads/threads.js.map +1 -1
  166. package/resources/beta/threads/threads.mjs.map +1 -1
  167. package/resources/chat/completions/completions.d.mts +89 -81
  168. package/resources/chat/completions/completions.d.mts.map +1 -1
  169. package/resources/chat/completions/completions.d.ts +89 -81
  170. package/resources/chat/completions/completions.d.ts.map +1 -1
  171. package/resources/chat/completions/completions.js.map +1 -1
  172. package/resources/chat/completions/completions.mjs.map +1 -1
  173. package/resources/completions.d.mts +15 -14
  174. package/resources/completions.d.mts.map +1 -1
  175. package/resources/completions.d.ts +15 -14
  176. package/resources/completions.d.ts.map +1 -1
  177. package/resources/content-provenance-checks.d.mts +1 -1
  178. package/resources/content-provenance-checks.d.ts +1 -1
  179. package/resources/content-provenance-checks.js +1 -1
  180. package/resources/content-provenance-checks.mjs +1 -1
  181. package/resources/conversations/items.d.mts +19 -3
  182. package/resources/conversations/items.d.mts.map +1 -1
  183. package/resources/conversations/items.d.ts +19 -3
  184. package/resources/conversations/items.d.ts.map +1 -1
  185. package/resources/embeddings.d.mts +6 -6
  186. package/resources/embeddings.d.ts +6 -6
  187. package/resources/evals/evals.d.mts +1 -1
  188. package/resources/evals/evals.d.ts +1 -1
  189. package/resources/evals/evals.js +1 -1
  190. package/resources/evals/evals.mjs +1 -1
  191. package/resources/evals/runs/runs.d.mts +62 -57
  192. package/resources/evals/runs/runs.d.mts.map +1 -1
  193. package/resources/evals/runs/runs.d.ts +62 -57
  194. package/resources/evals/runs/runs.d.ts.map +1 -1
  195. package/resources/evals/runs/runs.js.map +1 -1
  196. package/resources/evals/runs/runs.mjs.map +1 -1
  197. package/resources/files.d.mts +5 -5
  198. package/resources/files.d.ts +5 -5
  199. package/resources/files.js +5 -5
  200. package/resources/files.mjs +5 -5
  201. package/resources/fine-tuning/alpha/graders.d.mts +5 -4
  202. package/resources/fine-tuning/alpha/graders.d.mts.map +1 -1
  203. package/resources/fine-tuning/alpha/graders.d.ts +5 -4
  204. package/resources/fine-tuning/alpha/graders.d.ts.map +1 -1
  205. package/resources/fine-tuning/checkpoints/permissions.d.mts +8 -4
  206. package/resources/fine-tuning/checkpoints/permissions.d.mts.map +1 -1
  207. package/resources/fine-tuning/checkpoints/permissions.d.ts +8 -4
  208. package/resources/fine-tuning/checkpoints/permissions.d.ts.map +1 -1
  209. package/resources/fine-tuning/checkpoints/permissions.js +8 -4
  210. package/resources/fine-tuning/checkpoints/permissions.js.map +1 -1
  211. package/resources/fine-tuning/checkpoints/permissions.mjs +8 -4
  212. package/resources/fine-tuning/checkpoints/permissions.mjs.map +1 -1
  213. package/resources/fine-tuning/jobs/jobs.d.mts +13 -12
  214. package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
  215. package/resources/fine-tuning/jobs/jobs.d.ts +13 -12
  216. package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
  217. package/resources/fine-tuning/jobs/jobs.js +2 -2
  218. package/resources/fine-tuning/jobs/jobs.js.map +1 -1
  219. package/resources/fine-tuning/jobs/jobs.mjs +2 -2
  220. package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
  221. package/resources/graders/grader-models.d.mts +1 -1
  222. package/resources/graders/grader-models.d.ts +1 -1
  223. package/resources/images.d.mts +10 -10
  224. package/resources/images.d.ts +10 -10
  225. package/resources/index.d.mts +1 -0
  226. package/resources/index.d.mts.map +1 -1
  227. package/resources/index.d.ts +1 -0
  228. package/resources/index.d.ts.map +1 -1
  229. package/resources/index.js +3 -1
  230. package/resources/index.js.map +1 -1
  231. package/resources/index.mjs +1 -0
  232. package/resources/index.mjs.map +1 -1
  233. package/resources/live/forks/forks.d.mts +110 -0
  234. package/resources/live/forks/forks.d.mts.map +1 -0
  235. package/resources/live/forks/forks.d.ts +110 -0
  236. package/resources/live/forks/forks.d.ts.map +1 -0
  237. package/resources/live/forks/forks.js +9 -0
  238. package/resources/live/forks/forks.js.map +1 -0
  239. package/resources/live/forks/forks.mjs +5 -0
  240. package/resources/live/forks/forks.mjs.map +1 -0
  241. package/resources/live/forks/index.d.mts +4 -0
  242. package/resources/live/forks/index.d.mts.map +1 -0
  243. package/resources/live/forks/index.d.ts +4 -0
  244. package/resources/live/forks/index.d.ts.map +1 -0
  245. package/resources/live/forks/index.js +7 -0
  246. package/resources/live/forks/index.js.map +1 -0
  247. package/resources/live/forks/index.mjs +3 -0
  248. package/resources/live/forks/index.mjs.map +1 -0
  249. package/resources/live/forks/internal-base.d.mts +73 -0
  250. package/resources/live/forks/internal-base.d.mts.map +1 -0
  251. package/resources/live/forks/internal-base.d.ts +73 -0
  252. package/resources/live/forks/internal-base.d.ts.map +1 -0
  253. package/resources/live/forks/internal-base.js +49 -0
  254. package/resources/live/forks/internal-base.js.map +1 -0
  255. package/resources/live/forks/internal-base.mjs +43 -0
  256. package/resources/live/forks/internal-base.mjs.map +1 -0
  257. package/resources/live/forks/ws-base.d.mts +109 -0
  258. package/resources/live/forks/ws-base.d.mts.map +1 -0
  259. package/resources/live/forks/ws-base.d.ts +109 -0
  260. package/resources/live/forks/ws-base.d.ts.map +1 -0
  261. package/resources/live/forks/ws-base.js +476 -0
  262. package/resources/live/forks/ws-base.js.map +1 -0
  263. package/resources/live/forks/ws-base.mjs +472 -0
  264. package/resources/live/forks/ws-base.mjs.map +1 -0
  265. package/resources/live/forks/ws.d.mts +13 -0
  266. package/resources/live/forks/ws.d.mts.map +1 -0
  267. package/resources/live/forks/ws.d.ts +13 -0
  268. package/resources/live/forks/ws.d.ts.map +1 -0
  269. package/resources/live/forks/ws.js +34 -0
  270. package/resources/live/forks/ws.js.map +1 -0
  271. package/resources/live/forks/ws.mjs +29 -0
  272. package/resources/live/forks/ws.mjs.map +1 -0
  273. package/resources/live/forks.d.mts +2 -0
  274. package/resources/live/forks.d.mts.map +1 -0
  275. package/resources/live/forks.d.ts +2 -0
  276. package/resources/live/forks.d.ts.map +1 -0
  277. package/resources/live/forks.js +6 -0
  278. package/resources/live/forks.js.map +1 -0
  279. package/resources/live/forks.mjs +3 -0
  280. package/resources/live/forks.mjs.map +1 -0
  281. package/resources/live/index.d.mts +7 -0
  282. package/resources/live/index.d.mts.map +1 -0
  283. package/resources/live/index.d.ts +7 -0
  284. package/resources/live/index.d.ts.map +1 -0
  285. package/resources/live/index.js +13 -0
  286. package/resources/live/index.js.map +1 -0
  287. package/resources/live/index.mjs +6 -0
  288. package/resources/live/index.mjs.map +1 -0
  289. package/resources/live/internal-base.d.mts +71 -0
  290. package/resources/live/internal-base.d.mts.map +1 -0
  291. package/resources/live/internal-base.d.ts +71 -0
  292. package/resources/live/internal-base.d.ts.map +1 -0
  293. package/resources/live/internal-base.js +48 -0
  294. package/resources/live/internal-base.js.map +1 -0
  295. package/resources/live/internal-base.mjs +42 -0
  296. package/resources/live/internal-base.mjs.map +1 -0
  297. package/resources/live/live.d.mts +1864 -0
  298. package/resources/live/live.d.mts.map +1 -0
  299. package/resources/live/live.d.ts +1864 -0
  300. package/resources/live/live.d.ts.map +1 -0
  301. package/resources/live/live.js +40 -0
  302. package/resources/live/live.js.map +1 -0
  303. package/resources/live/live.mjs +35 -0
  304. package/resources/live/live.mjs.map +1 -0
  305. package/resources/live/sessions.d.mts +254 -0
  306. package/resources/live/sessions.d.mts.map +1 -0
  307. package/resources/live/sessions.d.ts +254 -0
  308. package/resources/live/sessions.d.ts.map +1 -0
  309. package/resources/live/sessions.js +118 -0
  310. package/resources/live/sessions.js.map +1 -0
  311. package/resources/live/sessions.mjs +114 -0
  312. package/resources/live/sessions.mjs.map +1 -0
  313. package/resources/live/sideband/index.d.mts +4 -0
  314. package/resources/live/sideband/index.d.mts.map +1 -0
  315. package/resources/live/sideband/index.d.ts +4 -0
  316. package/resources/live/sideband/index.d.ts.map +1 -0
  317. package/resources/live/sideband/index.js +7 -0
  318. package/resources/live/sideband/index.js.map +1 -0
  319. package/resources/live/sideband/index.mjs +3 -0
  320. package/resources/live/sideband/index.mjs.map +1 -0
  321. package/resources/live/sideband/internal-base.d.mts +73 -0
  322. package/resources/live/sideband/internal-base.d.mts.map +1 -0
  323. package/resources/live/sideband/internal-base.d.ts +73 -0
  324. package/resources/live/sideband/internal-base.d.ts.map +1 -0
  325. package/resources/live/sideband/internal-base.js +49 -0
  326. package/resources/live/sideband/internal-base.js.map +1 -0
  327. package/resources/live/sideband/internal-base.mjs +43 -0
  328. package/resources/live/sideband/internal-base.mjs.map +1 -0
  329. package/resources/live/sideband/sideband.d.mts +25 -0
  330. package/resources/live/sideband/sideband.d.mts.map +1 -0
  331. package/resources/live/sideband/sideband.d.ts +25 -0
  332. package/resources/live/sideband/sideband.d.ts.map +1 -0
  333. package/resources/live/sideband/sideband.js +9 -0
  334. package/resources/live/sideband/sideband.js.map +1 -0
  335. package/resources/live/sideband/sideband.mjs +5 -0
  336. package/resources/live/sideband/sideband.mjs.map +1 -0
  337. package/resources/live/sideband/ws-base.d.mts +114 -0
  338. package/resources/live/sideband/ws-base.d.mts.map +1 -0
  339. package/resources/live/sideband/ws-base.d.ts +114 -0
  340. package/resources/live/sideband/ws-base.d.ts.map +1 -0
  341. package/resources/live/sideband/ws-base.js +476 -0
  342. package/resources/live/sideband/ws-base.js.map +1 -0
  343. package/resources/live/sideband/ws-base.mjs +472 -0
  344. package/resources/live/sideband/ws-base.mjs.map +1 -0
  345. package/resources/live/sideband/ws.d.mts +13 -0
  346. package/resources/live/sideband/ws.d.mts.map +1 -0
  347. package/resources/live/sideband/ws.d.ts +13 -0
  348. package/resources/live/sideband/ws.d.ts.map +1 -0
  349. package/resources/live/sideband/ws.js +34 -0
  350. package/resources/live/sideband/ws.js.map +1 -0
  351. package/resources/live/sideband/ws.mjs +29 -0
  352. package/resources/live/sideband/ws.mjs.map +1 -0
  353. package/resources/live/sideband.d.mts +2 -0
  354. package/resources/live/sideband.d.mts.map +1 -0
  355. package/resources/live/sideband.d.ts +2 -0
  356. package/resources/live/sideband.d.ts.map +1 -0
  357. package/resources/live/sideband.js +6 -0
  358. package/resources/live/sideband.js.map +1 -0
  359. package/resources/live/sideband.mjs +3 -0
  360. package/resources/live/sideband.mjs.map +1 -0
  361. package/resources/live/ws-base.d.mts +106 -0
  362. package/resources/live/ws-base.d.mts.map +1 -0
  363. package/resources/live/ws-base.d.ts +106 -0
  364. package/resources/live/ws-base.d.ts.map +1 -0
  365. package/resources/live/ws-base.js +476 -0
  366. package/resources/live/ws-base.js.map +1 -0
  367. package/resources/live/ws-base.mjs +472 -0
  368. package/resources/live/ws-base.mjs.map +1 -0
  369. package/resources/live/ws.d.mts +13 -0
  370. package/resources/live/ws.d.mts.map +1 -0
  371. package/resources/live/ws.d.ts +13 -0
  372. package/resources/live/ws.d.ts.map +1 -0
  373. package/resources/live/ws.js +34 -0
  374. package/resources/live/ws.js.map +1 -0
  375. package/resources/live/ws.mjs +29 -0
  376. package/resources/live/ws.mjs.map +1 -0
  377. package/resources/live.d.mts +2 -0
  378. package/resources/live.d.mts.map +1 -0
  379. package/resources/live.d.ts +2 -0
  380. package/resources/live.d.ts.map +1 -0
  381. package/resources/live.js +6 -0
  382. package/resources/live.js.map +1 -0
  383. package/resources/live.mjs +3 -0
  384. package/resources/live.mjs.map +1 -0
  385. package/resources/moderations.d.mts +5 -4
  386. package/resources/moderations.d.mts.map +1 -1
  387. package/resources/moderations.d.ts +5 -4
  388. package/resources/moderations.d.ts.map +1 -1
  389. package/resources/moderations.js +2 -1
  390. package/resources/moderations.js.map +1 -1
  391. package/resources/moderations.mjs +2 -1
  392. package/resources/moderations.mjs.map +1 -1
  393. package/resources/realtime/calls.d.mts +1 -1
  394. package/resources/realtime/calls.d.ts +1 -1
  395. package/resources/realtime/client-secrets.d.mts +4 -4
  396. package/resources/realtime/client-secrets.d.ts +4 -4
  397. package/resources/realtime/client-secrets.js +1 -1
  398. package/resources/realtime/client-secrets.mjs +1 -1
  399. package/resources/realtime/realtime.d.mts +16 -16
  400. package/resources/realtime/realtime.d.ts +16 -16
  401. package/resources/responses/input-tokens.d.mts +9 -9
  402. package/resources/responses/input-tokens.d.ts +9 -9
  403. package/resources/responses/responses.d.mts +223 -164
  404. package/resources/responses/responses.d.mts.map +1 -1
  405. package/resources/responses/responses.d.ts +223 -164
  406. package/resources/responses/responses.d.ts.map +1 -1
  407. package/resources/responses/responses.js +3 -3
  408. package/resources/responses/responses.js.map +1 -1
  409. package/resources/responses/responses.mjs +3 -3
  410. package/resources/responses/responses.mjs.map +1 -1
  411. package/resources/shared.d.mts +12 -12
  412. package/resources/shared.d.ts +12 -12
  413. package/resources/uploads/parts.d.mts +5 -4
  414. package/resources/uploads/parts.d.mts.map +1 -1
  415. package/resources/uploads/parts.d.ts +5 -4
  416. package/resources/uploads/parts.d.ts.map +1 -1
  417. package/resources/uploads/parts.js +5 -4
  418. package/resources/uploads/parts.js.map +1 -1
  419. package/resources/uploads/parts.mjs +5 -4
  420. package/resources/uploads/parts.mjs.map +1 -1
  421. package/resources/uploads/uploads.d.mts +11 -11
  422. package/resources/uploads/uploads.d.ts +11 -11
  423. package/resources/uploads/uploads.js +9 -9
  424. package/resources/uploads/uploads.mjs +9 -9
  425. package/resources/vector-stores/file-batches.d.mts +11 -11
  426. package/resources/vector-stores/file-batches.d.ts +11 -11
  427. package/resources/vector-stores/files.d.mts +8 -8
  428. package/resources/vector-stores/files.d.ts +8 -8
  429. package/resources/vector-stores/files.js +3 -3
  430. package/resources/vector-stores/files.mjs +3 -3
  431. package/resources/vector-stores/vector-stores.d.mts +3 -3
  432. package/resources/vector-stores/vector-stores.d.ts +3 -3
  433. package/resources/webhooks/webhooks.d.mts +78 -7
  434. package/resources/webhooks/webhooks.d.mts.map +1 -1
  435. package/resources/webhooks/webhooks.d.ts +78 -7
  436. package/resources/webhooks/webhooks.d.ts.map +1 -1
  437. package/src/client.ts +5 -0
  438. package/src/helpers/live.ts +8 -0
  439. package/src/lib/live/transcript-grouper.ts +303 -0
  440. package/src/lib/live/transcript-grouping.ts +362 -0
  441. package/src/lib/live/webrtc.ts +23 -0
  442. package/src/lib/realtime/webrtc.ts +20 -0
  443. package/src/lib/webrtc/connection.ts +309 -0
  444. package/src/lib/webrtc/data-channel.ts +144 -0
  445. package/src/lib/webrtc/errors.ts +38 -0
  446. package/src/lib/webrtc/subscriptions.ts +62 -0
  447. package/src/lib/webrtc/types.ts +109 -0
  448. package/src/live/webrtc.ts +10 -0
  449. package/src/realtime/webrtc.ts +10 -0
  450. package/src/resources/admin/organization/audit-logs.ts +1 -1
  451. package/src/resources/admin/organization/projects/api-keys.ts +6 -0
  452. package/src/resources/admin/organization/projects/projects.ts +2 -2
  453. package/src/resources/admin/organization/projects/service-accounts/service-accounts.ts +15 -0
  454. package/src/resources/audio/speech.ts +3 -2
  455. package/src/resources/audio/transcriptions.ts +10 -10
  456. package/src/resources/audio/translations.ts +1 -1
  457. package/src/resources/batches.ts +6 -5
  458. package/src/resources/beta/assistants.ts +143 -147
  459. package/src/resources/beta/responses/input-tokens.ts +11 -11
  460. package/src/resources/beta/responses/responses.ts +241 -170
  461. package/src/resources/beta/threads/messages.ts +29 -23
  462. package/src/resources/beta/threads/runs/runs.ts +39 -35
  463. package/src/resources/beta/threads/runs/steps.ts +14 -15
  464. package/src/resources/beta/threads/threads.ts +53 -50
  465. package/src/resources/chat/completions/completions.ts +89 -81
  466. package/src/resources/completions.ts +15 -14
  467. package/src/resources/content-provenance-checks.ts +1 -1
  468. package/src/resources/conversations/items.ts +23 -3
  469. package/src/resources/embeddings.ts +6 -6
  470. package/src/resources/evals/evals.ts +1 -1
  471. package/src/resources/evals/runs/runs.ts +62 -57
  472. package/src/resources/files.ts +5 -5
  473. package/src/resources/fine-tuning/alpha/graders.ts +5 -4
  474. package/src/resources/fine-tuning/checkpoints/permissions.ts +8 -4
  475. package/src/resources/fine-tuning/jobs/jobs.ts +13 -12
  476. package/src/resources/graders/grader-models.ts +1 -1
  477. package/src/resources/images.ts +10 -10
  478. package/src/resources/index.ts +1 -0
  479. package/src/resources/live/api.md +87 -0
  480. package/src/resources/live/forks/forks.ts +169 -0
  481. package/src/resources/live/forks/index.ts +5 -0
  482. package/src/resources/live/forks/internal-base.ts +107 -0
  483. package/src/resources/live/forks/ws-base.ts +611 -0
  484. package/src/resources/live/forks/ws.ts +46 -0
  485. package/src/resources/live/forks.ts +3 -0
  486. package/src/resources/live/index.ts +20 -0
  487. package/src/resources/live/internal-base.ts +104 -0
  488. package/src/resources/live/live.ts +2296 -0
  489. package/src/resources/live/sessions.ts +337 -0
  490. package/src/resources/live/sideband/index.ts +10 -0
  491. package/src/resources/live/sideband/internal-base.ts +107 -0
  492. package/src/resources/live/sideband/sideband.ts +58 -0
  493. package/src/resources/live/sideband/ws-base.ts +621 -0
  494. package/src/resources/live/sideband/ws.ts +46 -0
  495. package/src/resources/live/sideband.ts +3 -0
  496. package/src/resources/live/ws-base.ts +607 -0
  497. package/src/resources/live/ws.ts +42 -0
  498. package/src/resources/live.ts +3 -0
  499. package/src/resources/moderations.ts +5 -4
  500. package/src/resources/realtime/calls.ts +1 -1
  501. package/src/resources/realtime/client-secrets.ts +4 -4
  502. package/src/resources/realtime/realtime.ts +16 -16
  503. package/src/resources/responses/input-tokens.ts +9 -9
  504. package/src/resources/responses/responses.ts +235 -164
  505. package/src/resources/shared.ts +12 -12
  506. package/src/resources/uploads/parts.ts +5 -4
  507. package/src/resources/uploads/uploads.ts +11 -11
  508. package/src/resources/vector-stores/file-batches.ts +11 -11
  509. package/src/resources/vector-stores/files.ts +8 -8
  510. package/src/resources/vector-stores/vector-stores.ts +3 -3
  511. package/src/resources/webhooks/api.md +1 -0
  512. package/src/resources/webhooks/webhooks.ts +88 -5
  513. package/src/version.ts +1 -1
  514. package/version.d.mts +1 -1
  515. package/version.d.ts +1 -1
  516. package/version.js +1 -1
  517. 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;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AkB,SAAS,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,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AAE,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,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,EA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H,QAAQ,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,EAA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M,CAAC,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/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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,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"}