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
package/index.d.ts ADDED
@@ -0,0 +1,233 @@
1
+ import { type Agent } from "./_shims/index.js";
2
+ import * as Core from "./core.js";
3
+ import * as Errors from "./error.js";
4
+ import * as Pagination from "./pagination.js";
5
+ import { type OpenAICursorPageParams, OpenAICursorPageResponse } from "./pagination.js";
6
+ import * as Uploads from "./uploads.js";
7
+ import * as API from "./resources/index.js";
8
+ import { BatchCancelResponse, BatchCreateParams, BatchCreateResponse, BatchListParams, BatchListResponse, BatchListResponsesOpenAICursorPage, BatchRetrieveResponse, Batches } from "./resources/batches.js";
9
+ import { CompletionCreateParams, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, CompletionCreateResponse, Completions } from "./resources/completions.js";
10
+ import { CreateEmbeddingsResponse, EmbeddingCreateParams, Embeddings } from "./resources/embeddings.js";
11
+ import { DeleteFileResponse, File, FileContentResponse, FileCreateParams, FileListParams, Files, FilesOpenAICursorPage, ListFilesResponse } from "./resources/files.js";
12
+ import { Inspect } from "./resources/inspect.js";
13
+ import { CreateResponse, ModerationCreateParams, Moderations } from "./resources/moderations.js";
14
+ import { ProviderListResponse, Providers } from "./resources/providers.js";
15
+ import { RouteListParams, RouteListResponse, Routes } from "./resources/routes.js";
16
+ import { RunShieldResponse, Safety, SafetyRunShieldParams } from "./resources/safety.js";
17
+ import { ListShieldsResponse, Shield, ShieldListResponse, ShieldRegisterParams, Shields } from "./resources/shields.js";
18
+ import { QueryChunksResponse, VectorIo, VectorIoInsertParams, VectorIoQueryParams } from "./resources/vector-io.js";
19
+ import { Alpha } from "./resources/alpha/alpha.js";
20
+ import { Chat, ChatCompletionChunk } from "./resources/chat/chat.js";
21
+ import { ConversationCreateParams, ConversationDeleteResponse, ConversationObject, ConversationUpdateParams, Conversations } from "./resources/conversations/conversations.js";
22
+ import { ListModelsResponse, Model, ModelRetrieveResponse, Models } from "./resources/models/models.js";
23
+ import { ListPromptsResponse, Prompt, PromptCreateParams, PromptListResponse, PromptRetrieveParams, PromptSetDefaultVersionParams, PromptUpdateParams, Prompts } from "./resources/prompts/prompts.js";
24
+ import { CompactedResponse, ResponseCompactParams, ResponseCreateParams, ResponseCreateParamsNonStreaming, ResponseCreateParamsStreaming, ResponseDeleteResponse, ResponseInput, ResponseListParams, ResponseListResponse, ResponseListResponsesOpenAICursorPage, ResponseMessage, ResponseObject, ResponseObjectStream, ResponseOutput, Responses } from "./resources/responses/responses.js";
25
+ import { ListVectorStoresResponse, VectorStore, VectorStoreCreateParams, VectorStoreDeleteResponse, VectorStoreListParams, VectorStoreSearchParams, VectorStoreSearchResponse, VectorStoreUpdateParams, VectorStores, VectorStoresOpenAICursorPage } from "./resources/vector-stores/vector-stores.js";
26
+ export interface ClientOptions {
27
+ /**
28
+ * Defaults to process.env['OGX_CLIENT_API_KEY'].
29
+ */
30
+ apiKey?: string | null | undefined;
31
+ /**
32
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
33
+ *
34
+ * Defaults to process.env['OGX_CLIENT_BASE_URL'].
35
+ */
36
+ baseURL?: string | null | undefined;
37
+ /**
38
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
39
+ * from the server before timing out a single request.
40
+ *
41
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
42
+ * much longer than this timeout before the promise succeeds or fails.
43
+ *
44
+ * @unit milliseconds
45
+ */
46
+ timeout?: number | undefined;
47
+ /**
48
+ * An HTTP agent used to manage HTTP(S) connections.
49
+ *
50
+ * If not provided, an agent will be constructed by default in the Node.js environment,
51
+ * otherwise no agent is used.
52
+ */
53
+ httpAgent?: Agent | undefined;
54
+ /**
55
+ * Specify a custom `fetch` function implementation.
56
+ *
57
+ * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
58
+ * defined globally.
59
+ */
60
+ fetch?: Core.Fetch | undefined;
61
+ /**
62
+ * The maximum number of times that the client will retry a request in case of a
63
+ * temporary failure, like a network error or a 5XX error from the server.
64
+ *
65
+ * @default 2
66
+ */
67
+ maxRetries?: number | undefined;
68
+ /**
69
+ * Default headers to include with every request to the API.
70
+ *
71
+ * These can be removed in individual requests by explicitly setting the
72
+ * header to `undefined` or `null` in request options.
73
+ */
74
+ defaultHeaders?: Core.Headers | undefined;
75
+ /**
76
+ * Default query parameters to include with every request to the API.
77
+ *
78
+ * These can be removed in individual requests by explicitly setting the
79
+ * param to `undefined` in request options.
80
+ */
81
+ defaultQuery?: Core.DefaultQuery | undefined;
82
+ }
83
+ /**
84
+ * API Client for interfacing with the Ogx Client API.
85
+ */
86
+ export declare class OgxClient extends Core.APIClient {
87
+ #private;
88
+ apiKey: string | null;
89
+ private _options;
90
+ /**
91
+ * API Client for interfacing with the Ogx Client API.
92
+ *
93
+ * @param {string | null | undefined} [opts.apiKey=process.env['OGX_CLIENT_API_KEY'] ?? null]
94
+ * @param {string} [opts.baseURL=process.env['OGX_CLIENT_BASE_URL'] ?? http://any-hosted-ogx.com] - Override the default base URL for the API.
95
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
96
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
97
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
98
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
99
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
100
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
101
+ */
102
+ constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
103
+ /**
104
+ * OpenAI Responses API for agent orchestration with tool use, multi-turn conversations, and background processing.
105
+ */
106
+ responses: API.Responses;
107
+ /**
108
+ * Protocol for prompt management operations.
109
+ */
110
+ prompts: API.Prompts;
111
+ /**
112
+ * Protocol for conversation management operations.
113
+ */
114
+ conversations: API.Conversations;
115
+ /**
116
+ * APIs for inspecting the OGX service, including health status, available API routes with methods and implementing providers.
117
+ */
118
+ inspect: API.Inspect;
119
+ /**
120
+ * OGX Inference API for generating completions, chat completions, and embeddings.
121
+ *
122
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
123
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
124
+ * - Embedding models: these models generate embeddings to be used for semantic search.
125
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
126
+ */
127
+ embeddings: API.Embeddings;
128
+ chat: API.Chat;
129
+ /**
130
+ * OGX Inference API for generating completions, chat completions, and embeddings.
131
+ *
132
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
133
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
134
+ * - Embedding models: these models generate embeddings to be used for semantic search.
135
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
136
+ */
137
+ completions: API.Completions;
138
+ vectorIo: API.VectorIo;
139
+ vectorStores: API.VectorStores;
140
+ models: API.Models;
141
+ /**
142
+ * Providers API for inspecting, listing, and modifying providers and their configurations.
143
+ */
144
+ providers: API.Providers;
145
+ /**
146
+ * APIs for inspecting the OGX service, including health status, available API routes with methods and implementing providers.
147
+ */
148
+ routes: API.Routes;
149
+ /**
150
+ * OpenAI-compatible Moderations API.
151
+ */
152
+ moderations: API.Moderations;
153
+ /**
154
+ * OpenAI-compatible Moderations API.
155
+ */
156
+ safety: API.Safety;
157
+ shields: API.Shields;
158
+ /**
159
+ * This API is used to upload documents that can be used with other OGX APIs.
160
+ */
161
+ files: API.Files;
162
+ /**
163
+ * The API is designed to allow use of openai client libraries for seamless integration.
164
+ *
165
+ * This API provides the following extensions:
166
+ * - idempotent batch creation
167
+ *
168
+ * Note: This API is currently under active development and may undergo changes.
169
+ */
170
+ batches: API.Batches;
171
+ alpha: API.Alpha;
172
+ protected defaultQuery(): Core.DefaultQuery | undefined;
173
+ protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
174
+ protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
175
+ protected stringifyQuery(query: object | Record<string, unknown>): string;
176
+ static OgxClient: typeof OgxClient;
177
+ static DEFAULT_TIMEOUT: number;
178
+ static OgxClientError: typeof Errors.OgxClientError;
179
+ static APIError: typeof Errors.APIError;
180
+ static APIConnectionError: typeof Errors.APIConnectionError;
181
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
182
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
183
+ static NotFoundError: typeof Errors.NotFoundError;
184
+ static ConflictError: typeof Errors.ConflictError;
185
+ static RateLimitError: typeof Errors.RateLimitError;
186
+ static BadRequestError: typeof Errors.BadRequestError;
187
+ static AuthenticationError: typeof Errors.AuthenticationError;
188
+ static InternalServerError: typeof Errors.InternalServerError;
189
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
190
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
191
+ static toFile: typeof Uploads.toFile;
192
+ static fileFromPath: typeof Uploads.fileFromPath;
193
+ }
194
+ export declare namespace OgxClient {
195
+ export type RequestOptions = Core.RequestOptions;
196
+ export import OpenAICursorPage = Pagination.OpenAICursorPage;
197
+ export { type OpenAICursorPageParams as OpenAICursorPageParams, type OpenAICursorPageResponse as OpenAICursorPageResponse, };
198
+ export { Responses as Responses, type CompactedResponse as CompactedResponse, type ResponseInput as ResponseInput, type ResponseMessage as ResponseMessage, type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, type ResponseOutput as ResponseOutput, type ResponseListResponse as ResponseListResponse, type ResponseDeleteResponse as ResponseDeleteResponse, ResponseListResponsesOpenAICursorPage as ResponseListResponsesOpenAICursorPage, type ResponseCreateParams as ResponseCreateParams, type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming, type ResponseListParams as ResponseListParams, type ResponseCompactParams as ResponseCompactParams, };
199
+ export { Prompts as Prompts, type ListPromptsResponse as ListPromptsResponse, type Prompt as Prompt, type PromptListResponse as PromptListResponse, type PromptCreateParams as PromptCreateParams, type PromptRetrieveParams as PromptRetrieveParams, type PromptUpdateParams as PromptUpdateParams, type PromptSetDefaultVersionParams as PromptSetDefaultVersionParams, };
200
+ export { Conversations as Conversations, type ConversationObject as ConversationObject, type ConversationDeleteResponse as ConversationDeleteResponse, type ConversationCreateParams as ConversationCreateParams, type ConversationUpdateParams as ConversationUpdateParams, };
201
+ export { Inspect as Inspect };
202
+ export { Embeddings as Embeddings, type CreateEmbeddingsResponse as CreateEmbeddingsResponse, type EmbeddingCreateParams as EmbeddingCreateParams, };
203
+ export { Chat as Chat, type ChatCompletionChunk as ChatCompletionChunk };
204
+ export { Completions as Completions, type CompletionCreateResponse as CompletionCreateResponse, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, };
205
+ export { VectorIo as VectorIo, type QueryChunksResponse as QueryChunksResponse, type VectorIoInsertParams as VectorIoInsertParams, type VectorIoQueryParams as VectorIoQueryParams, };
206
+ export { VectorStores as VectorStores, type ListVectorStoresResponse as ListVectorStoresResponse, type VectorStore as VectorStore, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, VectorStoresOpenAICursorPage as VectorStoresOpenAICursorPage, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, type VectorStoreSearchParams as VectorStoreSearchParams, };
207
+ export { Models as Models, type ListModelsResponse as ListModelsResponse, type Model as Model, type ModelRetrieveResponse as ModelRetrieveResponse, };
208
+ export { Providers as Providers, type ProviderListResponse as ProviderListResponse };
209
+ export { Routes as Routes, type RouteListResponse as RouteListResponse, type RouteListParams as RouteListParams, };
210
+ export { Moderations as Moderations, type CreateResponse as CreateResponse, type ModerationCreateParams as ModerationCreateParams, };
211
+ export { Safety as Safety, type RunShieldResponse as RunShieldResponse, type SafetyRunShieldParams as SafetyRunShieldParams, };
212
+ export { Shields as Shields, type ListShieldsResponse as ListShieldsResponse, type Shield as Shield, type ShieldListResponse as ShieldListResponse, type ShieldRegisterParams as ShieldRegisterParams, };
213
+ export { Files as Files, type DeleteFileResponse as DeleteFileResponse, type File as File, type ListFilesResponse as ListFilesResponse, type FileContentResponse as FileContentResponse, FilesOpenAICursorPage as FilesOpenAICursorPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, };
214
+ export { Batches as Batches, type BatchCreateResponse as BatchCreateResponse, type BatchRetrieveResponse as BatchRetrieveResponse, type BatchListResponse as BatchListResponse, type BatchCancelResponse as BatchCancelResponse, BatchListResponsesOpenAICursorPage as BatchListResponsesOpenAICursorPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
215
+ export { Alpha as Alpha };
216
+ export type HealthInfo = API.HealthInfo;
217
+ export type InterleavedContent = API.InterleavedContent;
218
+ export type InterleavedContentItem = API.InterleavedContentItem;
219
+ export type ListProvidersResponse = API.ListProvidersResponse;
220
+ export type ListRoutesResponse = API.ListRoutesResponse;
221
+ export type ParamType = API.ParamType;
222
+ export type ProviderInfo = API.ProviderInfo;
223
+ export type RouteInfo = API.RouteInfo;
224
+ export type SafetyViolation = API.SafetyViolation;
225
+ export type SamplingParams = API.SamplingParams;
226
+ export type SystemMessage = API.SystemMessage;
227
+ export type VersionInfo = API.VersionInfo;
228
+ }
229
+ export { getResponseOutputText } from "./lib/response-helpers.js";
230
+ export { toFile, fileFromPath } from "./uploads.js";
231
+ export { OgxClientError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
232
+ export default OgxClient;
233
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,kCAAkC,EAClC,qBAAqB,EACrB,OAAO,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,kCAAkC,EAClC,+BAA+B,EAC/B,wBAAwB,EACxB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F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.
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || function (mod) {
24
+ if (mod && mod.__esModule) return mod;
25
+ var result = {};
26
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
+ __setModuleDefault(result, mod);
28
+ return result;
29
+ };
30
+ var _OgxClient_instances, _a, _OgxClient_baseURLOverridden;
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.OgxClientError = exports.fileFromPath = exports.toFile = exports.getResponseOutputText = exports.OgxClient = void 0;
33
+ const query_1 = require("./internal/utils/query.js");
34
+ const Core = __importStar(require("./core.js"));
35
+ const Errors = __importStar(require("./error.js"));
36
+ const Pagination = __importStar(require("./pagination.js"));
37
+ const Uploads = __importStar(require("./uploads.js"));
38
+ const API = __importStar(require("./resources/index.js"));
39
+ const batches_1 = require("./resources/batches.js");
40
+ const completions_1 = require("./resources/completions.js");
41
+ const embeddings_1 = require("./resources/embeddings.js");
42
+ const files_1 = require("./resources/files.js");
43
+ const inspect_1 = require("./resources/inspect.js");
44
+ const moderations_1 = require("./resources/moderations.js");
45
+ const providers_1 = require("./resources/providers.js");
46
+ const routes_1 = require("./resources/routes.js");
47
+ const safety_1 = require("./resources/safety.js");
48
+ const shields_1 = require("./resources/shields.js");
49
+ const vector_io_1 = require("./resources/vector-io.js");
50
+ const alpha_1 = require("./resources/alpha/alpha.js");
51
+ const chat_1 = require("./resources/chat/chat.js");
52
+ const conversations_1 = require("./resources/conversations/conversations.js");
53
+ const models_1 = require("./resources/models/models.js");
54
+ const prompts_1 = require("./resources/prompts/prompts.js");
55
+ const responses_1 = require("./resources/responses/responses.js");
56
+ const vector_stores_1 = require("./resources/vector-stores/vector-stores.js");
57
+ /**
58
+ * API Client for interfacing with the Ogx Client API.
59
+ */
60
+ class OgxClient extends Core.APIClient {
61
+ /**
62
+ * API Client for interfacing with the Ogx Client API.
63
+ *
64
+ * @param {string | null | undefined} [opts.apiKey=process.env['OGX_CLIENT_API_KEY'] ?? null]
65
+ * @param {string} [opts.baseURL=process.env['OGX_CLIENT_BASE_URL'] ?? http://any-hosted-ogx.com] - Override the default base URL for the API.
66
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
67
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
68
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
69
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
70
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
71
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
72
+ */
73
+ constructor({ baseURL = Core.readEnv('OGX_CLIENT_BASE_URL'), apiKey = Core.readEnv('OGX_CLIENT_API_KEY') ?? null, ...opts } = {}) {
74
+ const options = {
75
+ apiKey,
76
+ ...opts,
77
+ baseURL: baseURL || `http://any-hosted-ogx.com`,
78
+ };
79
+ super({
80
+ baseURL: options.baseURL,
81
+ baseURLOverridden: baseURL ? baseURL !== 'http://any-hosted-ogx.com' : false,
82
+ timeout: options.timeout ?? 60000 /* 1 minute */,
83
+ httpAgent: options.httpAgent,
84
+ maxRetries: options.maxRetries,
85
+ fetch: options.fetch,
86
+ });
87
+ _OgxClient_instances.add(this);
88
+ /**
89
+ * OpenAI Responses API for agent orchestration with tool use, multi-turn conversations, and background processing.
90
+ */
91
+ this.responses = new API.Responses(this);
92
+ /**
93
+ * Protocol for prompt management operations.
94
+ */
95
+ this.prompts = new API.Prompts(this);
96
+ /**
97
+ * Protocol for conversation management operations.
98
+ */
99
+ this.conversations = new API.Conversations(this);
100
+ /**
101
+ * APIs for inspecting the OGX service, including health status, available API routes with methods and implementing providers.
102
+ */
103
+ this.inspect = new API.Inspect(this);
104
+ /**
105
+ * OGX Inference API for generating completions, chat completions, and embeddings.
106
+ *
107
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
108
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
109
+ * - Embedding models: these models generate embeddings to be used for semantic search.
110
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
111
+ */
112
+ this.embeddings = new API.Embeddings(this);
113
+ this.chat = new API.Chat(this);
114
+ /**
115
+ * OGX Inference API for generating completions, chat completions, and embeddings.
116
+ *
117
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
118
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
119
+ * - Embedding models: these models generate embeddings to be used for semantic search.
120
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
121
+ */
122
+ this.completions = new API.Completions(this);
123
+ this.vectorIo = new API.VectorIo(this);
124
+ this.vectorStores = new API.VectorStores(this);
125
+ this.models = new API.Models(this);
126
+ /**
127
+ * Providers API for inspecting, listing, and modifying providers and their configurations.
128
+ */
129
+ this.providers = new API.Providers(this);
130
+ /**
131
+ * APIs for inspecting the OGX service, including health status, available API routes with methods and implementing providers.
132
+ */
133
+ this.routes = new API.Routes(this);
134
+ /**
135
+ * OpenAI-compatible Moderations API.
136
+ */
137
+ this.moderations = new API.Moderations(this);
138
+ /**
139
+ * OpenAI-compatible Moderations API.
140
+ */
141
+ this.safety = new API.Safety(this);
142
+ this.shields = new API.Shields(this);
143
+ /**
144
+ * This API is used to upload documents that can be used with other OGX APIs.
145
+ */
146
+ this.files = new API.Files(this);
147
+ /**
148
+ * The API is designed to allow use of openai client libraries for seamless integration.
149
+ *
150
+ * This API provides the following extensions:
151
+ * - idempotent batch creation
152
+ *
153
+ * Note: This API is currently under active development and may undergo changes.
154
+ */
155
+ this.batches = new API.Batches(this);
156
+ this.alpha = new API.Alpha(this);
157
+ const customHeadersEnv = Core.readEnv('OGX_CLIENT_CUSTOM_HEADERS');
158
+ if (customHeadersEnv) {
159
+ const parsed = {};
160
+ for (const line of customHeadersEnv.split('\n')) {
161
+ const colon = line.indexOf(':');
162
+ if (colon >= 0) {
163
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
164
+ }
165
+ }
166
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
167
+ }
168
+ this._options = options;
169
+ this.apiKey = apiKey;
170
+ }
171
+ defaultQuery() {
172
+ return this._options.defaultQuery;
173
+ }
174
+ defaultHeaders(opts) {
175
+ return {
176
+ ...super.defaultHeaders(opts),
177
+ ...this._options.defaultHeaders,
178
+ };
179
+ }
180
+ authHeaders(opts) {
181
+ if (this.apiKey == null) {
182
+ return {};
183
+ }
184
+ return { Authorization: `Bearer ${this.apiKey}` };
185
+ }
186
+ stringifyQuery(query) {
187
+ return (0, query_1.stringifyQuery)(query);
188
+ }
189
+ }
190
+ exports.OgxClient = OgxClient;
191
+ _a = OgxClient, _OgxClient_instances = new WeakSet(), _OgxClient_baseURLOverridden = function _OgxClient_baseURLOverridden() {
192
+ return this.baseURL !== 'http://any-hosted-ogx.com';
193
+ };
194
+ OgxClient.OgxClient = _a;
195
+ OgxClient.DEFAULT_TIMEOUT = 60000; // 1 minute
196
+ OgxClient.OgxClientError = Errors.OgxClientError;
197
+ OgxClient.APIError = Errors.APIError;
198
+ OgxClient.APIConnectionError = Errors.APIConnectionError;
199
+ OgxClient.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
200
+ OgxClient.APIUserAbortError = Errors.APIUserAbortError;
201
+ OgxClient.NotFoundError = Errors.NotFoundError;
202
+ OgxClient.ConflictError = Errors.ConflictError;
203
+ OgxClient.RateLimitError = Errors.RateLimitError;
204
+ OgxClient.BadRequestError = Errors.BadRequestError;
205
+ OgxClient.AuthenticationError = Errors.AuthenticationError;
206
+ OgxClient.InternalServerError = Errors.InternalServerError;
207
+ OgxClient.PermissionDeniedError = Errors.PermissionDeniedError;
208
+ OgxClient.UnprocessableEntityError = Errors.UnprocessableEntityError;
209
+ OgxClient.toFile = Uploads.toFile;
210
+ OgxClient.fileFromPath = Uploads.fileFromPath;
211
+ OgxClient.Responses = responses_1.Responses;
212
+ OgxClient.ResponseListResponsesOpenAICursorPage = responses_1.ResponseListResponsesOpenAICursorPage;
213
+ OgxClient.Prompts = prompts_1.Prompts;
214
+ OgxClient.Conversations = conversations_1.Conversations;
215
+ OgxClient.Inspect = inspect_1.Inspect;
216
+ OgxClient.Embeddings = embeddings_1.Embeddings;
217
+ OgxClient.Chat = chat_1.Chat;
218
+ OgxClient.Completions = completions_1.Completions;
219
+ OgxClient.VectorIo = vector_io_1.VectorIo;
220
+ OgxClient.VectorStores = vector_stores_1.VectorStores;
221
+ OgxClient.VectorStoresOpenAICursorPage = vector_stores_1.VectorStoresOpenAICursorPage;
222
+ OgxClient.Models = models_1.Models;
223
+ OgxClient.Providers = providers_1.Providers;
224
+ OgxClient.Routes = routes_1.Routes;
225
+ OgxClient.Moderations = moderations_1.Moderations;
226
+ OgxClient.Safety = safety_1.Safety;
227
+ OgxClient.Shields = shields_1.Shields;
228
+ OgxClient.Files = files_1.Files;
229
+ OgxClient.FilesOpenAICursorPage = files_1.FilesOpenAICursorPage;
230
+ OgxClient.Batches = batches_1.Batches;
231
+ OgxClient.BatchListResponsesOpenAICursorPage = batches_1.BatchListResponsesOpenAICursorPage;
232
+ OgxClient.Alpha = alpha_1.Alpha;
233
+ var response_helpers_1 = require("./lib/response-helpers.js");
234
+ Object.defineProperty(exports, "getResponseOutputText", { enumerable: true, get: function () { return response_helpers_1.getResponseOutputText; } });
235
+ var uploads_1 = require("./uploads.js");
236
+ Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
237
+ Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
238
+ var error_1 = require("./error.js");
239
+ Object.defineProperty(exports, "OgxClientError", { enumerable: true, get: function () { return error_1.OgxClientError; } });
240
+ Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
241
+ Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return error_1.APIConnectionError; } });
242
+ Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return error_1.APIConnectionTimeoutError; } });
243
+ Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return error_1.APIUserAbortError; } });
244
+ Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return error_1.NotFoundError; } });
245
+ Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
246
+ Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_1.RateLimitError; } });
247
+ Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
248
+ Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return error_1.AuthenticationError; } });
249
+ Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
250
+ Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
251
+ Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
252
+ exports = module.exports = OgxClient;
253
+ exports.default = OgxClient;
254
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM1C,qDAAwD;AACxD,gDAA+B;AAC/B,mDAAkC;AAClC,4DAA2C;AAE3C,sDAAqC;AACrC,0DAAyC;AACzC,oDAS6B;AAC7B,4DAMiC;AACjC,0DAAqG;AACrG,gDAS2B;AAC3B,oDAA8C;AAC9C,4DAA8F;AAC9F,wDAAwE;AACxE,kDAAgF;AAChF,kDAAsF;AACtF,oDAM6B;AAC7B,wDAK+B;AAC/B,sDAAgD;AAChD,mDAAkE;AAClE,8EAMiD;AACjD,yDAAqG;AACrG,4DASqC;AACrC,kEAgByC;AACzC,8EAWiD;AAmEjD;;GAEG;AACH,MAAa,SAAU,SAAQ,IAAI,CAAC,SAAS;IAK3C;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAC7C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI,EACnD,GAAG,IAAI,KACU,EAAE;QACnB,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,2BAA2B;SAChD,CAAC;QAEF,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAQ;YACzB,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,KAAK,2BAA2B,CAAC,CAAC,CAAC,KAAK;YAC5E,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,S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