ogx-client 0.7.2-rc1

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 (552) hide show
  1. package/CHANGELOG.md +512 -0
  2. package/LICENSE +7 -0
  3. package/README.md +391 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +21 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +17 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +26 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +7 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +26 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +7 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +26 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +7 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +26 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +7 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +107 -0
  36. package/_shims/auto/types.js +9 -0
  37. package/_shims/auto/types.mjs +10 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +19 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +15 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +89 -0
  45. package/_shims/index.js +23 -0
  46. package/_shims/index.mjs +18 -0
  47. package/_shims/manual-types.d.ts +18 -0
  48. package/_shims/manual-types.js +9 -0
  49. package/_shims/manual-types.mjs +10 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +94 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +61 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +48 -0
  57. package/_shims/node-types.js +9 -0
  58. package/_shims/node-types.mjs +10 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +46 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +42 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +83 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +76 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +89 -0
  72. package/_shims/web-types.js +9 -0
  73. package/_shims/web-types.mjs +10 -0
  74. package/core.d.ts +257 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +936 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +904 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +119 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +101 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +233 -0
  87. package/index.d.ts +233 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +254 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +210 -0
  92. package/index.mjs.map +1 -0
  93. package/internal/decoders/line.d.ts +21 -0
  94. package/internal/decoders/line.d.ts.map +1 -0
  95. package/internal/decoders/line.js +155 -0
  96. package/internal/decoders/line.js.map +1 -0
  97. package/internal/decoders/line.mjs +150 -0
  98. package/internal/decoders/line.mjs.map +1 -0
  99. package/internal/qs/formats.d.ts +6 -0
  100. package/internal/qs/formats.d.ts.map +1 -0
  101. package/internal/qs/formats.js +16 -0
  102. package/internal/qs/formats.js.map +1 -0
  103. package/internal/qs/formats.mjs +13 -0
  104. package/internal/qs/formats.mjs.map +1 -0
  105. package/internal/qs/index.d.ts +10 -0
  106. package/internal/qs/index.d.ts.map +1 -0
  107. package/internal/qs/index.js +19 -0
  108. package/internal/qs/index.js.map +1 -0
  109. package/internal/qs/index.mjs +15 -0
  110. package/internal/qs/index.mjs.map +1 -0
  111. package/internal/qs/stringify.d.ts +3 -0
  112. package/internal/qs/stringify.d.ts.map +1 -0
  113. package/internal/qs/stringify.js +285 -0
  114. package/internal/qs/stringify.js.map +1 -0
  115. package/internal/qs/stringify.mjs +281 -0
  116. package/internal/qs/stringify.mjs.map +1 -0
  117. package/internal/qs/types.d.ts +57 -0
  118. package/internal/qs/types.d.ts.map +1 -0
  119. package/internal/qs/types.js +8 -0
  120. package/internal/qs/types.js.map +1 -0
  121. package/internal/qs/types.mjs +7 -0
  122. package/internal/qs/types.mjs.map +1 -0
  123. package/internal/qs/utils.d.ts +14 -0
  124. package/internal/qs/utils.d.ts.map +1 -0
  125. package/internal/qs/utils.js +234 -0
  126. package/internal/qs/utils.js.map +1 -0
  127. package/internal/qs/utils.mjs +222 -0
  128. package/internal/qs/utils.mjs.map +1 -0
  129. package/internal/stream-utils.d.ts +8 -0
  130. package/internal/stream-utils.d.ts.map +1 -0
  131. package/internal/stream-utils.js +44 -0
  132. package/internal/stream-utils.js.map +1 -0
  133. package/internal/stream-utils.mjs +40 -0
  134. package/internal/stream-utils.mjs.map +1 -0
  135. package/internal/utils/query.d.ts +2 -0
  136. package/internal/utils/query.d.ts.map +1 -0
  137. package/internal/utils/query.js +39 -0
  138. package/internal/utils/query.js.map +1 -0
  139. package/internal/utils/query.mjs +12 -0
  140. package/internal/utils/query.mjs.map +1 -0
  141. package/lib/response-helpers.d.ts +23 -0
  142. package/lib/response-helpers.d.ts.map +1 -0
  143. package/lib/response-helpers.js +53 -0
  144. package/lib/response-helpers.js.map +1 -0
  145. package/lib/response-helpers.mjs +49 -0
  146. package/lib/response-helpers.mjs.map +1 -0
  147. package/ogx-client-0.7.2-rc1.tgz +0 -0
  148. package/package.json +108 -0
  149. package/pagination.d.ts +21 -0
  150. package/pagination.d.ts.map +1 -0
  151. package/pagination.js +53 -0
  152. package/pagination.js.map +1 -0
  153. package/pagination.mjs +47 -0
  154. package/pagination.mjs.map +1 -0
  155. package/resource.d.ts +6 -0
  156. package/resource.d.ts.map +1 -0
  157. package/resource.js +15 -0
  158. package/resource.js.map +1 -0
  159. package/resource.mjs +11 -0
  160. package/resource.mjs.map +1 -0
  161. package/resources/alpha/admin.d.ts +44 -0
  162. package/resources/alpha/admin.d.ts.map +1 -0
  163. package/resources/alpha/admin.js +49 -0
  164. package/resources/alpha/admin.js.map +1 -0
  165. package/resources/alpha/admin.mjs +45 -0
  166. package/resources/alpha/admin.mjs.map +1 -0
  167. package/resources/alpha/alpha.d.ts +14 -0
  168. package/resources/alpha/alpha.d.ts.map +1 -0
  169. package/resources/alpha/alpha.js +49 -0
  170. package/resources/alpha/alpha.js.map +1 -0
  171. package/resources/alpha/alpha.mjs +22 -0
  172. package/resources/alpha/alpha.mjs.map +1 -0
  173. package/resources/alpha/benchmarks.d.ts +104 -0
  174. package/resources/alpha/benchmarks.d.ts.map +1 -0
  175. package/resources/alpha/benchmarks.js +50 -0
  176. package/resources/alpha/benchmarks.js.map +1 -0
  177. package/resources/alpha/benchmarks.mjs +44 -0
  178. package/resources/alpha/benchmarks.mjs.map +1 -0
  179. package/resources/alpha/index.d.ts +4 -0
  180. package/resources/alpha/index.d.ts.map +1 -0
  181. package/resources/alpha/index.js +17 -0
  182. package/resources/alpha/index.js.map +1 -0
  183. package/resources/alpha/index.mjs +11 -0
  184. package/resources/alpha/index.mjs.map +1 -0
  185. package/resources/alpha/inference.d.ts +144 -0
  186. package/resources/alpha/inference.d.ts.map +1 -0
  187. package/resources/alpha/inference.js +29 -0
  188. package/resources/alpha/inference.js.map +1 -0
  189. package/resources/alpha/inference.mjs +25 -0
  190. package/resources/alpha/inference.mjs.map +1 -0
  191. package/resources/alpha.d.ts +2 -0
  192. package/resources/alpha.d.ts.map +1 -0
  193. package/resources/alpha.js +25 -0
  194. package/resources/alpha.js.map +1 -0
  195. package/resources/alpha.mjs +9 -0
  196. package/resources/alpha.mjs.map +1 -0
  197. package/resources/batches.d.ts +442 -0
  198. package/resources/batches.d.ts.map +1 -0
  199. package/resources/batches.js +53 -0
  200. package/resources/batches.js.map +1 -0
  201. package/resources/batches.mjs +48 -0
  202. package/resources/batches.mjs.map +1 -0
  203. package/resources/chat/chat.d.ts +276 -0
  204. package/resources/chat/chat.d.ts.map +1 -0
  205. package/resources/chat/chat.js +45 -0
  206. package/resources/chat/chat.js.map +1 -0
  207. package/resources/chat/chat.mjs +18 -0
  208. package/resources/chat/chat.mjs.map +1 -0
  209. package/resources/chat/completions.d.ts +2021 -0
  210. package/resources/chat/completions.d.ts.map +1 -0
  211. package/resources/chat/completions.js +39 -0
  212. package/resources/chat/completions.js.map +1 -0
  213. package/resources/chat/completions.mjs +35 -0
  214. package/resources/chat/completions.mjs.map +1 -0
  215. package/resources/chat/index.d.ts +3 -0
  216. package/resources/chat/index.d.ts.map +1 -0
  217. package/resources/chat/index.js +15 -0
  218. package/resources/chat/index.js.map +1 -0
  219. package/resources/chat/index.mjs +10 -0
  220. package/resources/chat/index.mjs.map +1 -0
  221. package/resources/chat.d.ts +2 -0
  222. package/resources/chat.d.ts.map +1 -0
  223. package/resources/chat.js +25 -0
  224. package/resources/chat.js.map +1 -0
  225. package/resources/chat.mjs +9 -0
  226. package/resources/chat.mjs.map +1 -0
  227. package/resources/completions.d.ts +273 -0
  228. package/resources/completions.d.ts.map +1 -0
  229. package/resources/completions.js +26 -0
  230. package/resources/completions.js.map +1 -0
  231. package/resources/completions.mjs +22 -0
  232. package/resources/completions.mjs.map +1 -0
  233. package/resources/conversations/conversations.d.ts +429 -0
  234. package/resources/conversations/conversations.d.ts.map +1 -0
  235. package/resources/conversations/conversations.js +73 -0
  236. package/resources/conversations/conversations.js.map +1 -0
  237. package/resources/conversations/conversations.mjs +46 -0
  238. package/resources/conversations/conversations.mjs.map +1 -0
  239. package/resources/conversations/index.d.ts +3 -0
  240. package/resources/conversations/index.d.ts.map +1 -0
  241. package/resources/conversations/index.js +16 -0
  242. package/resources/conversations/index.js.map +1 -0
  243. package/resources/conversations/index.mjs +10 -0
  244. package/resources/conversations/index.mjs.map +1 -0
  245. package/resources/conversations/items.d.ts +1408 -0
  246. package/resources/conversations/items.d.ts.map +1 -0
  247. package/resources/conversations/items.js +48 -0
  248. package/resources/conversations/items.js.map +1 -0
  249. package/resources/conversations/items.mjs +43 -0
  250. package/resources/conversations/items.mjs.map +1 -0
  251. package/resources/conversations.d.ts +2 -0
  252. package/resources/conversations.d.ts.map +1 -0
  253. package/resources/conversations.js +25 -0
  254. package/resources/conversations.js.map +1 -0
  255. package/resources/conversations.mjs +9 -0
  256. package/resources/conversations.mjs.map +1 -0
  257. package/resources/embeddings.d.ts +98 -0
  258. package/resources/embeddings.d.ts.map +1 -0
  259. package/resources/embeddings.js +30 -0
  260. package/resources/embeddings.js.map +1 -0
  261. package/resources/embeddings.mjs +26 -0
  262. package/resources/embeddings.mjs.map +1 -0
  263. package/resources/files.d.ts +159 -0
  264. package/resources/files.d.ts.map +1 -0
  265. package/resources/files.js +78 -0
  266. package/resources/files.js.map +1 -0
  267. package/resources/files.mjs +50 -0
  268. package/resources/files.mjs.map +1 -0
  269. package/resources/index.d.ts +20 -0
  270. package/resources/index.d.ts.map +1 -0
  271. package/resources/index.js +66 -0
  272. package/resources/index.js.map +1 -0
  273. package/resources/index.mjs +27 -0
  274. package/resources/index.mjs.map +1 -0
  275. package/resources/inspect.d.ts +17 -0
  276. package/resources/inspect.d.ts.map +1 -0
  277. package/resources/inspect.js +30 -0
  278. package/resources/inspect.js.map +1 -0
  279. package/resources/inspect.mjs +26 -0
  280. package/resources/inspect.mjs.map +1 -0
  281. package/resources/models/index.d.ts +3 -0
  282. package/resources/models/index.d.ts.map +1 -0
  283. package/resources/models/index.js +15 -0
  284. package/resources/models/index.js.map +1 -0
  285. package/resources/models/index.mjs +10 -0
  286. package/resources/models/index.mjs.map +1 -0
  287. package/resources/models/models.d.ts +97 -0
  288. package/resources/models/models.d.ts.map +1 -0
  289. package/resources/models/models.js +57 -0
  290. package/resources/models/models.js.map +1 -0
  291. package/resources/models/models.mjs +30 -0
  292. package/resources/models/models.mjs.map +1 -0
  293. package/resources/models/openai.d.ts +10 -0
  294. package/resources/models/openai.d.ts.map +1 -0
  295. package/resources/models/openai.js +21 -0
  296. package/resources/models/openai.js.map +1 -0
  297. package/resources/models/openai.mjs +17 -0
  298. package/resources/models/openai.mjs.map +1 -0
  299. package/resources/models.d.ts +2 -0
  300. package/resources/models.d.ts.map +1 -0
  301. package/resources/models.js +25 -0
  302. package/resources/models.js.map +1 -0
  303. package/resources/models.mjs +9 -0
  304. package/resources/models.mjs.map +1 -0
  305. package/resources/moderations.d.ts +83 -0
  306. package/resources/moderations.d.ts.map +1 -0
  307. package/resources/moderations.js +24 -0
  308. package/resources/moderations.js.map +1 -0
  309. package/resources/moderations.mjs +20 -0
  310. package/resources/moderations.mjs.map +1 -0
  311. package/resources/prompts/index.d.ts +3 -0
  312. package/resources/prompts/index.d.ts.map +1 -0
  313. package/resources/prompts/index.js +15 -0
  314. package/resources/prompts/index.js.map +1 -0
  315. package/resources/prompts/index.mjs +10 -0
  316. package/resources/prompts/index.mjs.map +1 -0
  317. package/resources/prompts/prompts.d.ts +113 -0
  318. package/resources/prompts/prompts.d.ts.map +1 -0
  319. package/resources/prompts/prompts.js +88 -0
  320. package/resources/prompts/prompts.js.map +1 -0
  321. package/resources/prompts/prompts.mjs +61 -0
  322. package/resources/prompts/prompts.mjs.map +1 -0
  323. package/resources/prompts/versions.d.ts +13 -0
  324. package/resources/prompts/versions.d.ts.map +1 -0
  325. package/resources/prompts/versions.js +24 -0
  326. package/resources/prompts/versions.js.map +1 -0
  327. package/resources/prompts/versions.mjs +20 -0
  328. package/resources/prompts/versions.mjs.map +1 -0
  329. package/resources/prompts.d.ts +2 -0
  330. package/resources/prompts.d.ts.map +1 -0
  331. package/resources/prompts.js +25 -0
  332. package/resources/prompts.js.map +1 -0
  333. package/resources/prompts.mjs +9 -0
  334. package/resources/prompts.mjs.map +1 -0
  335. package/resources/providers.d.ts +24 -0
  336. package/resources/providers.d.ts.map +1 -0
  337. package/resources/providers.js +30 -0
  338. package/resources/providers.js.map +1 -0
  339. package/resources/providers.mjs +26 -0
  340. package/resources/providers.mjs.map +1 -0
  341. package/resources/responses/index.d.ts +3 -0
  342. package/resources/responses/index.d.ts.map +1 -0
  343. package/resources/responses/index.js +16 -0
  344. package/resources/responses/index.js.map +1 -0
  345. package/resources/responses/index.mjs +10 -0
  346. package/resources/responses/index.mjs.map +1 -0
  347. package/resources/responses/input-items.d.ts +382 -0
  348. package/resources/responses/input-items.d.ts.map +1 -0
  349. package/resources/responses/input-items.js +25 -0
  350. package/resources/responses/input-items.js.map +1 -0
  351. package/resources/responses/input-items.mjs +21 -0
  352. package/resources/responses/input-items.mjs.map +1 -0
  353. package/resources/responses/responses.d.ts +4808 -0
  354. package/resources/responses/responses.d.ts.map +1 -0
  355. package/resources/responses/responses.js +85 -0
  356. package/resources/responses/responses.js.map +1 -0
  357. package/resources/responses/responses.mjs +57 -0
  358. package/resources/responses/responses.mjs.map +1 -0
  359. package/resources/responses.d.ts +2 -0
  360. package/resources/responses.d.ts.map +1 -0
  361. package/resources/responses.js +25 -0
  362. package/resources/responses.js.map +1 -0
  363. package/resources/responses.mjs +9 -0
  364. package/resources/responses.mjs.map +1 -0
  365. package/resources/routes.d.ts +30 -0
  366. package/resources/routes.d.ts.map +1 -0
  367. package/resources/routes.js +25 -0
  368. package/resources/routes.js.map +1 -0
  369. package/resources/routes.mjs +21 -0
  370. package/resources/routes.mjs.map +1 -0
  371. package/resources/safety.d.ts +297 -0
  372. package/resources/safety.d.ts.map +1 -0
  373. package/resources/safety.js +24 -0
  374. package/resources/safety.js.map +1 -0
  375. package/resources/safety.mjs +20 -0
  376. package/resources/safety.mjs.map +1 -0
  377. package/resources/shared.d.ts +447 -0
  378. package/resources/shared.d.ts.map +1 -0
  379. package/resources/shared.js +10 -0
  380. package/resources/shared.js.map +1 -0
  381. package/resources/shared.mjs +9 -0
  382. package/resources/shared.mjs.map +1 -0
  383. package/resources/shields.d.ts +82 -0
  384. package/resources/shields.d.ts.map +1 -0
  385. package/resources/shields.js +46 -0
  386. package/resources/shields.js.map +1 -0
  387. package/resources/shields.mjs +42 -0
  388. package/resources/shields.mjs.map +1 -0
  389. package/resources/vector-io.d.ts +375 -0
  390. package/resources/vector-io.d.ts.map +1 -0
  391. package/resources/vector-io.js +31 -0
  392. package/resources/vector-io.js.map +1 -0
  393. package/resources/vector-io.mjs +27 -0
  394. package/resources/vector-io.mjs.map +1 -0
  395. package/resources/vector-stores/file-batches.d.ts +268 -0
  396. package/resources/vector-stores/file-batches.d.ts.map +1 -0
  397. package/resources/vector-stores/file-batches.js +42 -0
  398. package/resources/vector-stores/file-batches.js.map +1 -0
  399. package/resources/vector-stores/file-batches.mjs +38 -0
  400. package/resources/vector-stores/file-batches.mjs.map +1 -0
  401. package/resources/vector-stores/files.d.ts +335 -0
  402. package/resources/vector-stores/files.d.ts.map +1 -0
  403. package/resources/vector-stores/files.js +60 -0
  404. package/resources/vector-stores/files.js.map +1 -0
  405. package/resources/vector-stores/files.mjs +55 -0
  406. package/resources/vector-stores/files.mjs.map +1 -0
  407. package/resources/vector-stores/index.d.ts +4 -0
  408. package/resources/vector-stores/index.d.ts.map +1 -0
  409. package/resources/vector-stores/index.js +19 -0
  410. package/resources/vector-stores/index.js.map +1 -0
  411. package/resources/vector-stores/index.mjs +11 -0
  412. package/resources/vector-stores/index.mjs.map +1 -0
  413. package/resources/vector-stores/vector-stores.d.ts +412 -0
  414. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  415. package/resources/vector-stores/vector-stores.js +92 -0
  416. package/resources/vector-stores/vector-stores.js.map +1 -0
  417. package/resources/vector-stores/vector-stores.mjs +64 -0
  418. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  419. package/resources/vector-stores.d.ts +2 -0
  420. package/resources/vector-stores.d.ts.map +1 -0
  421. package/resources/vector-stores.js +25 -0
  422. package/resources/vector-stores.js.map +1 -0
  423. package/resources/vector-stores.mjs +9 -0
  424. package/resources/vector-stores.mjs.map +1 -0
  425. package/resources.d.ts +2 -0
  426. package/resources.d.ts.map +1 -0
  427. package/resources.js +23 -0
  428. package/resources.js.map +1 -0
  429. package/resources.mjs +7 -0
  430. package/resources.mjs.map +1 -0
  431. package/shims/node.d.ts +30 -0
  432. package/shims/node.d.ts.map +1 -0
  433. package/shims/node.js +36 -0
  434. package/shims/node.js.map +1 -0
  435. package/shims/node.mjs +10 -0
  436. package/shims/node.mjs.map +1 -0
  437. package/shims/web.d.ts +26 -0
  438. package/shims/web.d.ts.map +1 -0
  439. package/shims/web.js +36 -0
  440. package/shims/web.js.map +1 -0
  441. package/shims/web.mjs +10 -0
  442. package/shims/web.mjs.map +1 -0
  443. package/src/_shims/MultipartBody.ts +15 -0
  444. package/src/_shims/README.md +46 -0
  445. package/src/_shims/auto/runtime-bun.ts +10 -0
  446. package/src/_shims/auto/runtime-node.ts +10 -0
  447. package/src/_shims/auto/runtime.ts +10 -0
  448. package/src/_shims/auto/types-node.ts +10 -0
  449. package/src/_shims/auto/types.d.ts +107 -0
  450. package/src/_shims/auto/types.js +9 -0
  451. package/src/_shims/auto/types.mjs +10 -0
  452. package/src/_shims/bun-runtime.ts +20 -0
  453. package/src/_shims/index.d.ts +89 -0
  454. package/src/_shims/index.js +23 -0
  455. package/src/_shims/index.mjs +18 -0
  456. package/src/_shims/manual-types.d.ts +18 -0
  457. package/src/_shims/manual-types.js +9 -0
  458. package/src/_shims/manual-types.mjs +10 -0
  459. package/src/_shims/node-runtime.ts +87 -0
  460. package/src/_shims/node-types.d.ts +48 -0
  461. package/src/_shims/node-types.js +9 -0
  462. package/src/_shims/node-types.mjs +10 -0
  463. package/src/_shims/registry.ts +73 -0
  464. package/src/_shims/web-runtime.ts +109 -0
  465. package/src/_shims/web-types.d.ts +89 -0
  466. package/src/_shims/web-types.js +9 -0
  467. package/src/_shims/web-types.mjs +10 -0
  468. package/src/core.ts +1253 -0
  469. package/src/error.ts +137 -0
  470. package/src/index.ts +554 -0
  471. package/src/internal/decoders/line.ts +182 -0
  472. package/src/internal/qs/LICENSE.md +13 -0
  473. package/src/internal/qs/README.md +3 -0
  474. package/src/internal/qs/formats.ts +15 -0
  475. package/src/internal/qs/index.ts +19 -0
  476. package/src/internal/qs/stringify.ts +394 -0
  477. package/src/internal/qs/types.ts +77 -0
  478. package/src/internal/qs/utils.ts +271 -0
  479. package/src/internal/stream-utils.ts +38 -0
  480. package/src/internal/utils/query.ts +13 -0
  481. package/src/lib/response-helpers.ts +60 -0
  482. package/src/pagination.ts +80 -0
  483. package/src/resource.ts +18 -0
  484. package/src/resources/alpha/admin.ts +87 -0
  485. package/src/resources/alpha/alpha.ts +31 -0
  486. package/src/resources/alpha/benchmarks.ts +152 -0
  487. package/src/resources/alpha/index.ts +11 -0
  488. package/src/resources/alpha/inference.ts +191 -0
  489. package/src/resources/alpha.ts +9 -0
  490. package/src/resources/batches.ts +692 -0
  491. package/src/resources/chat/chat.ts +351 -0
  492. package/src/resources/chat/completions.ts +2430 -0
  493. package/src/resources/chat/index.ts +19 -0
  494. package/src/resources/chat.ts +9 -0
  495. package/src/resources/completions.ts +350 -0
  496. package/src/resources/conversations/conversations.ts +627 -0
  497. package/src/resources/conversations/index.ts +25 -0
  498. package/src/resources/conversations/items.ts +2061 -0
  499. package/src/resources/conversations.ts +9 -0
  500. package/src/resources/embeddings.ts +130 -0
  501. package/src/resources/files.ts +225 -0
  502. package/src/resources/index.ts +104 -0
  503. package/src/resources/inspect.ts +30 -0
  504. package/src/resources/models/index.ts +10 -0
  505. package/src/resources/models/models.ts +133 -0
  506. package/src/resources/models/openai.ts +20 -0
  507. package/src/resources/models.ts +9 -0
  508. package/src/resources/moderations.ts +97 -0
  509. package/src/resources/prompts/index.ts +19 -0
  510. package/src/resources/prompts/prompts.ts +188 -0
  511. package/src/resources/prompts/versions.ts +27 -0
  512. package/src/resources/prompts.ts +9 -0
  513. package/src/resources/providers.ts +41 -0
  514. package/src/resources/responses/index.ts +26 -0
  515. package/src/resources/responses/input-items.ts +571 -0
  516. package/src/resources/responses/responses.ts +6718 -0
  517. package/src/resources/responses.ts +9 -0
  518. package/src/resources/routes.ts +55 -0
  519. package/src/resources/safety.ts +367 -0
  520. package/src/resources/shared.ts +544 -0
  521. package/src/resources/shields.ts +119 -0
  522. package/src/resources/vector-io.ts +485 -0
  523. package/src/resources/vector-stores/file-batches.ts +386 -0
  524. package/src/resources/vector-stores/files.ts +496 -0
  525. package/src/resources/vector-stores/index.ts +38 -0
  526. package/src/resources/vector-stores/vector-stores.ts +588 -0
  527. package/src/resources/vector-stores.ts +9 -0
  528. package/src/resources.ts +7 -0
  529. package/src/shims/node.ts +56 -0
  530. package/src/shims/web.ts +56 -0
  531. package/src/streaming.ts +315 -0
  532. package/src/tsconfig.json +11 -0
  533. package/src/uploads.ts +261 -0
  534. package/src/version.ts +7 -0
  535. package/streaming.d.ts +32 -0
  536. package/streaming.d.ts.map +1 -0
  537. package/streaming.js +272 -0
  538. package/streaming.js.map +1 -0
  539. package/streaming.mjs +267 -0
  540. package/streaming.mjs.map +1 -0
  541. package/uploads.d.ts +75 -0
  542. package/uploads.d.ts.map +1 -0
  543. package/uploads.js +176 -0
  544. package/uploads.js.map +1 -0
  545. package/uploads.mjs +163 -0
  546. package/uploads.mjs.map +1 -0
  547. package/version.d.ts +2 -0
  548. package/version.d.ts.map +1 -0
  549. package/version.js +10 -0
  550. package/version.js.map +1 -0
  551. package/version.mjs +7 -0
  552. package/version.mjs.map +1 -0
