modelmix 1.0.2

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 (1112) hide show
  1. package/.gitattributes +2 -0
  2. package/README.md +147 -0
  3. package/demo/default.env +3 -0
  4. package/demo/demo.mjs +49 -0
  5. package/demo/node_modules/.package-lock.json +272 -0
  6. package/demo/node_modules/@anthropic-ai/sdk/CHANGELOG.md +859 -0
  7. package/demo/node_modules/@anthropic-ai/sdk/LICENSE +8 -0
  8. package/demo/node_modules/@anthropic-ai/sdk/README.md +424 -0
  9. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.d.ts +9 -0
  10. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.d.ts.map +1 -0
  11. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js +16 -0
  12. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js.map +1 -0
  13. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs +12 -0
  14. package/demo/node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs.map +1 -0
  15. package/demo/node_modules/@anthropic-ai/sdk/_shims/README.md +46 -0
  16. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.d.ts +5 -0
  17. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.d.ts.map +1 -0
  18. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.js +21 -0
  19. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.js.map +1 -0
  20. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.mjs +2 -0
  21. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-bun.mjs.map +1 -0
  22. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.d.ts +5 -0
  23. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.d.ts.map +1 -0
  24. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js +21 -0
  25. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js.map +1 -0
  26. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.mjs +2 -0
  27. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.mjs.map +1 -0
  28. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.d.ts +5 -0
  29. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.d.ts.map +1 -0
  30. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.js +21 -0
  31. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.js.map +1 -0
  32. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.mjs +2 -0
  33. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/runtime.mjs.map +1 -0
  34. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.d.ts +5 -0
  35. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.d.ts.map +1 -0
  36. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.js +21 -0
  37. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.js.map +1 -0
  38. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.mjs +2 -0
  39. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types-node.mjs.map +1 -0
  40. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.d.ts +101 -0
  41. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.js +3 -0
  42. package/demo/node_modules/@anthropic-ai/sdk/_shims/auto/types.mjs +3 -0
  43. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.d.ts +6 -0
  44. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.d.ts.map +1 -0
  45. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.js +14 -0
  46. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.js.map +1 -0
  47. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.mjs +10 -0
  48. package/demo/node_modules/@anthropic-ai/sdk/_shims/bun-runtime.mjs.map +1 -0
  49. package/demo/node_modules/@anthropic-ai/sdk/_shims/index.d.ts +81 -0
  50. package/demo/node_modules/@anthropic-ai/sdk/_shims/index.js +13 -0
  51. package/demo/node_modules/@anthropic-ai/sdk/_shims/index.mjs +7 -0
  52. package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.d.ts +12 -0
  53. package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.js +3 -0
  54. package/demo/node_modules/@anthropic-ai/sdk/_shims/manual-types.mjs +3 -0
  55. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.d.ts +3 -0
  56. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.d.ts.map +1 -0
  57. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.js +90 -0
  58. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.js.map +1 -0
  59. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs +56 -0
  60. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs.map +1 -0
  61. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.d.ts +42 -0
  62. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.js +3 -0
  63. package/demo/node_modules/@anthropic-ai/sdk/_shims/node-types.mjs +3 -0
  64. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.d.ts +37 -0
  65. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.d.ts.map +1 -0
  66. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.js +41 -0
  67. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.js.map +1 -0
  68. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.mjs +37 -0
  69. package/demo/node_modules/@anthropic-ai/sdk/_shims/registry.mjs.map +1 -0
  70. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.d.ts +5 -0
  71. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.d.ts.map +1 -0
  72. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.js +78 -0
  73. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.js.map +1 -0
  74. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.mjs +71 -0
  75. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-runtime.mjs.map +1 -0
  76. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.d.ts +83 -0
  77. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.js +3 -0
  78. package/demo/node_modules/@anthropic-ai/sdk/_shims/web-types.mjs +3 -0
  79. package/demo/node_modules/@anthropic-ai/sdk/core.d.ts +239 -0
  80. package/demo/node_modules/@anthropic-ai/sdk/core.d.ts.map +1 -0
  81. package/demo/node_modules/@anthropic-ai/sdk/core.js +879 -0
  82. package/demo/node_modules/@anthropic-ai/sdk/core.js.map +1 -0
  83. package/demo/node_modules/@anthropic-ai/sdk/core.mjs +848 -0
  84. package/demo/node_modules/@anthropic-ai/sdk/core.mjs.map +1 -0
  85. package/demo/node_modules/@anthropic-ai/sdk/error.d.ts +53 -0
  86. package/demo/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -0
  87. package/demo/node_modules/@anthropic-ai/sdk/error.js +143 -0
  88. package/demo/node_modules/@anthropic-ai/sdk/error.js.map +1 -0
  89. package/demo/node_modules/@anthropic-ai/sdk/error.mjs +127 -0
  90. package/demo/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -0
  91. package/demo/node_modules/@anthropic-ai/sdk/index.d.mts +147 -0
  92. package/demo/node_modules/@anthropic-ai/sdk/index.d.ts +147 -0
  93. package/demo/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -0
  94. package/demo/node_modules/@anthropic-ai/sdk/index.js +149 -0
  95. package/demo/node_modules/@anthropic-ai/sdk/index.js.map +1 -0
  96. package/demo/node_modules/@anthropic-ai/sdk/index.mjs +121 -0
  97. package/demo/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -0
  98. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +94 -0
  99. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -0
  100. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +436 -0
  101. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -0
  102. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +432 -0
  103. package/demo/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -0
  104. package/demo/node_modules/@anthropic-ai/sdk/package.json +104 -0
  105. package/demo/node_modules/@anthropic-ai/sdk/resource.d.ts +6 -0
  106. package/demo/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -0
  107. package/demo/node_modules/@anthropic-ai/sdk/resource.js +11 -0
  108. package/demo/node_modules/@anthropic-ai/sdk/resource.js.map +1 -0
  109. package/demo/node_modules/@anthropic-ai/sdk/resource.mjs +7 -0
  110. package/demo/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -0
  111. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +9 -0
  112. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -0
  113. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +40 -0
  114. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -0
  115. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +13 -0
  116. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -0
  117. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +3 -0
  118. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -0
  119. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.js +9 -0
  120. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -0
  121. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +4 -0
  122. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -0
  123. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.d.ts +3 -0
  124. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.d.ts.map +1 -0
  125. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.js +9 -0
  126. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.js.map +1 -0
  127. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.mjs +4 -0
  128. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/index.mjs.map +1 -0
  129. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.d.ts +462 -0
  130. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.d.ts.map +1 -0
  131. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.js +20 -0
  132. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.js.map +1 -0
  133. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.mjs +16 -0
  134. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/messages.mjs.map +1 -0
  135. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.d.ts +19 -0
  136. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.d.ts.map +1 -0
  137. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.js +40 -0
  138. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.js.map +1 -0
  139. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.mjs +13 -0
  140. package/demo/node_modules/@anthropic-ai/sdk/resources/beta/tools/tools.mjs.map +1 -0
  141. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +184 -0
  142. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -0
  143. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.js +19 -0
  144. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.js.map +1 -0
  145. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.mjs +15 -0
  146. package/demo/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -0
  147. package/demo/node_modules/@anthropic-ai/sdk/resources/index.d.ts +4 -0
  148. package/demo/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -0
  149. package/demo/node_modules/@anthropic-ai/sdk/resources/index.js +11 -0
  150. package/demo/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -0
  151. package/demo/node_modules/@anthropic-ai/sdk/resources/index.mjs +5 -0
  152. package/demo/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -0
  153. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +619 -0
  154. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -0
  155. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.js +28 -0
  156. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.js.map +1 -0
  157. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.mjs +23 -0
  158. package/demo/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -0
  159. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +2 -0
  160. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +1 -0
  161. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.js +4 -0
  162. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +1 -0
  163. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +3 -0
  164. package/demo/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +1 -0
  165. package/demo/node_modules/@anthropic-ai/sdk/shims/node.d.ts +29 -0
  166. package/demo/node_modules/@anthropic-ai/sdk/shims/node.d.ts.map +1 -0
  167. package/demo/node_modules/@anthropic-ai/sdk/shims/node.js +31 -0
  168. package/demo/node_modules/@anthropic-ai/sdk/shims/node.js.map +1 -0
  169. package/demo/node_modules/@anthropic-ai/sdk/shims/node.mjs +5 -0
  170. package/demo/node_modules/@anthropic-ai/sdk/shims/node.mjs.map +1 -0
  171. package/demo/node_modules/@anthropic-ai/sdk/shims/web.d.ts +26 -0
  172. package/demo/node_modules/@anthropic-ai/sdk/shims/web.d.ts.map +1 -0
  173. package/demo/node_modules/@anthropic-ai/sdk/shims/web.js +31 -0
  174. package/demo/node_modules/@anthropic-ai/sdk/shims/web.js.map +1 -0
  175. package/demo/node_modules/@anthropic-ai/sdk/shims/web.mjs +5 -0
  176. package/demo/node_modules/@anthropic-ai/sdk/shims/web.mjs.map +1 -0
  177. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/MultipartBody.ts +9 -0
  178. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/README.md +46 -0
  179. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime-bun.ts +4 -0
  180. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime-node.ts +4 -0
  181. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime.ts +4 -0
  182. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types-node.ts +4 -0
  183. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.d.ts +101 -0
  184. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.js +3 -0
  185. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/auto/types.mjs +3 -0
  186. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/bun-runtime.ts +14 -0
  187. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.d.ts +81 -0
  188. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.js +13 -0
  189. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/index.mjs +7 -0
  190. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.d.ts +12 -0
  191. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.js +3 -0
  192. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/manual-types.mjs +3 -0
  193. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-runtime.ts +83 -0
  194. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.d.ts +42 -0
  195. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.js +3 -0
  196. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/node-types.mjs +3 -0
  197. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/registry.ts +67 -0
  198. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-runtime.ts +103 -0
  199. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.d.ts +83 -0
  200. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.js +3 -0
  201. package/demo/node_modules/@anthropic-ai/sdk/src/_shims/web-types.mjs +3 -0
  202. package/demo/node_modules/@anthropic-ai/sdk/src/core.ts +1162 -0
  203. package/demo/node_modules/@anthropic-ai/sdk/src/error.ts +146 -0
  204. package/demo/node_modules/@anthropic-ai/sdk/src/index.ts +264 -0
  205. package/demo/node_modules/@anthropic-ai/sdk/src/lib/.keep +4 -0
  206. package/demo/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +535 -0
  207. package/demo/node_modules/@anthropic-ai/sdk/src/resource.ts +11 -0
  208. package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +12 -0
  209. package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +4 -0
  210. package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/index.ts +16 -0
  211. package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/messages.ts +531 -0
  212. package/demo/node_modules/@anthropic-ai/sdk/src/resources/beta/tools/tools.ts +22 -0
  213. package/demo/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +223 -0
  214. package/demo/node_modules/@anthropic-ai/sdk/src/resources/index.ts +33 -0
  215. package/demo/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +729 -0
  216. package/demo/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +3 -0
  217. package/demo/node_modules/@anthropic-ai/sdk/src/shims/node.ts +50 -0
  218. package/demo/node_modules/@anthropic-ai/sdk/src/shims/web.ts +50 -0
  219. package/demo/node_modules/@anthropic-ai/sdk/src/streaming.ts +509 -0
  220. package/demo/node_modules/@anthropic-ai/sdk/src/tsconfig.json +11 -0
  221. package/demo/node_modules/@anthropic-ai/sdk/src/uploads.ts +248 -0
  222. package/demo/node_modules/@anthropic-ai/sdk/src/version.ts +1 -0
  223. package/demo/node_modules/@anthropic-ai/sdk/streaming.d.ts +41 -0
  224. package/demo/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -0
  225. package/demo/node_modules/@anthropic-ai/sdk/streaming.js +431 -0
  226. package/demo/node_modules/@anthropic-ai/sdk/streaming.js.map +1 -0
  227. package/demo/node_modules/@anthropic-ai/sdk/streaming.mjs +424 -0
  228. package/demo/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -0
  229. package/demo/node_modules/@anthropic-ai/sdk/uploads.d.ts +75 -0
  230. package/demo/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -0
  231. package/demo/node_modules/@anthropic-ai/sdk/uploads.js +165 -0
  232. package/demo/node_modules/@anthropic-ai/sdk/uploads.js.map +1 -0
  233. package/demo/node_modules/@anthropic-ai/sdk/uploads.mjs +152 -0
  234. package/demo/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -0
  235. package/demo/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
  236. package/demo/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -0
  237. package/demo/node_modules/@anthropic-ai/sdk/version.js +5 -0
  238. package/demo/node_modules/@anthropic-ai/sdk/version.js.map +1 -0
  239. package/demo/node_modules/@anthropic-ai/sdk/version.mjs +2 -0
  240. package/demo/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -0
  241. package/demo/node_modules/@types/node/LICENSE +21 -0
  242. package/demo/node_modules/@types/node/README.md +15 -0
  243. package/demo/node_modules/@types/node/assert/strict.d.ts +8 -0
  244. package/demo/node_modules/@types/node/assert.d.ts +985 -0
  245. package/demo/node_modules/@types/node/async_hooks.d.ts +522 -0
  246. package/demo/node_modules/@types/node/buffer.d.ts +2353 -0
  247. package/demo/node_modules/@types/node/child_process.d.ts +1544 -0
  248. package/demo/node_modules/@types/node/cluster.d.ts +578 -0
  249. package/demo/node_modules/@types/node/console.d.ts +452 -0
  250. package/demo/node_modules/@types/node/constants.d.ts +19 -0
  251. package/demo/node_modules/@types/node/crypto.d.ts +4457 -0
  252. package/demo/node_modules/@types/node/dgram.d.ts +596 -0
  253. package/demo/node_modules/@types/node/diagnostics_channel.d.ts +546 -0
  254. package/demo/node_modules/@types/node/dns/promises.d.ts +473 -0
  255. package/demo/node_modules/@types/node/dns.d.ts +853 -0
  256. package/demo/node_modules/@types/node/dom-events.d.ts +124 -0
  257. package/demo/node_modules/@types/node/domain.d.ts +170 -0
  258. package/demo/node_modules/@types/node/events.d.ts +819 -0
  259. package/demo/node_modules/@types/node/fs/promises.d.ts +1205 -0
  260. package/demo/node_modules/@types/node/fs.d.ts +4237 -0
  261. package/demo/node_modules/@types/node/globals.d.ts +377 -0
  262. package/demo/node_modules/@types/node/globals.global.d.ts +1 -0
  263. package/demo/node_modules/@types/node/http.d.ts +1803 -0
  264. package/demo/node_modules/@types/node/http2.d.ts +2392 -0
  265. package/demo/node_modules/@types/node/https.d.ts +544 -0
  266. package/demo/node_modules/@types/node/index.d.ts +88 -0
  267. package/demo/node_modules/@types/node/inspector.d.ts +2738 -0
  268. package/demo/node_modules/@types/node/module.d.ts +298 -0
  269. package/demo/node_modules/@types/node/net.d.ts +918 -0
  270. package/demo/node_modules/@types/node/os.d.ts +473 -0
  271. package/demo/node_modules/@types/node/package.json +222 -0
  272. package/demo/node_modules/@types/node/path.d.ts +191 -0
  273. package/demo/node_modules/@types/node/perf_hooks.d.ts +626 -0
  274. package/demo/node_modules/@types/node/process.d.ts +1548 -0
  275. package/demo/node_modules/@types/node/punycode.d.ts +117 -0
  276. package/demo/node_modules/@types/node/querystring.d.ts +141 -0
  277. package/demo/node_modules/@types/node/readline/promises.d.ts +143 -0
  278. package/demo/node_modules/@types/node/readline.d.ts +666 -0
  279. package/demo/node_modules/@types/node/repl.d.ts +430 -0
  280. package/demo/node_modules/@types/node/stream/consumers.d.ts +12 -0
  281. package/demo/node_modules/@types/node/stream/promises.d.ts +83 -0
  282. package/demo/node_modules/@types/node/stream/web.d.ts +352 -0
  283. package/demo/node_modules/@types/node/stream.d.ts +1731 -0
  284. package/demo/node_modules/@types/node/string_decoder.d.ts +67 -0
  285. package/demo/node_modules/@types/node/test.d.ts +1113 -0
  286. package/demo/node_modules/@types/node/timers/promises.d.ts +93 -0
  287. package/demo/node_modules/@types/node/timers.d.ts +126 -0
  288. package/demo/node_modules/@types/node/tls.d.ts +1203 -0
  289. package/demo/node_modules/@types/node/trace_events.d.ts +171 -0
  290. package/demo/node_modules/@types/node/tty.d.ts +206 -0
  291. package/demo/node_modules/@types/node/url.d.ts +954 -0
  292. package/demo/node_modules/@types/node/util.d.ts +2075 -0
  293. package/demo/node_modules/@types/node/v8.d.ts +753 -0
  294. package/demo/node_modules/@types/node/vm.d.ts +667 -0
  295. package/demo/node_modules/@types/node/wasi.d.ts +160 -0
  296. package/demo/node_modules/@types/node/worker_threads.d.ts +692 -0
  297. package/demo/node_modules/@types/node/zlib.d.ts +517 -0
  298. package/demo/node_modules/@types/node-fetch/LICENSE +21 -0
  299. package/demo/node_modules/@types/node-fetch/README.md +15 -0
  300. package/demo/node_modules/@types/node-fetch/externals.d.ts +32 -0
  301. package/demo/node_modules/@types/node-fetch/index.d.ts +238 -0
  302. package/demo/node_modules/@types/node-fetch/package.json +83 -0
  303. package/demo/node_modules/abort-controller/LICENSE +21 -0
  304. package/demo/node_modules/abort-controller/README.md +98 -0
  305. package/demo/node_modules/abort-controller/browser.js +13 -0
  306. package/demo/node_modules/abort-controller/browser.mjs +11 -0
  307. package/demo/node_modules/abort-controller/package.json +97 -0
  308. package/demo/node_modules/abort-controller/polyfill.js +21 -0
  309. package/demo/node_modules/abort-controller/polyfill.mjs +19 -0
  310. package/demo/node_modules/agentkeepalive/History.md +268 -0
  311. package/demo/node_modules/agentkeepalive/LICENSE +23 -0
  312. package/demo/node_modules/agentkeepalive/README.md +256 -0
  313. package/demo/node_modules/agentkeepalive/browser.js +5 -0
  314. package/demo/node_modules/agentkeepalive/index.d.ts +65 -0
  315. package/demo/node_modules/agentkeepalive/index.js +5 -0
  316. package/demo/node_modules/agentkeepalive/lib/agent.js +402 -0
  317. package/demo/node_modules/agentkeepalive/lib/constants.js +14 -0
  318. package/demo/node_modules/agentkeepalive/lib/https_agent.js +51 -0
  319. package/demo/node_modules/agentkeepalive/package.json +56 -0
  320. package/demo/node_modules/asynckit/LICENSE +21 -0
  321. package/demo/node_modules/asynckit/README.md +233 -0
  322. package/demo/node_modules/asynckit/bench.js +76 -0
  323. package/demo/node_modules/asynckit/index.js +6 -0
  324. package/demo/node_modules/asynckit/lib/abort.js +29 -0
  325. package/demo/node_modules/asynckit/lib/async.js +34 -0
  326. package/demo/node_modules/asynckit/lib/defer.js +26 -0
  327. package/demo/node_modules/asynckit/lib/iterate.js +75 -0
  328. package/demo/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  329. package/demo/node_modules/asynckit/lib/readable_parallel.js +25 -0
  330. package/demo/node_modules/asynckit/lib/readable_serial.js +25 -0
  331. package/demo/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  332. package/demo/node_modules/asynckit/lib/state.js +37 -0
  333. package/demo/node_modules/asynckit/lib/streamify.js +141 -0
  334. package/demo/node_modules/asynckit/lib/terminator.js +29 -0
  335. package/demo/node_modules/asynckit/package.json +63 -0
  336. package/demo/node_modules/asynckit/parallel.js +43 -0
  337. package/demo/node_modules/asynckit/serial.js +17 -0
  338. package/demo/node_modules/asynckit/serialOrdered.js +75 -0
  339. package/demo/node_modules/asynckit/stream.js +21 -0
  340. package/demo/node_modules/combined-stream/License +19 -0
  341. package/demo/node_modules/combined-stream/Readme.md +138 -0
  342. package/demo/node_modules/combined-stream/lib/combined_stream.js +208 -0
  343. package/demo/node_modules/combined-stream/package.json +25 -0
  344. package/demo/node_modules/combined-stream/yarn.lock +17 -0
  345. package/demo/node_modules/delayed-stream/License +19 -0
  346. package/demo/node_modules/delayed-stream/Makefile +7 -0
  347. package/demo/node_modules/delayed-stream/Readme.md +141 -0
  348. package/demo/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  349. package/demo/node_modules/delayed-stream/package.json +27 -0
  350. package/demo/node_modules/dotenv/CHANGELOG.md +475 -0
  351. package/demo/node_modules/dotenv/LICENSE +23 -0
  352. package/demo/node_modules/dotenv/README-es.md +448 -0
  353. package/demo/node_modules/dotenv/README.md +728 -0
  354. package/demo/node_modules/dotenv/config.d.ts +1 -0
  355. package/demo/node_modules/dotenv/config.js +9 -0
  356. package/demo/node_modules/dotenv/lib/cli-options.js +11 -0
  357. package/demo/node_modules/dotenv/lib/env-options.js +24 -0
  358. package/demo/node_modules/dotenv/lib/main.d.ts +153 -0
  359. package/demo/node_modules/dotenv/lib/main.js +361 -0
  360. package/demo/node_modules/dotenv/package.json +65 -0
  361. package/demo/node_modules/event-target-shim/LICENSE +22 -0
  362. package/demo/node_modules/event-target-shim/README.md +293 -0
  363. package/demo/node_modules/event-target-shim/index.d.ts +399 -0
  364. package/demo/node_modules/event-target-shim/package.json +82 -0
  365. package/demo/node_modules/form-data/License +19 -0
  366. package/demo/node_modules/form-data/README.md.bak +358 -0
  367. package/demo/node_modules/form-data/Readme.md +358 -0
  368. package/demo/node_modules/form-data/index.d.ts +62 -0
  369. package/demo/node_modules/form-data/lib/browser.js +2 -0
  370. package/demo/node_modules/form-data/lib/form_data.js +501 -0
  371. package/demo/node_modules/form-data/lib/populate.js +10 -0
  372. package/demo/node_modules/form-data/package.json +68 -0
  373. package/demo/node_modules/form-data-encoder/@type/FileLike.d.ts +23 -0
  374. package/demo/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts +160 -0
  375. package/demo/node_modules/form-data-encoder/@type/FormDataLike.d.ts +40 -0
  376. package/demo/node_modules/form-data-encoder/@type/index.d.ts +5 -0
  377. package/demo/node_modules/form-data-encoder/@type/util/createBoundary.d.ts +13 -0
  378. package/demo/node_modules/form-data-encoder/@type/util/escapeName.d.ts +11 -0
  379. package/demo/node_modules/form-data-encoder/@type/util/isFileLike.d.ts +28 -0
  380. package/demo/node_modules/form-data-encoder/@type/util/isFormData.d.ts +15 -0
  381. package/demo/node_modules/form-data-encoder/@type/util/isFunction.d.ts +7 -0
  382. package/demo/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts +2 -0
  383. package/demo/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts +11 -0
  384. package/demo/node_modules/form-data-encoder/lib/cjs/FileLike.js +2 -0
  385. package/demo/node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js +126 -0
  386. package/demo/node_modules/form-data-encoder/lib/cjs/FormDataLike.js +2 -0
  387. package/demo/node_modules/form-data-encoder/lib/cjs/index.js +17 -0
  388. package/demo/node_modules/form-data-encoder/lib/cjs/package.json +3 -0
  389. package/demo/node_modules/form-data-encoder/lib/cjs/util/createBoundary.js +12 -0
  390. package/demo/node_modules/form-data-encoder/lib/cjs/util/escapeName.js +7 -0
  391. package/demo/node_modules/form-data-encoder/lib/cjs/util/isFileLike.js +16 -0
  392. package/demo/node_modules/form-data-encoder/lib/cjs/util/isFormData.js +16 -0
  393. package/demo/node_modules/form-data-encoder/lib/cjs/util/isFunction.js +4 -0
  394. package/demo/node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js +15 -0
  395. package/demo/node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js +11 -0
  396. package/demo/node_modules/form-data-encoder/lib/esm/FileLike.js +1 -0
  397. package/demo/node_modules/form-data-encoder/lib/esm/FormDataEncoder.js +119 -0
  398. package/demo/node_modules/form-data-encoder/lib/esm/FormDataLike.js +1 -0
  399. package/demo/node_modules/form-data-encoder/lib/esm/index.js +5 -0
  400. package/demo/node_modules/form-data-encoder/lib/esm/package.json +3 -0
  401. package/demo/node_modules/form-data-encoder/lib/esm/util/createBoundary.js +10 -0
  402. package/demo/node_modules/form-data-encoder/lib/esm/util/escapeName.js +5 -0
  403. package/demo/node_modules/form-data-encoder/lib/esm/util/isFileLike.js +9 -0
  404. package/demo/node_modules/form-data-encoder/lib/esm/util/isFormData.js +9 -0
  405. package/demo/node_modules/form-data-encoder/lib/esm/util/isFunction.js +2 -0
  406. package/demo/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js +13 -0
  407. package/demo/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js +9 -0
  408. package/demo/node_modules/form-data-encoder/license +21 -0
  409. package/demo/node_modules/form-data-encoder/package.json +63 -0
  410. package/demo/node_modules/form-data-encoder/readme.md +366 -0
  411. package/demo/node_modules/formdata-node/@type/Blob.d.ts +66 -0
  412. package/demo/node_modules/formdata-node/@type/BlobPart.d.ts +2 -0
  413. package/demo/node_modules/formdata-node/@type/File.d.ts +53 -0
  414. package/demo/node_modules/formdata-node/@type/FormData.d.ts +105 -0
  415. package/demo/node_modules/formdata-node/@type/blobHelpers.d.ts +9 -0
  416. package/demo/node_modules/formdata-node/@type/browser.d.ts +10 -0
  417. package/demo/node_modules/formdata-node/@type/deprecateConstructorEntries.d.ts +1 -0
  418. package/demo/node_modules/formdata-node/@type/fileFromPath.d.ts +55 -0
  419. package/demo/node_modules/formdata-node/@type/index.d.ts +3 -0
  420. package/demo/node_modules/formdata-node/@type/isBlob.d.ts +2 -0
  421. package/demo/node_modules/formdata-node/@type/isFile.d.ts +7 -0
  422. package/demo/node_modules/formdata-node/@type/isFunction.d.ts +1 -0
  423. package/demo/node_modules/formdata-node/@type/isPlainObject.d.ts +2 -0
  424. package/demo/node_modules/formdata-node/lib/cjs/Blob.js +122 -0
  425. package/demo/node_modules/formdata-node/lib/cjs/BlobPart.js +2 -0
  426. package/demo/node_modules/formdata-node/lib/cjs/File.js +52 -0
  427. package/demo/node_modules/formdata-node/lib/cjs/FormData.js +148 -0
  428. package/demo/node_modules/formdata-node/lib/cjs/blobHelpers.js +80 -0
  429. package/demo/node_modules/formdata-node/lib/cjs/browser.js +13 -0
  430. package/demo/node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js +6 -0
  431. package/demo/node_modules/formdata-node/lib/cjs/fileFromPath.js +97 -0
  432. package/demo/node_modules/formdata-node/lib/cjs/index.js +15 -0
  433. package/demo/node_modules/formdata-node/lib/cjs/isBlob.js +6 -0
  434. package/demo/node_modules/formdata-node/lib/cjs/isFile.js +6 -0
  435. package/demo/node_modules/formdata-node/lib/cjs/isFunction.js +5 -0
  436. package/demo/node_modules/formdata-node/lib/cjs/isPlainObject.js +15 -0
  437. package/demo/node_modules/formdata-node/lib/cjs/package.json +3 -0
  438. package/demo/node_modules/formdata-node/lib/esm/Blob.js +118 -0
  439. package/demo/node_modules/formdata-node/lib/esm/BlobPart.js +1 -0
  440. package/demo/node_modules/formdata-node/lib/esm/File.js +48 -0
  441. package/demo/node_modules/formdata-node/lib/esm/FormData.js +144 -0
  442. package/demo/node_modules/formdata-node/lib/esm/blobHelpers.js +75 -0
  443. package/demo/node_modules/formdata-node/lib/esm/browser.js +10 -0
  444. package/demo/node_modules/formdata-node/lib/esm/deprecateConstructorEntries.js +3 -0
  445. package/demo/node_modules/formdata-node/lib/esm/fileFromPath.js +79 -0
  446. package/demo/node_modules/formdata-node/lib/esm/index.js +3 -0
  447. package/demo/node_modules/formdata-node/lib/esm/isBlob.js +2 -0
  448. package/demo/node_modules/formdata-node/lib/esm/isFile.js +2 -0
  449. package/demo/node_modules/formdata-node/lib/esm/isFunction.js +1 -0
  450. package/demo/node_modules/formdata-node/lib/esm/isPlainObject.js +13 -0
  451. package/demo/node_modules/formdata-node/lib/esm/package.json +3 -0
  452. package/demo/node_modules/formdata-node/lib/node-domexception.d.ts +5 -0
  453. package/demo/node_modules/formdata-node/license +21 -0
  454. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/LICENSE +22 -0
  455. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/README.md +135 -0
  456. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/es5/package.json +6 -0
  457. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/package.json +101 -0
  458. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/polyfill/es5/package.json +5 -0
  459. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/polyfill/package.json +5 -0
  460. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/polyfill.d.ts +62 -0
  461. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/ponyfill.d.ts +775 -0
  462. package/demo/node_modules/formdata-node/node_modules/web-streams-polyfill/types/tsdoc-metadata.json +11 -0
  463. package/demo/node_modules/formdata-node/package.json +94 -0
  464. package/demo/node_modules/formdata-node/readme.md +444 -0
  465. package/demo/node_modules/humanize-ms/History.md +25 -0
  466. package/demo/node_modules/humanize-ms/LICENSE +17 -0
  467. package/demo/node_modules/humanize-ms/README.md +40 -0
  468. package/demo/node_modules/humanize-ms/index.js +24 -0
  469. package/demo/node_modules/humanize-ms/package.json +37 -0
  470. package/demo/node_modules/mime-db/HISTORY.md +507 -0
  471. package/demo/node_modules/mime-db/LICENSE +23 -0
  472. package/demo/node_modules/mime-db/README.md +100 -0
  473. package/demo/node_modules/mime-db/db.json +8519 -0
  474. package/demo/node_modules/mime-db/index.js +12 -0
  475. package/demo/node_modules/mime-db/package.json +60 -0
  476. package/demo/node_modules/mime-types/HISTORY.md +397 -0
  477. package/demo/node_modules/mime-types/LICENSE +23 -0
  478. package/demo/node_modules/mime-types/README.md +113 -0
  479. package/demo/node_modules/mime-types/index.js +188 -0
  480. package/demo/node_modules/mime-types/package.json +44 -0
  481. package/demo/node_modules/ms/index.js +162 -0
  482. package/demo/node_modules/ms/license.md +21 -0
  483. package/demo/node_modules/ms/package.json +38 -0
  484. package/demo/node_modules/ms/readme.md +59 -0
  485. package/demo/node_modules/node-domexception/.history/README_20210527203617.md +2 -0
  486. package/demo/node_modules/node-domexception/.history/README_20210527212714.md +41 -0
  487. package/demo/node_modules/node-domexception/.history/README_20210527213345.md +36 -0
  488. package/demo/node_modules/node-domexception/.history/README_20210527213411.md +36 -0
  489. package/demo/node_modules/node-domexception/.history/README_20210527213803.md +36 -0
  490. package/demo/node_modules/node-domexception/.history/README_20210527214323.md +38 -0
  491. package/demo/node_modules/node-domexception/.history/README_20210527214408.md +38 -0
  492. package/demo/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
  493. package/demo/node_modules/node-domexception/.history/index_20210527203947.js +8 -0
  494. package/demo/node_modules/node-domexception/.history/index_20210527204259.js +9 -0
  495. package/demo/node_modules/node-domexception/.history/index_20210527204418.js +9 -0
  496. package/demo/node_modules/node-domexception/.history/index_20210527204756.js +11 -0
  497. package/demo/node_modules/node-domexception/.history/index_20210527204833.js +11 -0
  498. package/demo/node_modules/node-domexception/.history/index_20210527211208.js +15 -0
  499. package/demo/node_modules/node-domexception/.history/index_20210527211248.js +15 -0
  500. package/demo/node_modules/node-domexception/.history/index_20210527212722.js +23 -0
  501. package/demo/node_modules/node-domexception/.history/index_20210527212731.js +23 -0
  502. package/demo/node_modules/node-domexception/.history/index_20210527212746.js +15 -0
  503. package/demo/node_modules/node-domexception/.history/index_20210527212900.js +16 -0
  504. package/demo/node_modules/node-domexception/.history/index_20210527213022.js +16 -0
  505. package/demo/node_modules/node-domexception/.history/index_20210527213822.js +16 -0
  506. package/demo/node_modules/node-domexception/.history/index_20210527213843.js +17 -0
  507. package/demo/node_modules/node-domexception/.history/index_20210527213852.js +17 -0
  508. package/demo/node_modules/node-domexception/.history/index_20210527213910.js +16 -0
  509. package/demo/node_modules/node-domexception/.history/index_20210527214034.js +16 -0
  510. package/demo/node_modules/node-domexception/.history/index_20210527214643.js +41 -0
  511. package/demo/node_modules/node-domexception/.history/index_20210527214654.js +41 -0
  512. package/demo/node_modules/node-domexception/.history/index_20210527214700.js +16 -0
  513. package/demo/node_modules/node-domexception/.history/package_20210527203733.json +19 -0
  514. package/demo/node_modules/node-domexception/.history/package_20210527203825.json +16 -0
  515. package/demo/node_modules/node-domexception/.history/package_20210527204621.json +19 -0
  516. package/demo/node_modules/node-domexception/.history/package_20210527204913.json +25 -0
  517. package/demo/node_modules/node-domexception/.history/package_20210527204925.json +25 -0
  518. package/demo/node_modules/node-domexception/.history/package_20210527205145.json +29 -0
  519. package/demo/node_modules/node-domexception/.history/package_20210527205156.json +29 -0
  520. package/demo/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
  521. package/demo/node_modules/node-domexception/.history/test_20210527205957.js +3 -0
  522. package/demo/node_modules/node-domexception/.history/test_20210527210021.js +3 -0
  523. package/demo/node_modules/node-domexception/LICENSE +21 -0
  524. package/demo/node_modules/node-domexception/README.md +46 -0
  525. package/demo/node_modules/node-domexception/index.js +16 -0
  526. package/demo/node_modules/node-domexception/package.json +29 -0
  527. package/demo/node_modules/node-fetch/LICENSE.md +22 -0
  528. package/demo/node_modules/node-fetch/README.md +634 -0
  529. package/demo/node_modules/node-fetch/browser.js +25 -0
  530. package/demo/node_modules/node-fetch/lib/index.es.js +1777 -0
  531. package/demo/node_modules/node-fetch/lib/index.js +1787 -0
  532. package/demo/node_modules/node-fetch/lib/index.mjs +1775 -0
  533. package/demo/node_modules/node-fetch/package.json +89 -0
  534. package/demo/node_modules/openai/CHANGELOG.md +1176 -0
  535. package/demo/node_modules/openai/LICENSE +201 -0
  536. package/demo/node_modules/openai/README.md +616 -0
  537. package/demo/node_modules/openai/_shims/MultipartBody.d.ts +9 -0
  538. package/demo/node_modules/openai/_shims/MultipartBody.d.ts.map +1 -0
  539. package/demo/node_modules/openai/_shims/MultipartBody.js +16 -0
  540. package/demo/node_modules/openai/_shims/MultipartBody.js.map +1 -0
  541. package/demo/node_modules/openai/_shims/MultipartBody.mjs +12 -0
  542. package/demo/node_modules/openai/_shims/MultipartBody.mjs.map +1 -0
  543. package/demo/node_modules/openai/_shims/README.md +46 -0
  544. package/demo/node_modules/openai/_shims/auto/runtime-bun.d.ts +5 -0
  545. package/demo/node_modules/openai/_shims/auto/runtime-bun.d.ts.map +1 -0
  546. package/demo/node_modules/openai/_shims/auto/runtime-bun.js +21 -0
  547. package/demo/node_modules/openai/_shims/auto/runtime-bun.js.map +1 -0
  548. package/demo/node_modules/openai/_shims/auto/runtime-bun.mjs +2 -0
  549. package/demo/node_modules/openai/_shims/auto/runtime-bun.mjs.map +1 -0
  550. package/demo/node_modules/openai/_shims/auto/runtime-node.d.ts +5 -0
  551. package/demo/node_modules/openai/_shims/auto/runtime-node.d.ts.map +1 -0
  552. package/demo/node_modules/openai/_shims/auto/runtime-node.js +21 -0
  553. package/demo/node_modules/openai/_shims/auto/runtime-node.js.map +1 -0
  554. package/demo/node_modules/openai/_shims/auto/runtime-node.mjs +2 -0
  555. package/demo/node_modules/openai/_shims/auto/runtime-node.mjs.map +1 -0
  556. package/demo/node_modules/openai/_shims/auto/runtime.d.ts +5 -0
  557. package/demo/node_modules/openai/_shims/auto/runtime.d.ts.map +1 -0
  558. package/demo/node_modules/openai/_shims/auto/runtime.js +21 -0
  559. package/demo/node_modules/openai/_shims/auto/runtime.js.map +1 -0
  560. package/demo/node_modules/openai/_shims/auto/runtime.mjs +2 -0
  561. package/demo/node_modules/openai/_shims/auto/runtime.mjs.map +1 -0
  562. package/demo/node_modules/openai/_shims/auto/types-node.d.ts +5 -0
  563. package/demo/node_modules/openai/_shims/auto/types-node.d.ts.map +1 -0
  564. package/demo/node_modules/openai/_shims/auto/types-node.js +21 -0
  565. package/demo/node_modules/openai/_shims/auto/types-node.js.map +1 -0
  566. package/demo/node_modules/openai/_shims/auto/types-node.mjs +2 -0
  567. package/demo/node_modules/openai/_shims/auto/types-node.mjs.map +1 -0
  568. package/demo/node_modules/openai/_shims/auto/types.d.ts +101 -0
  569. package/demo/node_modules/openai/_shims/auto/types.js +3 -0
  570. package/demo/node_modules/openai/_shims/auto/types.mjs +3 -0
  571. package/demo/node_modules/openai/_shims/bun-runtime.d.ts +6 -0
  572. package/demo/node_modules/openai/_shims/bun-runtime.d.ts.map +1 -0
  573. package/demo/node_modules/openai/_shims/bun-runtime.js +14 -0
  574. package/demo/node_modules/openai/_shims/bun-runtime.js.map +1 -0
  575. package/demo/node_modules/openai/_shims/bun-runtime.mjs +10 -0
  576. package/demo/node_modules/openai/_shims/bun-runtime.mjs.map +1 -0
  577. package/demo/node_modules/openai/_shims/index.d.ts +81 -0
  578. package/demo/node_modules/openai/_shims/index.js +13 -0
  579. package/demo/node_modules/openai/_shims/index.mjs +7 -0
  580. package/demo/node_modules/openai/_shims/manual-types.d.ts +12 -0
  581. package/demo/node_modules/openai/_shims/manual-types.js +3 -0
  582. package/demo/node_modules/openai/_shims/manual-types.mjs +3 -0
  583. package/demo/node_modules/openai/_shims/node-runtime.d.ts +3 -0
  584. package/demo/node_modules/openai/_shims/node-runtime.d.ts.map +1 -0
  585. package/demo/node_modules/openai/_shims/node-runtime.js +90 -0
  586. package/demo/node_modules/openai/_shims/node-runtime.js.map +1 -0
  587. package/demo/node_modules/openai/_shims/node-runtime.mjs +56 -0
  588. package/demo/node_modules/openai/_shims/node-runtime.mjs.map +1 -0
  589. package/demo/node_modules/openai/_shims/node-types.d.ts +42 -0
  590. package/demo/node_modules/openai/_shims/node-types.js +3 -0
  591. package/demo/node_modules/openai/_shims/node-types.mjs +3 -0
  592. package/demo/node_modules/openai/_shims/registry.d.ts +37 -0
  593. package/demo/node_modules/openai/_shims/registry.d.ts.map +1 -0
  594. package/demo/node_modules/openai/_shims/registry.js +41 -0
  595. package/demo/node_modules/openai/_shims/registry.js.map +1 -0
  596. package/demo/node_modules/openai/_shims/registry.mjs +37 -0
  597. package/demo/node_modules/openai/_shims/registry.mjs.map +1 -0
  598. package/demo/node_modules/openai/_shims/web-runtime.d.ts +5 -0
  599. package/demo/node_modules/openai/_shims/web-runtime.d.ts.map +1 -0
  600. package/demo/node_modules/openai/_shims/web-runtime.js +78 -0
  601. package/demo/node_modules/openai/_shims/web-runtime.js.map +1 -0
  602. package/demo/node_modules/openai/_shims/web-runtime.mjs +71 -0
  603. package/demo/node_modules/openai/_shims/web-runtime.mjs.map +1 -0
  604. package/demo/node_modules/openai/_shims/web-types.d.ts +83 -0
  605. package/demo/node_modules/openai/_shims/web-types.js +3 -0
  606. package/demo/node_modules/openai/_shims/web-types.mjs +3 -0
  607. package/demo/node_modules/openai/bin/cli +49 -0
  608. package/demo/node_modules/openai/core.d.ts +239 -0
  609. package/demo/node_modules/openai/core.d.ts.map +1 -0
  610. package/demo/node_modules/openai/core.js +879 -0
  611. package/demo/node_modules/openai/core.js.map +1 -0
  612. package/demo/node_modules/openai/core.mjs +848 -0
  613. package/demo/node_modules/openai/core.mjs.map +1 -0
  614. package/demo/node_modules/openai/error.d.ts +57 -0
  615. package/demo/node_modules/openai/error.d.ts.map +1 -0
  616. package/demo/node_modules/openai/error.js +148 -0
  617. package/demo/node_modules/openai/error.js.map +1 -0
  618. package/demo/node_modules/openai/error.mjs +132 -0
  619. package/demo/node_modules/openai/error.mjs.map +1 -0
  620. package/demo/node_modules/openai/index.d.mts +267 -0
  621. package/demo/node_modules/openai/index.d.ts +267 -0
  622. package/demo/node_modules/openai/index.d.ts.map +1 -0
  623. package/demo/node_modules/openai/index.js +262 -0
  624. package/demo/node_modules/openai/index.js.map +1 -0
  625. package/demo/node_modules/openai/index.mjs +232 -0
  626. package/demo/node_modules/openai/index.mjs.map +1 -0
  627. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.d.ts +74 -0
  628. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.d.ts.map +1 -0
  629. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.js +246 -0
  630. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.js.map +1 -0
  631. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.mjs +242 -0
  632. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.mjs.map +1 -0
  633. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +114 -0
  634. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts.map +1 -0
  635. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.js +519 -0
  636. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.js.map +1 -0
  637. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.mjs +515 -0
  638. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.mjs.map +1 -0
  639. package/demo/node_modules/openai/lib/AssistantStream.d.ts +58 -0
  640. package/demo/node_modules/openai/lib/AssistantStream.d.ts.map +1 -0
  641. package/demo/node_modules/openai/lib/AssistantStream.js +548 -0
  642. package/demo/node_modules/openai/lib/AssistantStream.js.map +1 -0
  643. package/demo/node_modules/openai/lib/AssistantStream.mjs +521 -0
  644. package/demo/node_modules/openai/lib/AssistantStream.mjs.map +1 -0
  645. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.d.ts +2 -0
  646. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.d.ts.map +1 -0
  647. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.js +2177 -0
  648. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.js.map +1 -0
  649. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.mjs +2172 -0
  650. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.mjs.map +1 -0
  651. package/demo/node_modules/openai/lib/ChatCompletionRunner.d.ts +19 -0
  652. package/demo/node_modules/openai/lib/ChatCompletionRunner.d.ts.map +1 -0
  653. package/demo/node_modules/openai/lib/ChatCompletionRunner.js +34 -0
  654. package/demo/node_modules/openai/lib/ChatCompletionRunner.js.map +1 -0
  655. package/demo/node_modules/openai/lib/ChatCompletionRunner.mjs +30 -0
  656. package/demo/node_modules/openai/lib/ChatCompletionRunner.mjs.map +1 -0
  657. package/demo/node_modules/openai/lib/ChatCompletionStream.d.ts +149 -0
  658. package/demo/node_modules/openai/lib/ChatCompletionStream.d.ts.map +1 -0
  659. package/demo/node_modules/openai/lib/ChatCompletionStream.js +312 -0
  660. package/demo/node_modules/openai/lib/ChatCompletionStream.js.map +1 -0
  661. package/demo/node_modules/openai/lib/ChatCompletionStream.mjs +308 -0
  662. package/demo/node_modules/openai/lib/ChatCompletionStream.mjs.map +1 -0
  663. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts +22 -0
  664. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts.map +1 -0
  665. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.js +32 -0
  666. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.js.map +1 -0
  667. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs +28 -0
  668. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs.map +1 -0
  669. package/demo/node_modules/openai/lib/RunnableFunction.d.ts +95 -0
  670. package/demo/node_modules/openai/lib/RunnableFunction.d.ts.map +1 -0
  671. package/demo/node_modules/openai/lib/RunnableFunction.js +35 -0
  672. package/demo/node_modules/openai/lib/RunnableFunction.js.map +1 -0
  673. package/demo/node_modules/openai/lib/RunnableFunction.mjs +29 -0
  674. package/demo/node_modules/openai/lib/RunnableFunction.mjs.map +1 -0
  675. package/demo/node_modules/openai/lib/Util.d.ts +5 -0
  676. package/demo/node_modules/openai/lib/Util.d.ts.map +1 -0
  677. package/demo/node_modules/openai/lib/Util.js +26 -0
  678. package/demo/node_modules/openai/lib/Util.js.map +1 -0
  679. package/demo/node_modules/openai/lib/Util.mjs +22 -0
  680. package/demo/node_modules/openai/lib/Util.mjs.map +1 -0
  681. package/demo/node_modules/openai/lib/chatCompletionUtils.d.ts +6 -0
  682. package/demo/node_modules/openai/lib/chatCompletionUtils.d.ts.map +1 -0
  683. package/demo/node_modules/openai/lib/chatCompletionUtils.js +20 -0
  684. package/demo/node_modules/openai/lib/chatCompletionUtils.js.map +1 -0
  685. package/demo/node_modules/openai/lib/chatCompletionUtils.mjs +13 -0
  686. package/demo/node_modules/openai/lib/chatCompletionUtils.mjs.map +1 -0
  687. package/demo/node_modules/openai/lib/jsonschema.d.ts +106 -0
  688. package/demo/node_modules/openai/lib/jsonschema.d.ts.map +1 -0
  689. package/demo/node_modules/openai/lib/jsonschema.js +11 -0
  690. package/demo/node_modules/openai/lib/jsonschema.js.map +1 -0
  691. package/demo/node_modules/openai/lib/jsonschema.mjs +10 -0
  692. package/demo/node_modules/openai/lib/jsonschema.mjs.map +1 -0
  693. package/demo/node_modules/openai/package.json +105 -0
  694. package/demo/node_modules/openai/pagination.d.ts +37 -0
  695. package/demo/node_modules/openai/pagination.d.ts.map +1 -0
  696. package/demo/node_modules/openai/pagination.js +64 -0
  697. package/demo/node_modules/openai/pagination.js.map +1 -0
  698. package/demo/node_modules/openai/pagination.mjs +59 -0
  699. package/demo/node_modules/openai/pagination.mjs.map +1 -0
  700. package/demo/node_modules/openai/resource.d.ts +6 -0
  701. package/demo/node_modules/openai/resource.d.ts.map +1 -0
  702. package/demo/node_modules/openai/resource.js +11 -0
  703. package/demo/node_modules/openai/resource.js.map +1 -0
  704. package/demo/node_modules/openai/resource.mjs +7 -0
  705. package/demo/node_modules/openai/resource.mjs.map +1 -0
  706. package/demo/node_modules/openai/resources/audio/audio.d.ts +20 -0
  707. package/demo/node_modules/openai/resources/audio/audio.d.ts.map +1 -0
  708. package/demo/node_modules/openai/resources/audio/audio.js +46 -0
  709. package/demo/node_modules/openai/resources/audio/audio.js.map +1 -0
  710. package/demo/node_modules/openai/resources/audio/audio.mjs +19 -0
  711. package/demo/node_modules/openai/resources/audio/audio.mjs.map +1 -0
  712. package/demo/node_modules/openai/resources/audio/index.d.ts +5 -0
  713. package/demo/node_modules/openai/resources/audio/index.d.ts.map +1 -0
  714. package/demo/node_modules/openai/resources/audio/index.js +13 -0
  715. package/demo/node_modules/openai/resources/audio/index.js.map +1 -0
  716. package/demo/node_modules/openai/resources/audio/index.mjs +6 -0
  717. package/demo/node_modules/openai/resources/audio/index.mjs.map +1 -0
  718. package/demo/node_modules/openai/resources/audio/speech.d.ts +42 -0
  719. package/demo/node_modules/openai/resources/audio/speech.d.ts.map +1 -0
  720. package/demo/node_modules/openai/resources/audio/speech.js +17 -0
  721. package/demo/node_modules/openai/resources/audio/speech.js.map +1 -0
  722. package/demo/node_modules/openai/resources/audio/speech.mjs +13 -0
  723. package/demo/node_modules/openai/resources/audio/speech.mjs.map +1 -0
  724. package/demo/node_modules/openai/resources/audio/transcriptions.d.ts +71 -0
  725. package/demo/node_modules/openai/resources/audio/transcriptions.d.ts.map +1 -0
  726. package/demo/node_modules/openai/resources/audio/transcriptions.js +18 -0
  727. package/demo/node_modules/openai/resources/audio/transcriptions.js.map +1 -0
  728. package/demo/node_modules/openai/resources/audio/transcriptions.mjs +14 -0
  729. package/demo/node_modules/openai/resources/audio/transcriptions.mjs.map +1 -0
  730. package/demo/node_modules/openai/resources/audio/translations.d.ts +50 -0
  731. package/demo/node_modules/openai/resources/audio/translations.d.ts.map +1 -0
  732. package/demo/node_modules/openai/resources/audio/translations.js +18 -0
  733. package/demo/node_modules/openai/resources/audio/translations.js.map +1 -0
  734. package/demo/node_modules/openai/resources/audio/translations.mjs +14 -0
  735. package/demo/node_modules/openai/resources/audio/translations.mjs.map +1 -0
  736. package/demo/node_modules/openai/resources/batches.d.ts +189 -0
  737. package/demo/node_modules/openai/resources/batches.d.ts.map +1 -0
  738. package/demo/node_modules/openai/resources/batches.js +65 -0
  739. package/demo/node_modules/openai/resources/batches.js.map +1 -0
  740. package/demo/node_modules/openai/resources/batches.mjs +37 -0
  741. package/demo/node_modules/openai/resources/batches.mjs.map +1 -0
  742. package/demo/node_modules/openai/resources/beta/assistants.d.ts +1048 -0
  743. package/demo/node_modules/openai/resources/beta/assistants.d.ts.map +1 -0
  744. package/demo/node_modules/openai/resources/beta/assistants.js +89 -0
  745. package/demo/node_modules/openai/resources/beta/assistants.js.map +1 -0
  746. package/demo/node_modules/openai/resources/beta/assistants.mjs +61 -0
  747. package/demo/node_modules/openai/resources/beta/assistants.mjs.map +1 -0
  748. package/demo/node_modules/openai/resources/beta/beta.d.ts +53 -0
  749. package/demo/node_modules/openai/resources/beta/beta.d.ts.map +1 -0
  750. package/demo/node_modules/openai/resources/beta/beta.js +51 -0
  751. package/demo/node_modules/openai/resources/beta/beta.js.map +1 -0
  752. package/demo/node_modules/openai/resources/beta/beta.mjs +24 -0
  753. package/demo/node_modules/openai/resources/beta/beta.mjs.map +1 -0
  754. package/demo/node_modules/openai/resources/beta/chat/chat.d.ts +9 -0
  755. package/demo/node_modules/openai/resources/beta/chat/chat.d.ts.map +1 -0
  756. package/demo/node_modules/openai/resources/beta/chat/chat.js +40 -0
  757. package/demo/node_modules/openai/resources/beta/chat/chat.js.map +1 -0
  758. package/demo/node_modules/openai/resources/beta/chat/chat.mjs +13 -0
  759. package/demo/node_modules/openai/resources/beta/chat/chat.mjs.map +1 -0
  760. package/demo/node_modules/openai/resources/beta/chat/completions.d.ts +37 -0
  761. package/demo/node_modules/openai/resources/beta/chat/completions.d.ts.map +1 -0
  762. package/demo/node_modules/openai/resources/beta/chat/completions.js +39 -0
  763. package/demo/node_modules/openai/resources/beta/chat/completions.js.map +1 -0
  764. package/demo/node_modules/openai/resources/beta/chat/completions.mjs +30 -0
  765. package/demo/node_modules/openai/resources/beta/chat/completions.mjs.map +1 -0
  766. package/demo/node_modules/openai/resources/beta/chat/index.d.ts +3 -0
  767. package/demo/node_modules/openai/resources/beta/chat/index.d.ts.map +1 -0
  768. package/demo/node_modules/openai/resources/beta/chat/index.js +9 -0
  769. package/demo/node_modules/openai/resources/beta/chat/index.js.map +1 -0
  770. package/demo/node_modules/openai/resources/beta/chat/index.mjs +4 -0
  771. package/demo/node_modules/openai/resources/beta/chat/index.mjs.map +1 -0
  772. package/demo/node_modules/openai/resources/beta/index.d.ts +6 -0
  773. package/demo/node_modules/openai/resources/beta/index.d.ts.map +1 -0
  774. package/demo/node_modules/openai/resources/beta/index.js +17 -0
  775. package/demo/node_modules/openai/resources/beta/index.js.map +1 -0
  776. package/demo/node_modules/openai/resources/beta/index.mjs +7 -0
  777. package/demo/node_modules/openai/resources/beta/index.mjs.map +1 -0
  778. package/demo/node_modules/openai/resources/beta/threads/index.d.ts +4 -0
  779. package/demo/node_modules/openai/resources/beta/threads/index.d.ts.map +1 -0
  780. package/demo/node_modules/openai/resources/beta/threads/index.js +13 -0
  781. package/demo/node_modules/openai/resources/beta/threads/index.js.map +1 -0
  782. package/demo/node_modules/openai/resources/beta/threads/index.mjs +5 -0
  783. package/demo/node_modules/openai/resources/beta/threads/index.mjs.map +1 -0
  784. package/demo/node_modules/openai/resources/beta/threads/messages.d.ts +552 -0
  785. package/demo/node_modules/openai/resources/beta/threads/messages.d.ts.map +1 -0
  786. package/demo/node_modules/openai/resources/beta/threads/messages.js +89 -0
  787. package/demo/node_modules/openai/resources/beta/threads/messages.js.map +1 -0
  788. package/demo/node_modules/openai/resources/beta/threads/messages.mjs +61 -0
  789. package/demo/node_modules/openai/resources/beta/threads/messages.mjs.map +1 -0
  790. package/demo/node_modules/openai/resources/beta/threads/runs/index.d.ts +3 -0
  791. package/demo/node_modules/openai/resources/beta/threads/runs/index.d.ts.map +1 -0
  792. package/demo/node_modules/openai/resources/beta/threads/runs/index.js +11 -0
  793. package/demo/node_modules/openai/resources/beta/threads/runs/index.js.map +1 -0
  794. package/demo/node_modules/openai/resources/beta/threads/runs/index.mjs +4 -0
  795. package/demo/node_modules/openai/resources/beta/threads/runs/index.mjs.map +1 -0
  796. package/demo/node_modules/openai/resources/beta/threads/runs/runs.d.ts +1194 -0
  797. package/demo/node_modules/openai/resources/beta/threads/runs/runs.d.ts.map +1 -0
  798. package/demo/node_modules/openai/resources/beta/threads/runs/runs.js +190 -0
  799. package/demo/node_modules/openai/resources/beta/threads/runs/runs.js.map +1 -0
  800. package/demo/node_modules/openai/resources/beta/threads/runs/runs.mjs +162 -0
  801. package/demo/node_modules/openai/resources/beta/threads/runs/runs.mjs.map +1 -0
  802. package/demo/node_modules/openai/resources/beta/threads/runs/steps.d.ts +520 -0
  803. package/demo/node_modules/openai/resources/beta/threads/runs/steps.d.ts.map +1 -0
  804. package/demo/node_modules/openai/resources/beta/threads/runs/steps.js +60 -0
  805. package/demo/node_modules/openai/resources/beta/threads/runs/steps.js.map +1 -0
  806. package/demo/node_modules/openai/resources/beta/threads/runs/steps.mjs +32 -0
  807. package/demo/node_modules/openai/resources/beta/threads/runs/steps.mjs.map +1 -0
  808. package/demo/node_modules/openai/resources/beta/threads/threads.d.ts +1240 -0
  809. package/demo/node_modules/openai/resources/beta/threads/threads.d.ts.map +1 -0
  810. package/demo/node_modules/openai/resources/beta/threads/threads.js +108 -0
  811. package/demo/node_modules/openai/resources/beta/threads/threads.js.map +1 -0
  812. package/demo/node_modules/openai/resources/beta/threads/threads.mjs +81 -0
  813. package/demo/node_modules/openai/resources/beta/threads/threads.mjs.map +1 -0
  814. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.d.ts +142 -0
  815. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.d.ts.map +1 -0
  816. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.js +129 -0
  817. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.js.map +1 -0
  818. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.mjs +125 -0
  819. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.mjs.map +1 -0
  820. package/demo/node_modules/openai/resources/beta/vector-stores/files.d.ts +154 -0
  821. package/demo/node_modules/openai/resources/beta/vector-stores/files.d.ts.map +1 -0
  822. package/demo/node_modules/openai/resources/beta/vector-stores/files.js +149 -0
  823. package/demo/node_modules/openai/resources/beta/vector-stores/files.js.map +1 -0
  824. package/demo/node_modules/openai/resources/beta/vector-stores/files.mjs +121 -0
  825. package/demo/node_modules/openai/resources/beta/vector-stores/files.mjs.map +1 -0
  826. package/demo/node_modules/openai/resources/beta/vector-stores/index.d.ts +4 -0
  827. package/demo/node_modules/openai/resources/beta/vector-stores/index.d.ts.map +1 -0
  828. package/demo/node_modules/openai/resources/beta/vector-stores/index.js +13 -0
  829. package/demo/node_modules/openai/resources/beta/vector-stores/index.js.map +1 -0
  830. package/demo/node_modules/openai/resources/beta/vector-stores/index.mjs +5 -0
  831. package/demo/node_modules/openai/resources/beta/vector-stores/index.mjs.map +1 -0
  832. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.d.ts +233 -0
  833. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.d.ts.map +1 -0
  834. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.js +99 -0
  835. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.js.map +1 -0
  836. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.mjs +71 -0
  837. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.mjs.map +1 -0
  838. package/demo/node_modules/openai/resources/chat/chat.d.ts +42 -0
  839. package/demo/node_modules/openai/resources/chat/chat.d.ts.map +1 -0
  840. package/demo/node_modules/openai/resources/chat/chat.js +40 -0
  841. package/demo/node_modules/openai/resources/chat/chat.js.map +1 -0
  842. package/demo/node_modules/openai/resources/chat/chat.mjs +13 -0
  843. package/demo/node_modules/openai/resources/chat/chat.mjs.map +1 -0
  844. package/demo/node_modules/openai/resources/chat/completions.d.ts +845 -0
  845. package/demo/node_modules/openai/resources/chat/completions.d.ts.map +1 -0
  846. package/demo/node_modules/openai/resources/chat/completions.js +14 -0
  847. package/demo/node_modules/openai/resources/chat/completions.js.map +1 -0
  848. package/demo/node_modules/openai/resources/chat/completions.mjs +10 -0
  849. package/demo/node_modules/openai/resources/chat/completions.mjs.map +1 -0
  850. package/demo/node_modules/openai/resources/chat/index.d.ts +3 -0
  851. package/demo/node_modules/openai/resources/chat/index.d.ts.map +1 -0
  852. package/demo/node_modules/openai/resources/chat/index.js +9 -0
  853. package/demo/node_modules/openai/resources/chat/index.js.map +1 -0
  854. package/demo/node_modules/openai/resources/chat/index.mjs +4 -0
  855. package/demo/node_modules/openai/resources/chat/index.mjs.map +1 -0
  856. package/demo/node_modules/openai/resources/completions.d.ts +272 -0
  857. package/demo/node_modules/openai/resources/completions.d.ts.map +1 -0
  858. package/demo/node_modules/openai/resources/completions.js +14 -0
  859. package/demo/node_modules/openai/resources/completions.js.map +1 -0
  860. package/demo/node_modules/openai/resources/completions.mjs +10 -0
  861. package/demo/node_modules/openai/resources/completions.mjs.map +1 -0
  862. package/demo/node_modules/openai/resources/embeddings.d.ts +103 -0
  863. package/demo/node_modules/openai/resources/embeddings.d.ts.map +1 -0
  864. package/demo/node_modules/openai/resources/embeddings.js +17 -0
  865. package/demo/node_modules/openai/resources/embeddings.js.map +1 -0
  866. package/demo/node_modules/openai/resources/embeddings.mjs +13 -0
  867. package/demo/node_modules/openai/resources/embeddings.mjs.map +1 -0
  868. package/demo/node_modules/openai/resources/files.d.ts +140 -0
  869. package/demo/node_modules/openai/resources/files.d.ts.map +1 -0
  870. package/demo/node_modules/openai/resources/files.js +120 -0
  871. package/demo/node_modules/openai/resources/files.js.map +1 -0
  872. package/demo/node_modules/openai/resources/files.mjs +92 -0
  873. package/demo/node_modules/openai/resources/files.mjs.map +1 -0
  874. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts +19 -0
  875. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts.map +1 -0
  876. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.js +42 -0
  877. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.js.map +1 -0
  878. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.mjs +15 -0
  879. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.mjs.map +1 -0
  880. package/demo/node_modules/openai/resources/fine-tuning/index.d.ts +3 -0
  881. package/demo/node_modules/openai/resources/fine-tuning/index.d.ts.map +1 -0
  882. package/demo/node_modules/openai/resources/fine-tuning/index.js +11 -0
  883. package/demo/node_modules/openai/resources/fine-tuning/index.js.map +1 -0
  884. package/demo/node_modules/openai/resources/fine-tuning/index.mjs +4 -0
  885. package/demo/node_modules/openai/resources/fine-tuning/index.mjs.map +1 -0
  886. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts +69 -0
  887. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts.map +1 -0
  888. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +47 -0
  889. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js.map +1 -0
  890. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs +19 -0
  891. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs.map +1 -0
  892. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.d.ts +3 -0
  893. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.d.ts.map +1 -0
  894. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.js +12 -0
  895. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.js.map +1 -0
  896. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.mjs +4 -0
  897. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.mjs.map +1 -0
  898. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts +362 -0
  899. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts.map +1 -0
  900. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.js +93 -0
  901. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.js.map +1 -0
  902. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs +64 -0
  903. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs.map +1 -0
  904. package/demo/node_modules/openai/resources/images.d.ts +174 -0
  905. package/demo/node_modules/openai/resources/images.d.ts.map +1 -0
  906. package/demo/node_modules/openai/resources/images.js +30 -0
  907. package/demo/node_modules/openai/resources/images.js.map +1 -0
  908. package/demo/node_modules/openai/resources/images.mjs +26 -0
  909. package/demo/node_modules/openai/resources/images.mjs.map +1 -0
  910. package/demo/node_modules/openai/resources/index.d.ts +13 -0
  911. package/demo/node_modules/openai/resources/index.d.ts.map +1 -0
  912. package/demo/node_modules/openai/resources/index.js +44 -0
  913. package/demo/node_modules/openai/resources/index.js.map +1 -0
  914. package/demo/node_modules/openai/resources/index.mjs +14 -0
  915. package/demo/node_modules/openai/resources/index.mjs.map +1 -0
  916. package/demo/node_modules/openai/resources/models.d.ts +58 -0
  917. package/demo/node_modules/openai/resources/models.d.ts.map +1 -0
  918. package/demo/node_modules/openai/resources/models.js +64 -0
  919. package/demo/node_modules/openai/resources/models.js.map +1 -0
  920. package/demo/node_modules/openai/resources/models.mjs +36 -0
  921. package/demo/node_modules/openai/resources/models.mjs.map +1 -0
  922. package/demo/node_modules/openai/resources/moderations.d.ts +176 -0
  923. package/demo/node_modules/openai/resources/moderations.d.ts.map +1 -0
  924. package/demo/node_modules/openai/resources/moderations.js +17 -0
  925. package/demo/node_modules/openai/resources/moderations.js.map +1 -0
  926. package/demo/node_modules/openai/resources/moderations.mjs +13 -0
  927. package/demo/node_modules/openai/resources/moderations.mjs.map +1 -0
  928. package/demo/node_modules/openai/resources/shared.d.ts +39 -0
  929. package/demo/node_modules/openai/resources/shared.d.ts.map +1 -0
  930. package/demo/node_modules/openai/resources/shared.js +4 -0
  931. package/demo/node_modules/openai/resources/shared.js.map +1 -0
  932. package/demo/node_modules/openai/resources/shared.mjs +3 -0
  933. package/demo/node_modules/openai/resources/shared.mjs.map +1 -0
  934. package/demo/node_modules/openai/shims/node.d.ts +29 -0
  935. package/demo/node_modules/openai/shims/node.d.ts.map +1 -0
  936. package/demo/node_modules/openai/shims/node.js +31 -0
  937. package/demo/node_modules/openai/shims/node.js.map +1 -0
  938. package/demo/node_modules/openai/shims/node.mjs +5 -0
  939. package/demo/node_modules/openai/shims/node.mjs.map +1 -0
  940. package/demo/node_modules/openai/shims/web.d.ts +26 -0
  941. package/demo/node_modules/openai/shims/web.d.ts.map +1 -0
  942. package/demo/node_modules/openai/shims/web.js +31 -0
  943. package/demo/node_modules/openai/shims/web.js.map +1 -0
  944. package/demo/node_modules/openai/shims/web.mjs +5 -0
  945. package/demo/node_modules/openai/shims/web.mjs.map +1 -0
  946. package/demo/node_modules/openai/src/_shims/MultipartBody.ts +9 -0
  947. package/demo/node_modules/openai/src/_shims/README.md +46 -0
  948. package/demo/node_modules/openai/src/_shims/auto/runtime-bun.ts +4 -0
  949. package/demo/node_modules/openai/src/_shims/auto/runtime-node.ts +4 -0
  950. package/demo/node_modules/openai/src/_shims/auto/runtime.ts +4 -0
  951. package/demo/node_modules/openai/src/_shims/auto/types-node.ts +4 -0
  952. package/demo/node_modules/openai/src/_shims/auto/types.d.ts +101 -0
  953. package/demo/node_modules/openai/src/_shims/auto/types.js +3 -0
  954. package/demo/node_modules/openai/src/_shims/auto/types.mjs +3 -0
  955. package/demo/node_modules/openai/src/_shims/bun-runtime.ts +14 -0
  956. package/demo/node_modules/openai/src/_shims/index.d.ts +81 -0
  957. package/demo/node_modules/openai/src/_shims/index.js +13 -0
  958. package/demo/node_modules/openai/src/_shims/index.mjs +7 -0
  959. package/demo/node_modules/openai/src/_shims/manual-types.d.ts +12 -0
  960. package/demo/node_modules/openai/src/_shims/manual-types.js +3 -0
  961. package/demo/node_modules/openai/src/_shims/manual-types.mjs +3 -0
  962. package/demo/node_modules/openai/src/_shims/node-runtime.ts +83 -0
  963. package/demo/node_modules/openai/src/_shims/node-types.d.ts +42 -0
  964. package/demo/node_modules/openai/src/_shims/node-types.js +3 -0
  965. package/demo/node_modules/openai/src/_shims/node-types.mjs +3 -0
  966. package/demo/node_modules/openai/src/_shims/registry.ts +65 -0
  967. package/demo/node_modules/openai/src/_shims/web-runtime.ts +103 -0
  968. package/demo/node_modules/openai/src/_shims/web-types.d.ts +83 -0
  969. package/demo/node_modules/openai/src/_shims/web-types.js +3 -0
  970. package/demo/node_modules/openai/src/_shims/web-types.mjs +3 -0
  971. package/demo/node_modules/openai/src/core.ts +1162 -0
  972. package/demo/node_modules/openai/src/error.ts +158 -0
  973. package/demo/node_modules/openai/src/index.ts +502 -0
  974. package/demo/node_modules/openai/src/lib/.keep +4 -0
  975. package/demo/node_modules/openai/src/lib/AbstractAssistantStreamRunner.ts +340 -0
  976. package/demo/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts +682 -0
  977. package/demo/node_modules/openai/src/lib/AssistantStream.ts +723 -0
  978. package/demo/node_modules/openai/src/lib/ChatCompletionRunFunctions.test.ts +2328 -0
  979. package/demo/node_modules/openai/src/lib/ChatCompletionRunner.ts +68 -0
  980. package/demo/node_modules/openai/src/lib/ChatCompletionStream.ts +494 -0
  981. package/demo/node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts +68 -0
  982. package/demo/node_modules/openai/src/lib/RunnableFunction.ts +134 -0
  983. package/demo/node_modules/openai/src/lib/Util.ts +23 -0
  984. package/demo/node_modules/openai/src/lib/chatCompletionUtils.ts +28 -0
  985. package/demo/node_modules/openai/src/lib/jsonschema.ts +148 -0
  986. package/demo/node_modules/openai/src/pagination.ts +98 -0
  987. package/demo/node_modules/openai/src/resource.ts +11 -0
  988. package/demo/node_modules/openai/src/resources/audio/audio.ts +23 -0
  989. package/demo/node_modules/openai/src/resources/audio/index.ts +6 -0
  990. package/demo/node_modules/openai/src/resources/audio/speech.ts +52 -0
  991. package/demo/node_modules/openai/src/resources/audio/transcriptions.ts +84 -0
  992. package/demo/node_modules/openai/src/resources/audio/translations.ts +61 -0
  993. package/demo/node_modules/openai/src/resources/batches.ts +252 -0
  994. package/demo/node_modules/openai/src/resources/beta/assistants.ts +1315 -0
  995. package/demo/node_modules/openai/src/resources/beta/beta.ts +56 -0
  996. package/demo/node_modules/openai/src/resources/beta/chat/chat.ts +12 -0
  997. package/demo/node_modules/openai/src/resources/beta/chat/completions.ts +106 -0
  998. package/demo/node_modules/openai/src/resources/beta/chat/index.ts +4 -0
  999. package/demo/node_modules/openai/src/resources/beta/index.ts +48 -0
  1000. package/demo/node_modules/openai/src/resources/beta/threads/index.ts +72 -0
  1001. package/demo/node_modules/openai/src/resources/beta/threads/messages.ts +706 -0
  1002. package/demo/node_modules/openai/src/resources/beta/threads/runs/index.ts +44 -0
  1003. package/demo/node_modules/openai/src/resources/beta/threads/runs/runs.ts +1627 -0
  1004. package/demo/node_modules/openai/src/resources/beta/threads/runs/steps.ts +641 -0
  1005. package/demo/node_modules/openai/src/resources/beta/threads/threads.ts +1536 -0
  1006. package/demo/node_modules/openai/src/resources/beta/vector-stores/file-batches.ts +293 -0
  1007. package/demo/node_modules/openai/src/resources/beta/vector-stores/files.ts +284 -0
  1008. package/demo/node_modules/openai/src/resources/beta/vector-stores/index.ts +25 -0
  1009. package/demo/node_modules/openai/src/resources/beta/vector-stores/vector-stores.ts +318 -0
  1010. package/demo/node_modules/openai/src/resources/chat/chat.ts +67 -0
  1011. package/demo/node_modules/openai/src/resources/chat/completions.ts +996 -0
  1012. package/demo/node_modules/openai/src/resources/chat/index.ts +33 -0
  1013. package/demo/node_modules/openai/src/resources/completions.ts +329 -0
  1014. package/demo/node_modules/openai/src/resources/embeddings.ts +125 -0
  1015. package/demo/node_modules/openai/src/resources/files.ts +214 -0
  1016. package/demo/node_modules/openai/src/resources/fine-tuning/fine-tuning.ts +22 -0
  1017. package/demo/node_modules/openai/src/resources/fine-tuning/index.ts +16 -0
  1018. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/checkpoints.ts +108 -0
  1019. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/index.ts +21 -0
  1020. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/jobs.ts +458 -0
  1021. package/demo/node_modules/openai/src/resources/images.ts +215 -0
  1022. package/demo/node_modules/openai/src/resources/index.ts +45 -0
  1023. package/demo/node_modules/openai/src/resources/models.ts +76 -0
  1024. package/demo/node_modules/openai/src/resources/moderations.ts +214 -0
  1025. package/demo/node_modules/openai/src/resources/shared.ts +47 -0
  1026. package/demo/node_modules/openai/src/shims/node.ts +50 -0
  1027. package/demo/node_modules/openai/src/shims/web.ts +50 -0
  1028. package/demo/node_modules/openai/src/streaming.ts +508 -0
  1029. package/demo/node_modules/openai/src/tsconfig.json +11 -0
  1030. package/demo/node_modules/openai/src/uploads.ts +248 -0
  1031. package/demo/node_modules/openai/src/version.ts +1 -0
  1032. package/demo/node_modules/openai/streaming.d.ts +41 -0
  1033. package/demo/node_modules/openai/streaming.d.ts.map +1 -0
  1034. package/demo/node_modules/openai/streaming.js +433 -0
  1035. package/demo/node_modules/openai/streaming.js.map +1 -0
  1036. package/demo/node_modules/openai/streaming.mjs +426 -0
  1037. package/demo/node_modules/openai/streaming.mjs.map +1 -0
  1038. package/demo/node_modules/openai/uploads.d.ts +75 -0
  1039. package/demo/node_modules/openai/uploads.d.ts.map +1 -0
  1040. package/demo/node_modules/openai/uploads.js +165 -0
  1041. package/demo/node_modules/openai/uploads.js.map +1 -0
  1042. package/demo/node_modules/openai/uploads.mjs +152 -0
  1043. package/demo/node_modules/openai/uploads.mjs.map +1 -0
  1044. package/demo/node_modules/openai/version.d.ts +2 -0
  1045. package/demo/node_modules/openai/version.d.ts.map +1 -0
  1046. package/demo/node_modules/openai/version.js +5 -0
  1047. package/demo/node_modules/openai/version.js.map +1 -0
  1048. package/demo/node_modules/openai/version.mjs +2 -0
  1049. package/demo/node_modules/openai/version.mjs.map +1 -0
  1050. package/demo/node_modules/tr46/index.js +193 -0
  1051. package/demo/node_modules/tr46/lib/.gitkeep +0 -0
  1052. package/demo/node_modules/tr46/lib/mappingTable.json +1 -0
  1053. package/demo/node_modules/tr46/package.json +31 -0
  1054. package/demo/node_modules/undici-types/README.md +6 -0
  1055. package/demo/node_modules/undici-types/agent.d.ts +31 -0
  1056. package/demo/node_modules/undici-types/api.d.ts +43 -0
  1057. package/demo/node_modules/undici-types/balanced-pool.d.ts +18 -0
  1058. package/demo/node_modules/undici-types/cache.d.ts +36 -0
  1059. package/demo/node_modules/undici-types/client.d.ts +97 -0
  1060. package/demo/node_modules/undici-types/connector.d.ts +34 -0
  1061. package/demo/node_modules/undici-types/content-type.d.ts +21 -0
  1062. package/demo/node_modules/undici-types/cookies.d.ts +28 -0
  1063. package/demo/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
  1064. package/demo/node_modules/undici-types/dispatcher.d.ts +241 -0
  1065. package/demo/node_modules/undici-types/errors.d.ts +128 -0
  1066. package/demo/node_modules/undici-types/fetch.d.ts +209 -0
  1067. package/demo/node_modules/undici-types/file.d.ts +39 -0
  1068. package/demo/node_modules/undici-types/filereader.d.ts +54 -0
  1069. package/demo/node_modules/undici-types/formdata.d.ts +108 -0
  1070. package/demo/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  1071. package/demo/node_modules/undici-types/global-origin.d.ts +7 -0
  1072. package/demo/node_modules/undici-types/handlers.d.ts +9 -0
  1073. package/demo/node_modules/undici-types/header.d.ts +4 -0
  1074. package/demo/node_modules/undici-types/index.d.ts +63 -0
  1075. package/demo/node_modules/undici-types/interceptors.d.ts +5 -0
  1076. package/demo/node_modules/undici-types/mock-agent.d.ts +50 -0
  1077. package/demo/node_modules/undici-types/mock-client.d.ts +25 -0
  1078. package/demo/node_modules/undici-types/mock-errors.d.ts +12 -0
  1079. package/demo/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  1080. package/demo/node_modules/undici-types/mock-pool.d.ts +25 -0
  1081. package/demo/node_modules/undici-types/package.json +55 -0
  1082. package/demo/node_modules/undici-types/patch.d.ts +71 -0
  1083. package/demo/node_modules/undici-types/pool-stats.d.ts +19 -0
  1084. package/demo/node_modules/undici-types/pool.d.ts +28 -0
  1085. package/demo/node_modules/undici-types/proxy-agent.d.ts +30 -0
  1086. package/demo/node_modules/undici-types/readable.d.ts +61 -0
  1087. package/demo/node_modules/undici-types/webidl.d.ts +220 -0
  1088. package/demo/node_modules/undici-types/websocket.d.ts +131 -0
  1089. package/demo/node_modules/web-streams-polyfill/LICENSE +22 -0
  1090. package/demo/node_modules/web-streams-polyfill/README.md +110 -0
  1091. package/demo/node_modules/web-streams-polyfill/es2018/package.json +14 -0
  1092. package/demo/node_modules/web-streams-polyfill/es6/package.json +14 -0
  1093. package/demo/node_modules/web-streams-polyfill/package.json +83 -0
  1094. package/demo/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +13 -0
  1095. package/demo/node_modules/web-streams-polyfill/ponyfill/es6/package.json +13 -0
  1096. package/demo/node_modules/web-streams-polyfill/ponyfill/package.json +13 -0
  1097. package/demo/node_modules/webidl-conversions/LICENSE.md +12 -0
  1098. package/demo/node_modules/webidl-conversions/README.md +53 -0
  1099. package/demo/node_modules/webidl-conversions/lib/index.js +189 -0
  1100. package/demo/node_modules/webidl-conversions/package.json +23 -0
  1101. package/demo/node_modules/whatwg-url/LICENSE.txt +21 -0
  1102. package/demo/node_modules/whatwg-url/README.md +67 -0
  1103. package/demo/node_modules/whatwg-url/lib/URL-impl.js +200 -0
  1104. package/demo/node_modules/whatwg-url/lib/URL.js +196 -0
  1105. package/demo/node_modules/whatwg-url/lib/public-api.js +11 -0
  1106. package/demo/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
  1107. package/demo/node_modules/whatwg-url/lib/utils.js +20 -0
  1108. package/demo/node_modules/whatwg-url/package.json +32 -0
  1109. package/demo/package-lock.json +282 -0
  1110. package/demo/package.json +16 -0
  1111. package/index.js +171 -0
  1112. package/package.json +34 -0