@@ -0,0 +1,40 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ /**
7
+ * Most browsers don't yet have async iterable support for ReadableStream,
8
+ * and Node has a very different way of reading bytes from its "ReadableStream".
9
+ *
10
+ * This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
11
+ */
12
+ export function ReadableStreamToAsyncIterable(stream) {
13
+ if (stream[Symbol.asyncIterator])
14
+ return stream;
15
+ const reader = stream.getReader();
16
+ return {
17
+ async next() {
18
+ try {
19
+ const result = await reader.read();
20
+ if (result?.done)
21
+ reader.releaseLock(); // release lock when stream becomes closed
22
+ return result;
23
+ }
24
+ catch (e) {
25
+ reader.releaseLock(); // release lock when stream becomes errored
26
+ throw e;
27
+ }
28
+ },
29
+ async return() {
30
+ const cancelPromise = reader.cancel();
31
+ reader.releaseLock();
32
+ await cancelPromise;
33
+ return { done: true, value: undefined };
34
+ },
35
+ [Symbol.asyncIterator]() {
36
+ return this;
37
+ },
38
+ };
39
+ }
40
+ //# sourceMappingURL=stream-utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-utils.mjs","sourceRoot":"","sources":["../src/internal/stream-utils.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAI,MAAW;IAC1D,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;QAAE,OAAO,MAAM,CAAC;IAEhD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,OAAO;QACL,KAAK,CAAC,IAAI;YACR,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;gBACnC,IAAI,MAAM,EAAE,IAAI;oBAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,0CAA0C;gBAClF,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,2CAA2C;gBACjE,MAAM,CAAC,CAAC;aACT;QACH,CAAC;QACD,KAAK,CAAC,MAAM;YACV,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,aAAa,CAAC;YACpB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAC1C,CAAC;QACD,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function stringifyQuery(query: object | Record<string, unknown>): string;
2
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAErE"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // Copyright (c) The OGX Contributors.
3
+ // All rights reserved.
4
+ //
5
+ // This source code is licensed under the terms described in the LICENSE file in
6
+ // the root directory of this source tree.
7
+ //
8
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || function (mod) {
26
+ if (mod && mod.__esModule) return mod;
27
+ var result = {};
28
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
+ __setModuleDefault(result, mod);
30
+ return result;
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.stringifyQuery = void 0;
34
+ const qs = __importStar(require("../qs/stringify.js"));
35
+ function stringifyQuery(query) {
36
+ return qs.stringify(query, { arrayFormat: 'comma' });
37
+ }
38
+ exports.stringifyQuery = stringifyQuery;
39
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,uDAAsC;AAEtC,SAAgB,cAAc,CAAC,KAAuC;IACpE,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AACvD,CAAC;AAFD,wCAEC"}
@@ -0,0 +1,12 @@
1
+ // Copyright (c) The OGX Contributors.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ //
7
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
+ import * as qs from "../qs/stringify.mjs";
9
+ export function stringifyQuery(query) {
10
+ return qs.stringify(query, { arrayFormat: 'comma' });
11
+ }
12
+ //# sourceMappingURL=query.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.mjs","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;OAE/E,KAAK,EAAE;AAEd,MAAM,UAAU,cAAc,CAAC,KAAuC;IACpE,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Helper utilities for working with response objects.
3
+ */
4
+ import type { ResponseObject } from "../resources/responses/responses.js";
5
+ /**
6
+ * Extracts aggregated text output from a ResponseObject.
7
+ * This concatenates all `output_text` entries from the response's output array.
8
+ *
9
+ * Useful for streaming responses where you want to get the final text from chunk.response:
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const stream = await client.responses.create({ stream: true, ... });
14
+ * for await (const chunk of stream) {
15
+ * if (chunk.type === 'response.completed') {
16
+ * const text = getResponseOutputText(chunk.response);
17
+ * console.log(text);
18
+ * }
19
+ * }
20
+ * ```
21
+ */
22
+ export declare function getResponseOutputText(response: ResponseObject): string;
23
+ //# sourceMappingURL=response-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-helpers.d.ts","sourceRoot":"","sources":["../src/lib/response-helpers.ts"],"names":[],"mappings":"AAMA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CA8BtE"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ // All rights reserved.
4
+ //
5
+ // This source code is licensed under the terms described in the LICENSE file in
6
+ // the root directory of this source tree.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.getResponseOutputText = void 0;
9
+ /**
10
+ * Extracts aggregated text output from a ResponseObject.
11
+ * This concatenates all `output_text` entries from the response's output array.
12
+ *
13
+ * Useful for streaming responses where you want to get the final text from chunk.response:
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const stream = await client.responses.create({ stream: true, ... });
18
+ * for await (const chunk of stream) {
19
+ * if (chunk.type === 'response.completed') {
20
+ * const text = getResponseOutputText(chunk.response);
21
+ * console.log(text);
22
+ * }
23
+ * }
24
+ * ```
25
+ */
26
+ function getResponseOutputText(response) {
27
+ const pieces = [];
28
+ for (const output of response.output ?? []) {
29
+ if (!output || output.type !== 'message') {
30
+ continue;
31
+ }
32
+ const content = output.content;
33
+ if (typeof content === 'string') {
34
+ pieces.push(content);
35
+ continue;
36
+ }
37
+ if (!Array.isArray(content)) {
38
+ continue;
39
+ }
40
+ for (const item of content) {
41
+ if (typeof item === 'string') {
42
+ pieces.push(item);
43
+ continue;
44
+ }
45
+ if (item && item.type === 'output_text' && 'text' in item && typeof item.text === 'string') {
46
+ pieces.push(item.text);
47
+ }
48
+ }
49
+ }
50
+ return pieces.join('');
51
+ }
52
+ exports.getResponseOutputText = getResponseOutputText;
53
+ //# sourceMappingURL=response-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-helpers.js","sourceRoot":"","sources":["../src/lib/response-helpers.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;;;AAQ1C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,qBAAqB,CAAC,QAAwB;IAC5D,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,EAAE;QAC1C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;YACxC,SAAS;SACV;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,SAAS;SACV;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B,SAAS;SACV;QAED,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,SAAS;aACV;YACD,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC1F,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;SACF;KACF;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AA9BD,sDA8BC"}
@@ -0,0 +1,49 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ /**
7
+ * Extracts aggregated text output from a ResponseObject.
8
+ * This concatenates all `output_text` entries from the response's output array.
9
+ *
10
+ * Useful for streaming responses where you want to get the final text from chunk.response:
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const stream = await client.responses.create({ stream: true, ... });
15
+ * for await (const chunk of stream) {
16
+ * if (chunk.type === 'response.completed') {
17
+ * const text = getResponseOutputText(chunk.response);
18
+ * console.log(text);
19
+ * }
20
+ * }
21
+ * ```
22
+ */
23
+ export function getResponseOutputText(response) {
24
+ const pieces = [];
25
+ for (const output of response.output ?? []) {
26
+ if (!output || output.type !== 'message') {
27
+ continue;
28
+ }
29
+ const content = output.content;
30
+ if (typeof content === 'string') {
31
+ pieces.push(content);
32
+ continue;
33
+ }
34
+ if (!Array.isArray(content)) {
35
+ continue;
36
+ }
37
+ for (const item of content) {
38
+ if (typeof item === 'string') {
39
+ pieces.push(item);
40
+ continue;
41
+ }
42
+ if (item && item.type === 'output_text' && 'text' in item && typeof item.text === 'string') {
43
+ pieces.push(item.text);
44
+ }
45
+ }
46
+ }
47
+ return pieces.join('');
48
+ }
49
+ //# sourceMappingURL=response-helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-helpers.mjs","sourceRoot":"","sources":["../src/lib/response-helpers.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAQ1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAwB;IAC5D,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,EAAE;QAC1C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;YACxC,SAAS;SACV;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,SAAS;SACV;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B,SAAS;SACV;QAED,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,SAAS;aACV;YACD,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC1F,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;SACF;KACF;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC"}
Binary file
package/package.json ADDED
@@ -0,0 +1,108 @@
1
+ {
2
+ "name": "ogx-client",
3
+ "version": "0.7.2-rc1",
4
+ "description": "The official TypeScript library for the Ogx Client API",
5
+ "author": "Ogx Client <contributors@ogx.dev>",
6
+ "types": "./index.d.ts",
7
+ "main": "./index.js",
8
+ "type": "commonjs",
9
+ "repository": "github:ogx-ai/ogx-client-typescript",
10
+ "license": "MIT",
11
+ "packageManager": "yarn@1.22.22",
12
+ "files": [
13
+ "**/*"
14
+ ],
15
+ "private": false,
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "scripts": {
20
+ "test": "./scripts/test",
21
+ "build": "./scripts/build",
22
+ "format": "prettier --write --cache --cache-strategy metadata . !dist",
23
+ "tsn": "ts-node -r tsconfig-paths/register",
24
+ "lint": "./scripts/lint",
25
+ "fix": "./scripts/format"
26
+ },
27
+ "dependencies": {
28
+ "@types/node": "^18.11.18",
29
+ "@types/node-fetch": "^2.6.4",
30
+ "abort-controller": "^3.0.0",
31
+ "agentkeepalive": "^4.2.1",
32
+ "form-data-encoder": "1.7.2",
33
+ "formdata-node": "^4.3.2",
34
+ "node-fetch": "^2.6.7"
35
+ },
36
+ "resolutions": {
37
+ "@babel/core": "^7.28.5",
38
+ "@babel/helpers": "^7.28.4",
39
+ "js-yaml": "^4.1.1",
40
+ "brace-expansion": "^2.0.1"
41
+ },
42
+ "sideEffects": [
43
+ "./_shims/index.js",
44
+ "./_shims/index.mjs",
45
+ "./shims/node.js",
46
+ "./shims/node.mjs",
47
+ "./shims/web.js",
48
+ "./shims/web.mjs"
49
+ ],
50
+ "exports": {
51
+ "./_shims/auto/*": {
52
+ "deno": {
53
+ "types": "./_shims/auto/*.d.ts",
54
+ "require": "./_shims/auto/*.js",
55
+ "default": "./_shims/auto/*.mjs"
56
+ },
57
+ "bun": {
58
+ "types": "./_shims/auto/*.d.ts",
59
+ "require": "./_shims/auto/*-bun.js",
60
+ "default": "./_shims/auto/*-bun.mjs"
61
+ },
62
+ "browser": {
63
+ "types": "./_shims/auto/*.d.ts",
64
+ "require": "./_shims/auto/*.js",
65
+ "default": "./_shims/auto/*.mjs"
66
+ },
67
+ "worker": {
68
+ "types": "./_shims/auto/*.d.ts",
69
+ "require": "./_shims/auto/*.js",
70
+ "default": "./_shims/auto/*.mjs"
71
+ },
72
+ "workerd": {
73
+ "types": "./_shims/auto/*.d.ts",
74
+ "require": "./_shims/auto/*.js",
75
+ "default": "./_shims/auto/*.mjs"
76
+ },
77
+ "node": {
78
+ "types": "./_shims/auto/*-node.d.ts",
79
+ "require": "./_shims/auto/*-node.js",
80
+ "default": "./_shims/auto/*-node.mjs"
81
+ },
82
+ "types": "./_shims/auto/*.d.ts",
83
+ "require": "./_shims/auto/*.js",
84
+ "default": "./_shims/auto/*.mjs"
85
+ },
86
+ ".": {
87
+ "require": {
88
+ "types": "./index.d.ts",
89
+ "default": "./index.js"
90
+ },
91
+ "types": "./index.d.mts",
92
+ "default": "./index.mjs"
93
+ },
94
+ "./*.mjs": {
95
+ "types": "./*.d.ts",
96
+ "default": "./*.mjs"
97
+ },
98
+ "./*.js": {
99
+ "types": "./*.d.ts",
100
+ "default": "./*.js"
101
+ },
102
+ "./*": {
103
+ "types": "./*.d.ts",
104
+ "require": "./*.js",
105
+ "default": "./*.mjs"
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,21 @@
1
+ import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from "./core.js";
2
+ export interface OpenAICursorPageResponse<Item> {
3
+ data: Array<Item>;
4
+ has_more: boolean;
5
+ last_id: string;
6
+ }
7
+ export interface OpenAICursorPageParams {
8
+ limit?: number;
9
+ after?: string;
10
+ }
11
+ export declare class OpenAICursorPage<Item> extends AbstractPage<Item> implements OpenAICursorPageResponse<Item> {
12
+ data: Array<Item>;
13
+ has_more: boolean;
14
+ last_id: string;
15
+ constructor(client: APIClient, response: Response, body: OpenAICursorPageResponse<Item>, options: FinalRequestOptions);
16
+ getPaginatedItems(): Item[];
17
+ hasNextPage(): boolean;
18
+ nextPageParams(): Partial<OpenAICursorPageParams> | null;
19
+ nextPageInfo(): PageInfo | null;
20
+ }
21
+ //# sourceMappingURL=pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE1F,MAAM,WAAW,wBAAwB,CAAC,IAAI;IAC5C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAElB,QAAQ,EAAE,OAAO,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,gBAAgB,CAAC,IAAI,CAAE,SAAQ,YAAY,CAAC,IAAI,CAAE,YAAW,wBAAwB,CAAC,IAAI,CAAC;IACtG,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAElB,QAAQ,EAAE,OAAO,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;gBAGd,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC,EACpC,OAAO,EAAE,mBAAmB;IAS9B,iBAAiB,IAAI,IAAI,EAAE;IAIlB,WAAW,IAAI,OAAO;IAS/B,cAAc,IAAI,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;IASxD,YAAY,IAAI,QAAQ,GAAG,IAAI;CAYhC"}
package/pagination.js ADDED
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // Copyright (c) The OGX Contributors.
3
+ // All rights reserved.
4
+ //
5
+ // This source code is licensed under the terms described in the LICENSE file in
6
+ // the root directory of this source tree.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OpenAICursorPage = void 0;
9
+ //
10
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
11
+ const core_1 = require("./core.js");
12
+ class OpenAICursorPage extends core_1.AbstractPage {
13
+ constructor(client, response, body, options) {
14
+ super(client, response, body, options);
15
+ this.data = body.data || [];
16
+ this.has_more = body.has_more || false;
17
+ this.last_id = body.last_id || '';
18
+ }
19
+ getPaginatedItems() {
20
+ return this.data ?? [];
21
+ }
22
+ hasNextPage() {
23
+ if (this.has_more === false) {
24
+ return false;
25
+ }
26
+ return super.hasNextPage();
27
+ }
28
+ // @deprecated Please use `nextPageInfo()` instead
29
+ nextPageParams() {
30
+ const info = this.nextPageInfo();
31
+ if (!info)
32
+ return null;
33
+ if ('params' in info)
34
+ return info.params;
35
+ const params = Object.fromEntries(info.url.searchParams);
36
+ if (!Object.keys(params).length)
37
+ return null;
38
+ return params;
39
+ }
40
+ nextPageInfo() {
41
+ const cursor = this.last_id;
42
+ if (!cursor) {
43
+ return null;
44
+ }
45
+ return {
46
+ params: {
47
+ after: cursor,
48
+ },
49
+ };
50
+ }
51
+ }
52
+ exports.OpenAICursorPage = OpenA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CAAC;IAChB,CAAC;IAED,YAAY;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC;SACb;QAED,OAAO;YACL,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM;aACd;SACF,CAAC;IACJ,CAAC;CACF;AAtDD,4CAsDC"}
package/pagination.mjs ADDED
@@ -0,0 +1,47 @@
1
+ // Copyright (c) The OGX Contributors.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ import { AbstractPage } from "./core.mjs";
7
+ export class OpenAICursorPage extends AbstractPage {
8
+ constructor(client, response, body, options) {
9
+ super(client, response, body, options);
10
+ this.data = body.data || [];
11
+ this.has_more = body.has_more || false;
12
+ this.last_id = body.last_id || '';
13
+ }
14
+ getPaginatedItems() {
15
+ return this.data ?? [];
16
+ }
17
+ hasNextPage() {
18
+ if (this.has_more === false) {
19
+ return false;
20
+ }
21
+ return super.hasNextPage();
22
+ }
23
+ // @deprecated Please use `nextPageInfo()` instead
24
+ nextPageParams() {
25
+ const info = this.nextPageInfo();
26
+ if (!info)
27
+ return null;
28
+ if ('params' in info)
29
+ return info.params;
30
+ const params = Object.fromEntries(info.url.searchParams);
31
+ if (!Object.keys(params).length)
32
+ return null;
33
+ return params;
34
+ }
35
+ nextPageInfo() {
36
+ const cursor = this.last_id;
37
+ if (!cursor) {
38
+ return null;
39
+ }
40
+ return {
41
+ params: {
42
+ after: cursor,
43
+ },
44
+ };
45
+ }
46
+ }
47
+ //# sourceMappingURL=pagination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;OAKnC,EAAE,YAAY,EAAsD;AAgB3E,MAAM,OAAO,gBAAuB,SAAQ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 import type { OgxClient } from "./index.js";
2
+ export declare abstract class APIResource {
3
+ protected _client: OgxClient;
4
+ constructor(client: OgxClient);
5
+ }
6
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,8BAAsB,WAAW;IAC/B,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC;gBAEjB,MAAM,EAAE,SAAS;CAG9B"}
package/resource.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // Copyright (c) The OGX Contributors.
3
+ // All rights reserved.
4
+ //
5
+ // This source code is licensed under the terms described in the LICENSE file in
6
+ // the root directory of this source tree.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.APIResource = void 0;
9
+ class APIResource {
10
+ constructor(client) {
11
+ this._client = client;
12
+ }
13
+ }
14
+ exports.APIResource = APIResource;
15
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;;;AAO1C,MAAsB,WAAW;IAG/B,YAAY,MAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
package/resource.mjs ADDED
@@ -0,0 +1,11 @@
1
+ // Copyright (c) The OGX Contributors.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ export class APIResource {
7
+ constructor(client) {
8
+ this._client = client;
9
+ }
10
+ }
11
+ //# sourceMappingURL=resource.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAO1C,MAAM,OAAgB,WAAW;IAG/B,YAAY,MAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,44 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
+ import * as ProvidersAPI from "../providers.js";
4
+ import * as RoutesAPI from "../routes.js";
5
+ import * as Shared from "../shared.js";
6
+ /**
7
+ * Administrative APIs for inspecting providers, routes, health, and version.
8
+ */
9
+ export declare class Admin extends APIResource {
10
+ /**
11
+ * Get the current health status of the service.
12
+ */
13
+ health(options?: Core.RequestOptions): Core.APIPromise<Shared.HealthInfo>;
14
+ /**
15
+ * Get detailed information about a specific provider.
16
+ */
17
+ inspectProvider(providerId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.ProviderInfo>;
18
+ /**
19
+ * List all available providers with their configuration and health status.
20
+ */
21
+ listProviders(options?: Core.RequestOptions): Core.APIPromise<ProvidersAPI.ProviderListResponse>;
22
+ /**
23
+ * List all available API routes with their methods and implementing providers.
24
+ */
25
+ listRoutes(query?: AdminListRoutesParams, options?: Core.RequestOptions): Core.APIPromise<RoutesAPI.RouteListResponse>;
26
+ listRoutes(options?: Core.RequestOptions): Core.APIPromise<RoutesAPI.RouteListResponse>;
27
+ /**
28
+ * Get the version of the service.
29
+ */
30
+ version(options?: Core.RequestOptions): Core.APIPromise<Shared.VersionInfo>;
31
+ }
32
+ export interface AdminListRoutesParams {
33
+ /**
34
+ * Filter to control which routes are returned. Can be an API level ('v1',
35
+ * 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or
36
+ * 'deprecated' to show deprecated routes across all levels. If not specified,
37
+ * returns all non-deprecated routes.
38
+ */
39
+ api_filter?: 'v1' | 'v1alpha' | 'v1beta' | 'deprecated' | null;
40
+ }
41
+ export declare namespace Admin {
42
+ export { type AdminListRoutesParams as AdminListR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KG;IACH,UAAU,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAChE"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // Copyright (c) The OGX Contributors.
3
+ // All rights reserved.
4
+ //
5
+ // This source code is licensed under the terms described in the LICENSE file in
6
+ // the root directory of this source tree.
7
+ //
8
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Admin = void 0;
11
+ const resource_1 = require("../../resource.js");
12
+ const core_1 = require("../../core.js");
13
+ /**
14
+ * Administrative APIs for inspecting providers, routes, health, and version.
15
+ */
16
+ class Admin extends resource_1.APIResource {
17
+ /**
18
+ * Get the current health status of the service.
19
+ */
20
+ health(options) {
21
+ return this._client.get('/v1alpha/admin/health', options);
22
+ }
23
+ /**
24
+ * Get detailed information about a specific provider.
25
+ */
26
+ inspectProvider(providerId, options) {
27
+ return this._client.get(`/v1alpha/admin/providers/${providerId}`, options);
28
+ }
29
+ /**
30
+ * List all available providers with their configuration and health status.
31
+ */
32
+ listProviders(options) {
33
+ return this._client.get('/v1alpha/admin/providers', options)._thenUnwrap((obj) => obj.data);
34
+ }
35
+ listRoutes(query = {}, options) {
36
+ if ((0, core_1.isRequestOptions)(query)) {
37
+ return this.listRoutes({}, query);
38
+ }
39
+ return this._client.get('/v1alpha/admin/inspect/routes', { query, ...options })._thenUnwrap((obj) => obj.data);
40
+ }
41
+ /**
42
+ * Get the version of the service.
43
+ */
44
+ version(options) {
45
+ return this._client.get('/v1alpha/admin/version', options);
46
+ }
47
+ }
48
+ exports.Admin = Admin;
49
+ //# sourceMappingURL=admin.js.map