@@ -0,0 +1,312 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var _ChatCompletionStream_instances, _ChatCompletionStream_currentChatCompletionSnapshot, _ChatCompletionStream_beginRequest, _ChatCompletionStream_addChunk, _ChatCompletionStream_endRequest, _ChatCompletionStream_accumulateChatCompletion;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ChatCompletionStream = void 0;
16
+ const error_1 = require("openai/error");
17
+ const AbstractChatCompletionRunner_1 = require("./AbstractChatCompletionRunner.js");
18
+ const streaming_1 = require("openai/streaming");
19
+ class ChatCompletionStream extends AbstractChatCompletionRunner_1.AbstractChatCompletionRunner {
20
+ constructor() {
21
+ super(...arguments);
22
+ _ChatCompletionStream_instances.add(this);
23
+ _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0);
24
+ }
25
+ get currentChatCompletionSnapshot() {
26
+ return __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
27
+ }
28
+ /**
29
+ * Intended for use on the frontend, consuming a stream produced with
30
+ * `.toReadableStream()` on the backend.
31
+ *
32
+ * Note that messages sent to the model do not appear in `.on('message')`
33
+ * in this context.
34
+ */
35
+ static fromReadableStream(stream) {
36
+ const runner = new ChatCompletionStream();
37
+ runner._run(() => runner._fromReadableStream(stream));
38
+ return runner;
39
+ }
40
+ static createChatCompletion(completions, params, options) {
41
+ const runner = new ChatCompletionStream();
42
+ runner._run(() => runner._runChatCompletion(completions, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));
43
+ return runner;
44
+ }
45
+ async _createChatCompletion(completions, params, options) {
46
+ const signal = options?.signal;
47
+ if (signal) {
48
+ if (signal.aborted)
49
+ this.controller.abort();
50
+ signal.addEventListener('abort', () => this.controller.abort());
51
+ }
52
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this);
53
+ const stream = await completions.create({ ...params, stream: true }, { ...options, signal: this.controller.signal });
54
+ this._connected();
55
+ for await (const chunk of stream) {
56
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk);
57
+ }
58
+ if (stream.controller.signal?.aborted) {
59
+ throw new error_1.APIUserAbortError();
60
+ }
61
+ return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
62
+ }
63
+ async _fromReadableStream(readableStream, options) {
64
+ const signal = options?.signal;
65
+ if (signal) {
66
+ if (signal.aborted)
67
+ this.controller.abort();
68
+ signal.addEventListener('abort', () => this.controller.abort());
69
+ }
70
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this);
71
+ this._connected();
72
+ const stream = streaming_1.Stream.fromReadableStream(readableStream, this.controller);
73
+ let chatId;
74
+ for await (const chunk of stream) {
75
+ if (chatId && chatId !== chunk.id) {
76
+ // A new request has been made.
77
+ this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
78
+ }
79
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk);
80
+ chatId = chunk.id;
81
+ }
82
+ if (stream.controller.signal?.aborted) {
83
+ throw new error_1.APIUserAbortError();
84
+ }
85
+ return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
86
+ }
87
+ [(_ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap(), _ChatCompletionStream_instances = new WeakSet(), _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest() {
88
+ if (this.ended)
89
+ return;
90
+ __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
91
+ }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk(chunk) {
92
+ if (this.ended)
93
+ return;
94
+ const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
95
+ this._emit('chunk', chunk, completion);
96
+ const delta = chunk.choices[0]?.delta?.content;
97
+ const snapshot = completion.choices[0]?.message;
98
+ if (delta != null && snapshot?.role === 'assistant' && snapshot?.content) {
99
+ this._emit('content', delta, snapshot.content);
100
+ }
101
+ }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest() {
102
+ if (this.ended) {
103
+ throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`);
104
+ }
105
+ const snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
106
+ if (!snapshot) {
107
+ throw new error_1.OpenAIError(`request ended without sending any chunks`);
108
+ }
109
+ __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
110
+ return finalizeChatCompletion(snapshot);
111
+ }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion(chunk) {
112
+ var _a, _b, _c;
113
+ let snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
114
+ const { choices, ...rest } = chunk;
115
+ if (!snapshot) {
116
+ snapshot = __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, {
117
+ ...rest,
118
+ choices: [],
119
+ }, "f");
120
+ }
121
+ else {
122
+ Object.assign(snapshot, rest);
123
+ }
124
+ for (const { delta, finish_reason, index, logprobs = null, ...other } of chunk.choices) {
125
+ let choice = snapshot.choices[index];
126
+ if (!choice) {
127
+ choice = snapshot.choices[index] = { finish_reason, index, message: {}, logprobs, ...other };
128
+ }
129
+ if (logprobs) {
130
+ if (!choice.logprobs) {
131
+ choice.logprobs = Object.assign({}, logprobs);
132
+ }
133
+ else {
134
+ const { content, ...rest } = logprobs;
135
+ Object.assign(choice.logprobs, rest);
136
+ if (content) {
137
+ (_a = choice.logprobs).content ?? (_a.content = []);
138
+ choice.logprobs.content.push(...content);
139
+ }
140
+ }
141
+ }
142
+ if (finish_reason)
143
+ choice.finish_reason = finish_reason;
144
+ Object.assign(choice, other);
145
+ if (!delta)
146
+ continue; // Shouldn't happen; just in case.
147
+ const { content, function_call, role, tool_calls, ...rest } = delta;
148
+ Object.assign(choice.message, rest);
149
+ if (content)
150
+ choice.message.content = (choice.message.content || '') + content;
151
+ if (role)
152
+ choice.message.role = role;
153
+ if (function_call) {
154
+ if (!choice.message.function_call) {
155
+ choice.message.function_call = function_call;
156
+ }
157
+ else {
158
+ if (function_call.name)
159
+ choice.message.function_call.name = function_call.name;
160
+ if (function_call.arguments) {
161
+ (_b = choice.message.function_call).arguments ?? (_b.arguments = '');
162
+ choice.message.function_call.arguments += function_call.arguments;
163
+ }
164
+ }
165
+ }
166
+ if (tool_calls) {
167
+ if (!choice.message.tool_calls)
168
+ choice.message.tool_calls = [];
169
+ for (const { index, id, type, function: fn, ...rest } of tool_calls) {
170
+ const tool_call = ((_c = choice.message.tool_calls)[index] ?? (_c[index] = {}));
171
+ Object.assign(tool_call, rest);
172
+ if (id)
173
+ tool_call.id = id;
174
+ if (type)
175
+ tool_call.type = type;
176
+ if (fn)
177
+ tool_call.function ?? (tool_call.function = { arguments: '' });
178
+ if (fn?.name)
179
+ tool_call.function.name = fn.name;
180
+ if (fn?.arguments)
181
+ tool_call.function.arguments += fn.arguments;
182
+ }
183
+ }
184
+ }
185
+ return snapshot;
186
+ }, Symbol.asyncIterator)]() {
187
+ const pushQueue = [];
188
+ const readQueue = [];
189
+ let done = false;
190
+ this.on('chunk', (chunk) => {
191
+ const reader = readQueue.shift();
192
+ if (reader) {
193
+ reader.resolve(chunk);
194
+ }
195
+ else {
196
+ pushQueue.push(chunk);
197
+ }
198
+ });
199
+ this.on('end', () => {
200
+ done = true;
201
+ for (const reader of readQueue) {
202
+ reader.resolve(undefined);
203
+ }
204
+ readQueue.length = 0;
205
+ });
206
+ this.on('abort', (err) => {
207
+ done = true;
208
+ for (const reader of readQueue) {
209
+ reader.reject(err);
210
+ }
211
+ readQueue.length = 0;
212
+ });
213
+ this.on('error', (err) => {
214
+ done = true;
215
+ for (const reader of readQueue) {
216
+ reader.reject(err);
217
+ }
218
+ readQueue.length = 0;
219
+ });
220
+ return {
221
+ next: async () => {
222
+ if (!pushQueue.length) {
223
+ if (done) {
224
+ return { value: undefined, done: true };
225
+ }
226
+ return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));
227
+ }
228
+ const chunk = pushQueue.shift();
229
+ return { value: chunk, done: false };
230
+ },
231
+ return: async () => {
232
+ this.abort();
233
+ return { value: undefined, done: true };
234
+ },
235
+ };
236
+ }
237
+ toReadableStream() {
238
+ const stream = new streaming_1.Stream(this[Symbol.asyncIterator].bind(this), this.controller);
239
+ return stream.toReadableStream();
240
+ }
241
+ }
242
+ exports.ChatCompletionStream = ChatCompletionStream;
243
+ function finalizeChatCompletion(snapshot) {
244
+ const { id, choices, created, model, system_fingerprint, ...rest } = snapshot;
245
+ return {
246
+ ...rest,
247
+ id,
248
+ choices: choices.map(({ message, finish_reason, index, logprobs, ...choiceRest }) => {
249
+ if (!finish_reason)
250
+ throw new error_1.OpenAIError(`missing finish_reason for choice ${index}`);
251
+ const { content = null, function_call, tool_calls, ...messageRest } = message;
252
+ const role = message.role; // this is what we expect; in theory it could be different which would make our types a slight lie but would be fine.
253
+ if (!role)
254
+ throw new error_1.OpenAIError(`missing role for choice ${index}`);
255
+ if (function_call) {
256
+ const { arguments: args, name } = function_call;
257
+ if (args == null)
258
+ throw new error_1.OpenAIError(`missing function_call.arguments for choice ${index}`);
259
+ if (!name)
260
+ throw new error_1.OpenAIError(`missing function_call.name for choice ${index}`);
261
+ return {
262
+ ...choiceRest,
263
+ message: { content, function_call: { arguments: args, name }, role },
264
+ finish_reason,
265
+ index,
266
+ logprobs,
267
+ };
268
+ }
269
+ if (tool_calls) {
270
+ return {
271
+ ...choiceRest,
272
+ index,
273
+ finish_reason,
274
+ logprobs,
275
+ message: {
276
+ ...messageRest,
277
+ role,
278
+ content,
279
+ tool_calls: tool_calls.map((tool_call, i) => {
280
+ const { function: fn, type, id, ...toolRest } = tool_call;
281
+ const { arguments: args, name, ...fnRest } = fn || {};
282
+ if (id == null)
283
+ throw new error_1.OpenAIError(`missing choices[${index}].tool_calls[${i}].id\n${str(snapshot)}`);
284
+ if (type == null)
285
+ throw new error_1.OpenAIError(`missing choices[${index}].tool_calls[${i}].type\n${str(snapshot)}`);
286
+ if (name == null)
287
+ throw new error_1.OpenAIError(`missing choices[${index}].tool_calls[${i}].function.name\n${str(snapshot)}`);
288
+ if (args == null)
289
+ throw new error_1.OpenAIError(`missing choices[${index}].tool_calls[${i}].function.arguments\n${str(snapshot)}`);
290
+ return { ...toolRest, id, type, function: { ...fnRest, name, arguments: args } };
291
+ }),
292
+ },
293
+ };
294
+ }
295
+ return {
296
+ ...choiceRest,
297
+ message: { ...messageRest, content, role },
298
+ finish_reason,
299
+ index,
300
+ logprobs,
301
+ };
302
+ }),
303
+ created,
304
+ model,
305
+ object: 'chat.completion',
306
+ ...(system_fingerprint ? { system_fingerprint } : {}),
307
+ };
308
+ }
309
+ function str(x) {
310
+ return JSON.stringify(x);
311
+ }
312
+ //# sourceMappingURL=ChatCompletionStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatCompletionStream.js","sourceRoot":"","sources":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function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ var _ChatCompletionStream_instances, _ChatCompletionStream_currentChatCompletionSnapshot, _ChatCompletionStream_beginRequest, _ChatCompletionStream_addChunk, _ChatCompletionStream_endRequest, _ChatCompletionStream_accumulateChatCompletion;
13
+ import { OpenAIError, APIUserAbortError } from 'openai/error';
14
+ import { AbstractChatCompletionRunner, } from "./AbstractChatCompletionRunner.mjs";
15
+ import { Stream } from 'openai/streaming';
16
+ export class ChatCompletionStream extends AbstractChatCompletionRunner {
17
+ constructor() {
18
+ super(...arguments);
19
+ _ChatCompletionStream_instances.add(this);
20
+ _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0);
21
+ }
22
+ get currentChatCompletionSnapshot() {
23
+ return __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
24
+ }
25
+ /**
26
+ * Intended for use on the frontend, consuming a stream produced with
27
+ * `.toReadableStream()` on the backend.
28
+ *
29
+ * Note that messages sent to the model do not appear in `.on('message')`
30
+ * in this context.
31
+ */
32
+ static fromReadableStream(stream) {
33
+ const runner = new ChatCompletionStream();
34
+ runner._run(() => runner._fromReadableStream(stream));
35
+ return runner;
36
+ }
37
+ static createChatCompletion(completions, params, options) {
38
+ const runner = new ChatCompletionStream();
39
+ runner._run(() => runner._runChatCompletion(completions, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));
40
+ return runner;
41
+ }
42
+ async _createChatCompletion(completions, params, options) {
43
+ const signal = options?.signal;
44
+ if (signal) {
45
+ if (signal.aborted)
46
+ this.controller.abort();
47
+ signal.addEventListener('abort', () => this.controller.abort());
48
+ }
49
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this);
50
+ const stream = await completions.create({ ...params, stream: true }, { ...options, signal: this.controller.signal });
51
+ this._connected();
52
+ for await (const chunk of stream) {
53
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk);
54
+ }
55
+ if (stream.controller.signal?.aborted) {
56
+ throw new APIUserAbortError();
57
+ }
58
+ return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
59
+ }
60
+ async _fromReadableStream(readableStream, options) {
61
+ const signal = options?.signal;
62
+ if (signal) {
63
+ if (signal.aborted)
64
+ this.controller.abort();
65
+ signal.addEventListener('abort', () => this.controller.abort());
66
+ }
67
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this);
68
+ this._connected();
69
+ const stream = Stream.fromReadableStream(readableStream, this.controller);
70
+ let chatId;
71
+ for await (const chunk of stream) {
72
+ if (chatId && chatId !== chunk.id) {
73
+ // A new request has been made.
74
+ this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
75
+ }
76
+ __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk);
77
+ chatId = chunk.id;
78
+ }
79
+ if (stream.controller.signal?.aborted) {
80
+ throw new APIUserAbortError();
81
+ }
82
+ return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
83
+ }
84
+ [(_ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap(), _ChatCompletionStream_instances = new WeakSet(), _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest() {
85
+ if (this.ended)
86
+ return;
87
+ __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
88
+ }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk(chunk) {
89
+ if (this.ended)
90
+ return;
91
+ const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
92
+ this._emit('chunk', chunk, completion);
93
+ const delta = chunk.choices[0]?.delta?.content;
94
+ const snapshot = completion.choices[0]?.message;
95
+ if (delta != null && snapshot?.role === 'assistant' && snapshot?.content) {
96
+ this._emit('content', delta, snapshot.content);
97
+ }
98
+ }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest() {
99
+ if (this.ended) {
100
+ throw new OpenAIError(`stream has ended, this shouldn't happen`);
101
+ }
102
+ const snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
103
+ if (!snapshot) {
104
+ throw new OpenAIError(`request ended without sending any chunks`);
105
+ }
106
+ __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
107
+ return finalizeChatCompletion(snapshot);
108
+ }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion(chunk) {
109
+ var _a, _b, _c;
110
+ let snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
111
+ const { choices, ...rest } = chunk;
112
+ if (!snapshot) {
113
+ snapshot = __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, {
114
+ ...rest,
115
+ choices: [],
116
+ }, "f");
117
+ }
118
+ else {
119
+ Object.assign(snapshot, rest);
120
+ }
121
+ for (const { delta, finish_reason, index, logprobs = null, ...other } of chunk.choices) {
122
+ let choice = snapshot.choices[index];
123
+ if (!choice) {
124
+ choice = snapshot.choices[index] = { finish_reason, index, message: {}, logprobs, ...other };
125
+ }
126
+ if (logprobs) {
127
+ if (!choice.logprobs) {
128
+ choice.logprobs = Object.assign({}, logprobs);
129
+ }
130
+ else {
131
+ const { content, ...rest } = logprobs;
132
+ Object.assign(choice.logprobs, rest);
133
+ if (content) {
134
+ (_a = choice.logprobs).content ?? (_a.content = []);
135
+ choice.logprobs.content.push(...content);
136
+ }
137
+ }
138
+ }
139
+ if (finish_reason)
140
+ choice.finish_reason = finish_reason;
141
+ Object.assign(choice, other);
142
+ if (!delta)
143
+ continue; // Shouldn't happen; just in case.
144
+ const { content, function_call, role, tool_calls, ...rest } = delta;
145
+ Object.assign(choice.message, rest);
146
+ if (content)
147
+ choice.message.content = (choice.message.content || '') + content;
148
+ if (role)
149
+ choice.message.role = role;
150
+ if (function_call) {
151
+ if (!choice.message.function_call) {
152
+ choice.message.function_call = function_call;
153
+ }
154
+ else {
155
+ if (function_call.name)
156
+ choice.message.function_call.name = function_call.name;
157
+ if (function_call.arguments) {
158
+ (_b = choice.message.function_call).arguments ?? (_b.arguments = '');
159
+ choice.message.function_call.arguments += function_call.arguments;
160
+ }
161
+ }
162
+ }
163
+ if (tool_calls) {
164
+ if (!choice.message.tool_calls)
165
+ choice.message.tool_calls = [];
166
+ for (const { index, id, type, function: fn, ...rest } of tool_calls) {
167
+ const tool_call = ((_c = choice.message.tool_calls)[index] ?? (_c[index] = {}));
168
+ Object.assign(tool_call, rest);
169
+ if (id)
170
+ tool_call.id = id;
171
+ if (type)
172
+ tool_call.type = type;
173
+ if (fn)
174
+ tool_call.function ?? (tool_call.function = { arguments: '' });
175
+ if (fn?.name)
176
+ tool_call.function.name = fn.name;
177
+ if (fn?.arguments)
178
+ tool_call.function.arguments += fn.arguments;
179
+ }
180
+ }
181
+ }
182
+ return snapshot;
183
+ }, Symbol.asyncIterator)]() {
184
+ const pushQueue = [];
185
+ const readQueue = [];
186
+ let done = false;
187
+ this.on('chunk', (chunk) => {
188
+ const reader = readQueue.shift();
189
+ if (reader) {
190
+ reader.resolve(chunk);
191
+ }
192
+ else {
193
+ pushQueue.push(chunk);
194
+ }
195
+ });
196
+ this.on('end', () => {
197
+ done = true;
198
+ for (const reader of readQueue) {
199
+ reader.resolve(undefined);
200
+ }
201
+ readQueue.length = 0;
202
+ });
203
+ this.on('abort', (err) => {
204
+ done = true;
205
+ for (const reader of readQueue) {
206
+ reader.reject(err);
207
+ }
208
+ readQueue.length = 0;
209
+ });
210
+ this.on('error', (err) => {
211
+ done = true;
212
+ for (const reader of readQueue) {
213
+ reader.reject(err);
214
+ }
215
+ readQueue.length = 0;
216
+ });
217
+ return {
218
+ next: async () => {
219
+ if (!pushQueue.length) {
220
+ if (done) {
221
+ return { value: undefined, done: true };
222
+ }
223
+ return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));
224
+ }
225
+ const chunk = pushQueue.shift();
226
+ return { value: chunk, done: false };
227
+ },
228
+ return: async () => {
229
+ this.abort();
230
+ return { value: undefined, done: true };
231
+ },
232
+ };
233
+ }
234
+ toReadableStream() {
235
+ const stream = new Stream(this[Symbol.asyncIterator].bind(this), this.controller);
236
+ return stream.toReadableStream();
237
+ }
238
+ }
239
+ function finalizeChatCompletion(snapshot) {
240
+ const { id, choices, created, model, system_fingerprint, ...rest } = snapshot;
241
+ return {
242
+ ...rest,
243
+ id,
244
+ choices: choices.map(({ message, finish_reason, index, logprobs, ...choiceRest }) => {
245
+ if (!finish_reason)
246
+ throw new OpenAIError(`missing finish_reason for choice ${index}`);
247
+ const { content = null, function_call, tool_calls, ...messageRest } = message;
248
+ const role = message.role; // this is what we expect; in theory it could be different which would make our types a slight lie but would be fine.
249
+ if (!role)
250
+ throw new OpenAIError(`missing role for choice ${index}`);
251
+ if (function_call) {
252
+ const { arguments: args, name } = function_call;
253
+ if (args == null)
254
+ throw new OpenAIError(`missing function_call.arguments for choice ${index}`);
255
+ if (!name)
256
+ throw new OpenAIError(`missing function_call.name for choice ${index}`);
257
+ return {
258
+ ...choiceRest,
259
+ message: { content, function_call: { arguments: args, name }, role },
260
+ finish_reason,
261
+ index,
262
+ logprobs,
263
+ };
264
+ }
265
+ if (tool_calls) {
266
+ return {
267
+ ...choiceRest,
268
+ index,
269
+ finish_reason,
270
+ logprobs,
271
+ message: {
272
+ ...messageRest,
273
+ role,
274
+ content,
275
+ tool_calls: tool_calls.map((tool_call, i) => {
276
+ const { function: fn, type, id, ...toolRest } = tool_call;
277
+ const { arguments: args, name, ...fnRest } = fn || {};
278
+ if (id == null)
279
+ throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].id\n${str(snapshot)}`);
280
+ if (type == null)
281
+ throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].type\n${str(snapshot)}`);
282
+ if (name == null)
283
+ throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].function.name\n${str(snapshot)}`);
284
+ if (args == null)
285
+ throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].function.arguments\n${str(snapshot)}`);
286
+ return { ...toolRest, id, type, function: { ...fnRest, name, arguments: args } };
287
+ }),
288
+ },
289
+ };
290
+ }
291
+ return {
292
+ ...choiceRest,
293
+ message: { ...messageRest, content, role },
294
+ finish_reason,
295
+ index,
296
+ logprobs,
297
+ };
298
+ }),
299
+ created,
300
+ model,
301
+ object: 'chat.completion',
302
+ ...(system_fingerprint ? { system_fingerprint } : {}),
303
+ };
304
+ }
305
+ function str(x) {
306
+ return JSON.stringify(x);
307
+ }
308
+ //# sourceMappingURL=ChatCompletionStream.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatCompletionStream.mjs","sourceRoot":"","sources":["../src/lib/ChatCompletionStream.ts"],"names":[],"mappings":";;;;;;;;;;;;OACO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MA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