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,2061 @@
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
+
9
+ import { APIResource } from '../../resource';
10
+ import { isRequestOptions } from '../../core';
11
+ import * as Core from '../../core';
12
+ import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination';
13
+
14
+ /**
15
+ * Protocol for conversation management operations.
16
+ */
17
+ export class Items extends APIResource {
18
+ /**
19
+ * Create items in the conversation.
20
+ */
21
+ create(
22
+ conversationId: string,
23
+ body: ItemCreateParams,
24
+ options?: Core.RequestOptions,
25
+ ): Core.APIPromise<ItemCreateResponse> {
26
+ return this._client.post(`/v1/conversations/${conversationId}/items`, { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * List items in the conversation.
31
+ */
32
+ list(
33
+ conversationId: string,
34
+ query?: ItemListParams,
35
+ options?: Core.RequestOptions,
36
+ ): Core.PagePromise<ItemListResponsesOpenAICursorPage, ItemListResponse>;
37
+ list(
38
+ conversationId: string,
39
+ options?: Core.RequestOptions,
40
+ ): Core.PagePromise<ItemListResponsesOpenAICursorPage, ItemListResponse>;
41
+ list(
42
+ conversationId: string,
43
+ query: ItemListParams | Core.RequestOptions = {},
44
+ options?: Core.RequestOptions,
45
+ ): Core.PagePromise<ItemListResponsesOpenAICursorPage, ItemListResponse> {
46
+ if (isRequestOptions(query)) {
47
+ return this.list(conversationId, {}, query);
48
+ }
49
+ return this._client.getAPIList(
50
+ `/v1/conversations/${conversationId}/items`,
51
+ ItemListResponsesOpenAICursorPage,
52
+ { query, ...options },
53
+ );
54
+ }
55
+
56
+ /**
57
+ * Delete a conversation item.
58
+ */
59
+ delete(
60
+ conversationId: string,
61
+ itemId: string,
62
+ options?: Core.RequestOptions,
63
+ ): Core.APIPromise<ItemDeleteResponse> {
64
+ return this._client.delete(`/v1/conversations/${conversationId}/items/${itemId}`, options);
65
+ }
66
+
67
+ /**
68
+ * Retrieve a conversation item.
69
+ */
70
+ get(
71
+ conversationId: string,
72
+ itemId: string,
73
+ options?: Core.RequestOptions,
74
+ ): Core.APIPromise<ItemGetResponse> {
75
+ return this._client.get(`/v1/conversations/${conversationId}/items/${itemId}`, options);
76
+ }
77
+ }
78
+
79
+ export class ItemListResponsesOpenAICursorPage extends OpenAICursorPage<ItemListResponse> {}
80
+
81
+ /**
82
+ * List of conversation items with pagination.
83
+ */
84
+ export interface ItemCreateResponse {
85
+ /**
86
+ * List of conversation items
87
+ */
88
+ data: Array<
89
+ | ItemCreateResponse.OpenAIResponseMessageOutput
90
+ | ItemCreateResponse.OpenAIResponseOutputMessageWebSearchToolCall
91
+ | ItemCreateResponse.OpenAIResponseOutputMessageFileSearchToolCall
92
+ | ItemCreateResponse.OpenAIResponseOutputMessageFunctionToolCall
93
+ | ItemCreateResponse.OpenAIResponseInputFunctionToolCallOutput
94
+ | ItemCreateResponse.OpenAIResponseMcpApprovalRequest
95
+ | ItemCreateResponse.OpenAIResponseMcpApprovalResponse
96
+ | ItemCreateResponse.OpenAIResponseOutputMessageMcpCall
97
+ | ItemCreateResponse.OpenAIResponseOutputMessageMcpListTools
98
+ | ItemCreateResponse.OpenAIResponseOutputMessageReasoningItem
99
+ >;
100
+
101
+ /**
102
+ * The ID of the first item in the list
103
+ */
104
+ first_id?: string | null;
105
+
106
+ /**
107
+ * Whether there are more items available
108
+ */
109
+ has_more?: boolean;
110
+
111
+ /**
112
+ * The ID of the last item in the list
113
+ */
114
+ last_id?: string | null;
115
+
116
+ /**
117
+ * Object type
118
+ */
119
+ object?: string;
120
+ }
121
+
122
+ export namespace ItemCreateResponse {
123
+ /**
124
+ * Corresponds to the various Message types in the Responses API. They are all
125
+ * under one type because the Responses API gives them all the same "type" value,
126
+ * and there is no way to tell them apart in certain scenarios.
127
+ */
128
+ export interface OpenAIResponseMessageOutput {
129
+ content:
130
+ | string
131
+ | Array<
132
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText
133
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage
134
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile
135
+ >
136
+ | Array<
137
+ | OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput
138
+ | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal
139
+ >;
140
+
141
+ role: 'system' | 'developer' | 'user' | 'assistant';
142
+
143
+ id?: string | null;
144
+
145
+ status?: string | null;
146
+
147
+ type?: 'message';
148
+ }
149
+
150
+ export namespace OpenAIResponseMessageOutput {
151
+ /**
152
+ * Text content for input messages in OpenAI response format.
153
+ */
154
+ export interface OpenAIResponseInputMessageContentText {
155
+ text: string;
156
+
157
+ type?: 'input_text';
158
+ }
159
+
160
+ /**
161
+ * Image content for input messages in OpenAI response format.
162
+ */
163
+ export interface OpenAIResponseInputMessageContentImage {
164
+ detail?: 'low' | 'high' | 'auto';
165
+
166
+ file_id?: string | null;
167
+
168
+ image_url?: string | null;
169
+
170
+ type?: 'input_image';
171
+ }
172
+
173
+ /**
174
+ * File content for input messages in OpenAI response format.
175
+ */
176
+ export interface OpenAIResponseInputMessageContentFile {
177
+ file_data?: string | null;
178
+
179
+ file_id?: string | null;
180
+
181
+ file_url?: string | null;
182
+
183
+ filename?: string | null;
184
+
185
+ type?: 'input_file';
186
+ }
187
+
188
+ /**
189
+ * Text content within an output message of an OpenAI response.
190
+ */
191
+ export interface OpenAIResponseOutputMessageContentOutputTextOutput {
192
+ text: string;
193
+
194
+ annotations?: Array<
195
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation
196
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation
197
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation
198
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath
199
+ >;
200
+
201
+ logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
202
+
203
+ type?: 'output_text';
204
+ }
205
+
206
+ export namespace OpenAIResponseOutputMessageContentOutputTextOutput {
207
+ /**
208
+ * File citation annotation for referencing specific files in response content.
209
+ */
210
+ export interface OpenAIResponseAnnotationFileCitation {
211
+ file_id: string;
212
+
213
+ filename: string;
214
+
215
+ index: number;
216
+
217
+ type?: 'file_citation';
218
+ }
219
+
220
+ /**
221
+ * URL citation annotation for referencing external web resources.
222
+ */
223
+ export interface OpenAIResponseAnnotationCitation {
224
+ end_index: number;
225
+
226
+ start_index: number;
227
+
228
+ title: string;
229
+
230
+ url: string;
231
+
232
+ type?: 'url_citation';
233
+ }
234
+
235
+ /**
236
+ * Container file citation annotation referencing a file within a container.
237
+ */
238
+ export interface OpenAIResponseAnnotationContainerFileCitation {
239
+ container_id: string;
240
+
241
+ end_index: number;
242
+
243
+ file_id: string;
244
+
245
+ filename: string;
246
+
247
+ start_index: number;
248
+
249
+ type?: 'container_file_citation';
250
+ }
251
+
252
+ /**
253
+ * File path annotation referencing a generated file in response content.
254
+ */
255
+ export interface OpenAIResponseAnnotationFilePath {
256
+ file_id: string;
257
+
258
+ index: number;
259
+
260
+ type?: 'file_path';
261
+ }
262
+
263
+ /**
264
+ * The log probability for a token from an OpenAI-compatible chat completion
265
+ * response.
266
+ */
267
+ export interface Logprob {
268
+ /**
269
+ * The token.
270
+ */
271
+ token: string;
272
+
273
+ /**
274
+ * The log probability of the token.
275
+ */
276
+ logprob: number;
277
+
278
+ /**
279
+ * The bytes for the token.
280
+ */
281
+ bytes?: Array<number> | null;
282
+
283
+ /**
284
+ * The top log probabilities for the token.
285
+ */
286
+ top_logprobs?: Array<Logprob.TopLogprob> | null;
287
+ }
288
+
289
+ export namespace Logprob {
290
+ /**
291
+ * The top log probability for a token from an OpenAI-compatible chat completion
292
+ * response.
293
+ */
294
+ export interface TopLogprob {
295
+ /**
296
+ * The token.
297
+ */
298
+ token: string;
299
+
300
+ /**
301
+ * The log probability of the token.
302
+ */
303
+ logprob: number;
304
+
305
+ /**
306
+ * The bytes for the token.
307
+ */
308
+ bytes?: Array<number> | null;
309
+ }
310
+ }
311
+ }
312
+
313
+ /**
314
+ * Refusal content within a streamed response part.
315
+ */
316
+ export interface OpenAIResponseContentPartRefusal {
317
+ refusal: string;
318
+
319
+ type?: 'refusal';
320
+ }
321
+ }
322
+
323
+ /**
324
+ * Web search tool call output message for OpenAI responses.
325
+ */
326
+ export interface OpenAIResponseOutputMessageWebSearchToolCall {
327
+ id: string;
328
+
329
+ status: string;
330
+
331
+ type?: 'web_search_call';
332
+ }
333
+
334
+ /**
335
+ * File search tool call output message for OpenAI responses.
336
+ */
337
+ export interface OpenAIResponseOutputMessageFileSearchToolCall {
338
+ id: string;
339
+
340
+ queries: Array<string>;
341
+
342
+ status: string;
343
+
344
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
345
+
346
+ type?: 'file_search_call';
347
+ }
348
+
349
+ export namespace OpenAIResponseOutputMessageFileSearchToolCall {
350
+ /**
351
+ * Search results returned by the file search operation.
352
+ */
353
+ export interface Result {
354
+ attributes: { [key: string]: unknown };
355
+
356
+ file_id: string;
357
+
358
+ filename: string;
359
+
360
+ score: number;
361
+
362
+ text: string;
363
+ }
364
+ }
365
+
366
+ /**
367
+ * Function tool call output message for OpenAI responses.
368
+ */
369
+ export interface OpenAIResponseOutputMessageFunctionToolCall {
370
+ arguments: string;
371
+
372
+ call_id: string;
373
+
374
+ name: string;
375
+
376
+ id?: string | null;
377
+
378
+ status?: string | null;
379
+
380
+ type?: 'function_call';
381
+ }
382
+
383
+ /**
384
+ * This represents the output of a function call that gets passed back to the
385
+ * model.
386
+ */
387
+ export interface OpenAIResponseInputFunctionToolCallOutput {
388
+ call_id: string;
389
+
390
+ output:
391
+ | string
392
+ | Array<
393
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText
394
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage
395
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile
396
+ >;
397
+
398
+ id?: string | null;
399
+
400
+ status?: string | null;
401
+
402
+ type?: 'function_call_output';
403
+ }
404
+
405
+ export namespace OpenAIResponseInputFunctionToolCallOutput {
406
+ /**
407
+ * Text content for input messages in OpenAI response format.
408
+ */
409
+ export interface OpenAIResponseInputMessageContentText {
410
+ text: string;
411
+
412
+ type?: 'input_text';
413
+ }
414
+
415
+ /**
416
+ * Image content for input messages in OpenAI response format.
417
+ */
418
+ export interface OpenAIResponseInputMessageContentImage {
419
+ detail?: 'low' | 'high' | 'auto';
420
+
421
+ file_id?: string | null;
422
+
423
+ image_url?: string | null;
424
+
425
+ type?: 'input_image';
426
+ }
427
+
428
+ /**
429
+ * File content for input messages in OpenAI response format.
430
+ */
431
+ export interface OpenAIResponseInputMessageContentFile {
432
+ file_data?: string | null;
433
+
434
+ file_id?: string | null;
435
+
436
+ file_url?: string | null;
437
+
438
+ filename?: string | null;
439
+
440
+ type?: 'input_file';
441
+ }
442
+ }
443
+
444
+ /**
445
+ * A request for human approval of a tool invocation.
446
+ */
447
+ export interface OpenAIResponseMcpApprovalRequest {
448
+ id: string;
449
+
450
+ arguments: string;
451
+
452
+ name: string;
453
+
454
+ server_label: string;
455
+
456
+ type?: 'mcp_approval_request';
457
+ }
458
+
459
+ /**
460
+ * A response to an MCP approval request.
461
+ */
462
+ export interface OpenAIResponseMcpApprovalResponse {
463
+ approval_request_id: string;
464
+
465
+ approve: boolean;
466
+
467
+ id?: string | null;
468
+
469
+ reason?: string | null;
470
+
471
+ type?: 'mcp_approval_response';
472
+ }
473
+
474
+ /**
475
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
476
+ */
477
+ export interface OpenAIResponseOutputMessageMcpCall {
478
+ id: string;
479
+
480
+ arguments: string;
481
+
482
+ name: string;
483
+
484
+ server_label: string;
485
+
486
+ error?: string | null;
487
+
488
+ output?: string | null;
489
+
490
+ type?: 'mcp_call';
491
+ }
492
+
493
+ /**
494
+ * MCP list tools output message containing available tools from an MCP server.
495
+ */
496
+ export interface OpenAIResponseOutputMessageMcpListTools {
497
+ id: string;
498
+
499
+ server_label: string;
500
+
501
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
502
+
503
+ type?: 'mcp_list_tools';
504
+ }
505
+
506
+ export namespace OpenAIResponseOutputMessageMcpListTools {
507
+ /**
508
+ * Tool definition returned by MCP list tools operation.
509
+ */
510
+ export interface Tool {
511
+ input_schema: { [key: string]: unknown };
512
+
513
+ name: string;
514
+
515
+ description?: string | null;
516
+ }
517
+ }
518
+
519
+ /**
520
+ * Reasoning output from the model, representing the model's thinking process.
521
+ */
522
+ export interface OpenAIResponseOutputMessageReasoningItem {
523
+ /**
524
+ * Unique identifier for the reasoning output item.
525
+ */
526
+ id: string;
527
+
528
+ /**
529
+ * Summary of the reasoning output.
530
+ */
531
+ summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
532
+
533
+ /**
534
+ * The reasoning content from the model.
535
+ */
536
+ content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
537
+
538
+ /**
539
+ * The status of the reasoning output.
540
+ */
541
+ status?: 'in_progress' | 'completed' | 'incomplete' | null;
542
+
543
+ /**
544
+ * The type identifier, always 'reasoning'.
545
+ */
546
+ type?: 'reasoning';
547
+ }
548
+
549
+ export namespace OpenAIResponseOutputMessageReasoningItem {
550
+ /**
551
+ * A summary of reasoning output from the model.
552
+ */
553
+ export interface Summary {
554
+ /**
555
+ * The summary text of the reasoning output.
556
+ */
557
+ text: string;
558
+
559
+ /**
560
+ * The type identifier, always 'summary_text'.
561
+ */
562
+ type?: 'summary_text';
563
+ }
564
+
565
+ /**
566
+ * Reasoning text from the model.
567
+ */
568
+ export interface Content {
569
+ /**
570
+ * The reasoning text content from the model.
571
+ */
572
+ text: string;
573
+
574
+ /**
575
+ * The type identifier, always 'reasoning_text'.
576
+ */
577
+ type?: 'reasoning_text';
578
+ }
579
+ }
580
+ }
581
+
582
+ /**
583
+ * Corresponds to the various Message types in the Responses API. They are all
584
+ * under one type because the Responses API gives them all the same "type" value,
585
+ * and there is no way to tell them apart in certain scenarios.
586
+ */
587
+ export type ItemListResponse =
588
+ | ItemListResponse.OpenAIResponseMessageOutput
589
+ | ItemListResponse.OpenAIResponseOutputMessageWebSearchToolCall
590
+ | ItemListResponse.OpenAIResponseOutputMessageFileSearchToolCall
591
+ | ItemListResponse.OpenAIResponseOutputMessageFunctionToolCall
592
+ | ItemListResponse.OpenAIResponseInputFunctionToolCallOutput
593
+ | ItemListResponse.OpenAIResponseMcpApprovalRequest
594
+ | ItemListResponse.OpenAIResponseMcpApprovalResponse
595
+ | ItemListResponse.OpenAIResponseOutputMessageMcpCall
596
+ | ItemListResponse.OpenAIResponseOutputMessageMcpListTools
597
+ | ItemListResponse.OpenAIResponseOutputMessageReasoningItem;
598
+
599
+ export namespace ItemListResponse {
600
+ /**
601
+ * Corresponds to the various Message types in the Responses API. They are all
602
+ * under one type because the Responses API gives them all the same "type" value,
603
+ * and there is no way to tell them apart in certain scenarios.
604
+ */
605
+ export interface OpenAIResponseMessageOutput {
606
+ content:
607
+ | string
608
+ | Array<
609
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText
610
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage
611
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile
612
+ >
613
+ | Array<
614
+ | OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput
615
+ | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal
616
+ >;
617
+
618
+ role: 'system' | 'developer' | 'user' | 'assistant';
619
+
620
+ id?: string | null;
621
+
622
+ status?: string | null;
623
+
624
+ type?: 'message';
625
+ }
626
+
627
+ export namespace OpenAIResponseMessageOutput {
628
+ /**
629
+ * Text content for input messages in OpenAI response format.
630
+ */
631
+ export interface OpenAIResponseInputMessageContentText {
632
+ text: string;
633
+
634
+ type?: 'input_text';
635
+ }
636
+
637
+ /**
638
+ * Image content for input messages in OpenAI response format.
639
+ */
640
+ export interface OpenAIResponseInputMessageContentImage {
641
+ detail?: 'low' | 'high' | 'auto';
642
+
643
+ file_id?: string | null;
644
+
645
+ image_url?: string | null;
646
+
647
+ type?: 'input_image';
648
+ }
649
+
650
+ /**
651
+ * File content for input messages in OpenAI response format.
652
+ */
653
+ export interface OpenAIResponseInputMessageContentFile {
654
+ file_data?: string | null;
655
+
656
+ file_id?: string | null;
657
+
658
+ file_url?: string | null;
659
+
660
+ filename?: string | null;
661
+
662
+ type?: 'input_file';
663
+ }
664
+
665
+ /**
666
+ * Text content within an output message of an OpenAI response.
667
+ */
668
+ export interface OpenAIResponseOutputMessageContentOutputTextOutput {
669
+ text: string;
670
+
671
+ annotations?: Array<
672
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation
673
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation
674
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation
675
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath
676
+ >;
677
+
678
+ logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
679
+
680
+ type?: 'output_text';
681
+ }
682
+
683
+ export namespace OpenAIResponseOutputMessageContentOutputTextOutput {
684
+ /**
685
+ * File citation annotation for referencing specific files in response content.
686
+ */
687
+ export interface OpenAIResponseAnnotationFileCitation {
688
+ file_id: string;
689
+
690
+ filename: string;
691
+
692
+ index: number;
693
+
694
+ type?: 'file_citation';
695
+ }
696
+
697
+ /**
698
+ * URL citation annotation for referencing external web resources.
699
+ */
700
+ export interface OpenAIResponseAnnotationCitation {
701
+ end_index: number;
702
+
703
+ start_index: number;
704
+
705
+ title: string;
706
+
707
+ url: string;
708
+
709
+ type?: 'url_citation';
710
+ }
711
+
712
+ /**
713
+ * Container file citation annotation referencing a file within a container.
714
+ */
715
+ export interface OpenAIResponseAnnotationContainerFileCitation {
716
+ container_id: string;
717
+
718
+ end_index: number;
719
+
720
+ file_id: string;
721
+
722
+ filename: string;
723
+
724
+ start_index: number;
725
+
726
+ type?: 'container_file_citation';
727
+ }
728
+
729
+ /**
730
+ * File path annotation referencing a generated file in response content.
731
+ */
732
+ export interface OpenAIResponseAnnotationFilePath {
733
+ file_id: string;
734
+
735
+ index: number;
736
+
737
+ type?: 'file_path';
738
+ }
739
+
740
+ /**
741
+ * The log probability for a token from an OpenAI-compatible chat completion
742
+ * response.
743
+ */
744
+ export interface Logprob {
745
+ /**
746
+ * The token.
747
+ */
748
+ token: string;
749
+
750
+ /**
751
+ * The log probability of the token.
752
+ */
753
+ logprob: number;
754
+
755
+ /**
756
+ * The bytes for the token.
757
+ */
758
+ bytes?: Array<number> | null;
759
+
760
+ /**
761
+ * The top log probabilities for the token.
762
+ */
763
+ top_logprobs?: Array<Logprob.TopLogprob> | null;
764
+ }
765
+
766
+ export namespace Logprob {
767
+ /**
768
+ * The top log probability for a token from an OpenAI-compatible chat completion
769
+ * response.
770
+ */
771
+ export interface TopLogprob {
772
+ /**
773
+ * The token.
774
+ */
775
+ token: string;
776
+
777
+ /**
778
+ * The log probability of the token.
779
+ */
780
+ logprob: number;
781
+
782
+ /**
783
+ * The bytes for the token.
784
+ */
785
+ bytes?: Array<number> | null;
786
+ }
787
+ }
788
+ }
789
+
790
+ /**
791
+ * Refusal content within a streamed response part.
792
+ */
793
+ export interface OpenAIResponseContentPartRefusal {
794
+ refusal: string;
795
+
796
+ type?: 'refusal';
797
+ }
798
+ }
799
+
800
+ /**
801
+ * Web search tool call output message for OpenAI responses.
802
+ */
803
+ export interface OpenAIResponseOutputMessageWebSearchToolCall {
804
+ id: string;
805
+
806
+ status: string;
807
+
808
+ type?: 'web_search_call';
809
+ }
810
+
811
+ /**
812
+ * File search tool call output message for OpenAI responses.
813
+ */
814
+ export interface OpenAIResponseOutputMessageFileSearchToolCall {
815
+ id: string;
816
+
817
+ queries: Array<string>;
818
+
819
+ status: string;
820
+
821
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
822
+
823
+ type?: 'file_search_call';
824
+ }
825
+
826
+ export namespace OpenAIResponseOutputMessageFileSearchToolCall {
827
+ /**
828
+ * Search results returned by the file search operation.
829
+ */
830
+ export interface Result {
831
+ attributes: { [key: string]: unknown };
832
+
833
+ file_id: string;
834
+
835
+ filename: string;
836
+
837
+ score: number;
838
+
839
+ text: string;
840
+ }
841
+ }
842
+
843
+ /**
844
+ * Function tool call output message for OpenAI responses.
845
+ */
846
+ export interface OpenAIResponseOutputMessageFunctionToolCall {
847
+ arguments: string;
848
+
849
+ call_id: string;
850
+
851
+ name: string;
852
+
853
+ id?: string | null;
854
+
855
+ status?: string | null;
856
+
857
+ type?: 'function_call';
858
+ }
859
+
860
+ /**
861
+ * This represents the output of a function call that gets passed back to the
862
+ * model.
863
+ */
864
+ export interface OpenAIResponseInputFunctionToolCallOutput {
865
+ call_id: string;
866
+
867
+ output:
868
+ | string
869
+ | Array<
870
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText
871
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage
872
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile
873
+ >;
874
+
875
+ id?: string | null;
876
+
877
+ status?: string | null;
878
+
879
+ type?: 'function_call_output';
880
+ }
881
+
882
+ export namespace OpenAIResponseInputFunctionToolCallOutput {
883
+ /**
884
+ * Text content for input messages in OpenAI response format.
885
+ */
886
+ export interface OpenAIResponseInputMessageContentText {
887
+ text: string;
888
+
889
+ type?: 'input_text';
890
+ }
891
+
892
+ /**
893
+ * Image content for input messages in OpenAI response format.
894
+ */
895
+ export interface OpenAIResponseInputMessageContentImage {
896
+ detail?: 'low' | 'high' | 'auto';
897
+
898
+ file_id?: string | null;
899
+
900
+ image_url?: string | null;
901
+
902
+ type?: 'input_image';
903
+ }
904
+
905
+ /**
906
+ * File content for input messages in OpenAI response format.
907
+ */
908
+ export interface OpenAIResponseInputMessageContentFile {
909
+ file_data?: string | null;
910
+
911
+ file_id?: string | null;
912
+
913
+ file_url?: string | null;
914
+
915
+ filename?: string | null;
916
+
917
+ type?: 'input_file';
918
+ }
919
+ }
920
+
921
+ /**
922
+ * A request for human approval of a tool invocation.
923
+ */
924
+ export interface OpenAIResponseMcpApprovalRequest {
925
+ id: string;
926
+
927
+ arguments: string;
928
+
929
+ name: string;
930
+
931
+ server_label: string;
932
+
933
+ type?: 'mcp_approval_request';
934
+ }
935
+
936
+ /**
937
+ * A response to an MCP approval request.
938
+ */
939
+ export interface OpenAIResponseMcpApprovalResponse {
940
+ approval_request_id: string;
941
+
942
+ approve: boolean;
943
+
944
+ id?: string | null;
945
+
946
+ reason?: string | null;
947
+
948
+ type?: 'mcp_approval_response';
949
+ }
950
+
951
+ /**
952
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
953
+ */
954
+ export interface OpenAIResponseOutputMessageMcpCall {
955
+ id: string;
956
+
957
+ arguments: string;
958
+
959
+ name: string;
960
+
961
+ server_label: string;
962
+
963
+ error?: string | null;
964
+
965
+ output?: string | null;
966
+
967
+ type?: 'mcp_call';
968
+ }
969
+
970
+ /**
971
+ * MCP list tools output message containing available tools from an MCP server.
972
+ */
973
+ export interface OpenAIResponseOutputMessageMcpListTools {
974
+ id: string;
975
+
976
+ server_label: string;
977
+
978
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
979
+
980
+ type?: 'mcp_list_tools';
981
+ }
982
+
983
+ export namespace OpenAIResponseOutputMessageMcpListTools {
984
+ /**
985
+ * Tool definition returned by MCP list tools operation.
986
+ */
987
+ export interface Tool {
988
+ input_schema: { [key: string]: unknown };
989
+
990
+ name: string;
991
+
992
+ description?: string | null;
993
+ }
994
+ }
995
+
996
+ /**
997
+ * Reasoning output from the model, representing the model's thinking process.
998
+ */
999
+ export interface OpenAIResponseOutputMessageReasoningItem {
1000
+ /**
1001
+ * Unique identifier for the reasoning output item.
1002
+ */
1003
+ id: string;
1004
+
1005
+ /**
1006
+ * Summary of the reasoning output.
1007
+ */
1008
+ summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
1009
+
1010
+ /**
1011
+ * The reasoning content from the model.
1012
+ */
1013
+ content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
1014
+
1015
+ /**
1016
+ * The status of the reasoning output.
1017
+ */
1018
+ status?: 'in_progress' | 'completed' | 'incomplete' | null;
1019
+
1020
+ /**
1021
+ * The type identifier, always 'reasoning'.
1022
+ */
1023
+ type?: 'reasoning';
1024
+ }
1025
+
1026
+ export namespace OpenAIResponseOutputMessageReasoningItem {
1027
+ /**
1028
+ * A summary of reasoning output from the model.
1029
+ */
1030
+ export interface Summary {
1031
+ /**
1032
+ * The summary text of the reasoning output.
1033
+ */
1034
+ text: string;
1035
+
1036
+ /**
1037
+ * The type identifier, always 'summary_text'.
1038
+ */
1039
+ type?: 'summary_text';
1040
+ }
1041
+
1042
+ /**
1043
+ * Reasoning text from the model.
1044
+ */
1045
+ export interface Content {
1046
+ /**
1047
+ * The reasoning text content from the model.
1048
+ */
1049
+ text: string;
1050
+
1051
+ /**
1052
+ * The type identifier, always 'reasoning_text'.
1053
+ */
1054
+ type?: 'reasoning_text';
1055
+ }
1056
+ }
1057
+ }
1058
+
1059
+ /**
1060
+ * Response for deleted conversation item.
1061
+ */
1062
+ export interface ItemDeleteResponse {
1063
+ /**
1064
+ * The deleted item identifier
1065
+ */
1066
+ id: string;
1067
+
1068
+ /**
1069
+ * Whether the object was deleted
1070
+ */
1071
+ deleted?: boolean;
1072
+
1073
+ /**
1074
+ * Object type
1075
+ */
1076
+ object?: string;
1077
+ }
1078
+
1079
+ /**
1080
+ * Corresponds to the various Message types in the Responses API. They are all
1081
+ * under one type because the Responses API gives them all the same "type" value,
1082
+ * and there is no way to tell them apart in certain scenarios.
1083
+ */
1084
+ export type ItemGetResponse =
1085
+ | ItemGetResponse.OpenAIResponseMessageOutput
1086
+ | ItemGetResponse.OpenAIResponseOutputMessageWebSearchToolCall
1087
+ | ItemGetResponse.OpenAIResponseOutputMessageFileSearchToolCall
1088
+ | ItemGetResponse.OpenAIResponseOutputMessageFunctionToolCall
1089
+ | ItemGetResponse.OpenAIResponseInputFunctionToolCallOutput
1090
+ | ItemGetResponse.OpenAIResponseMcpApprovalRequest
1091
+ | ItemGetResponse.OpenAIResponseMcpApprovalResponse
1092
+ | ItemGetResponse.OpenAIResponseOutputMessageMcpCall
1093
+ | ItemGetResponse.OpenAIResponseOutputMessageMcpListTools
1094
+ | ItemGetResponse.OpenAIResponseOutputMessageReasoningItem;
1095
+
1096
+ export namespace ItemGetResponse {
1097
+ /**
1098
+ * Corresponds to the various Message types in the Responses API. They are all
1099
+ * under one type because the Responses API gives them all the same "type" value,
1100
+ * and there is no way to tell them apart in certain scenarios.
1101
+ */
1102
+ export interface OpenAIResponseMessageOutput {
1103
+ content:
1104
+ | string
1105
+ | Array<
1106
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText
1107
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage
1108
+ | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile
1109
+ >
1110
+ | Array<
1111
+ | OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput
1112
+ | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal
1113
+ >;
1114
+
1115
+ role: 'system' | 'developer' | 'user' | 'assistant';
1116
+
1117
+ id?: string | null;
1118
+
1119
+ status?: string | null;
1120
+
1121
+ type?: 'message';
1122
+ }
1123
+
1124
+ export namespace OpenAIResponseMessageOutput {
1125
+ /**
1126
+ * Text content for input messages in OpenAI response format.
1127
+ */
1128
+ export interface OpenAIResponseInputMessageContentText {
1129
+ text: string;
1130
+
1131
+ type?: 'input_text';
1132
+ }
1133
+
1134
+ /**
1135
+ * Image content for input messages in OpenAI response format.
1136
+ */
1137
+ export interface OpenAIResponseInputMessageContentImage {
1138
+ detail?: 'low' | 'high' | 'auto';
1139
+
1140
+ file_id?: string | null;
1141
+
1142
+ image_url?: string | null;
1143
+
1144
+ type?: 'input_image';
1145
+ }
1146
+
1147
+ /**
1148
+ * File content for input messages in OpenAI response format.
1149
+ */
1150
+ export interface OpenAIResponseInputMessageContentFile {
1151
+ file_data?: string | null;
1152
+
1153
+ file_id?: string | null;
1154
+
1155
+ file_url?: string | null;
1156
+
1157
+ filename?: string | null;
1158
+
1159
+ type?: 'input_file';
1160
+ }
1161
+
1162
+ /**
1163
+ * Text content within an output message of an OpenAI response.
1164
+ */
1165
+ export interface OpenAIResponseOutputMessageContentOutputTextOutput {
1166
+ text: string;
1167
+
1168
+ annotations?: Array<
1169
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation
1170
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation
1171
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation
1172
+ | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath
1173
+ >;
1174
+
1175
+ logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
1176
+
1177
+ type?: 'output_text';
1178
+ }
1179
+
1180
+ export namespace OpenAIResponseOutputMessageContentOutputTextOutput {
1181
+ /**
1182
+ * File citation annotation for referencing specific files in response content.
1183
+ */
1184
+ export interface OpenAIResponseAnnotationFileCitation {
1185
+ file_id: string;
1186
+
1187
+ filename: string;
1188
+
1189
+ index: number;
1190
+
1191
+ type?: 'file_citation';
1192
+ }
1193
+
1194
+ /**
1195
+ * URL citation annotation for referencing external web resources.
1196
+ */
1197
+ export interface OpenAIResponseAnnotationCitation {
1198
+ end_index: number;
1199
+
1200
+ start_index: number;
1201
+
1202
+ title: string;
1203
+
1204
+ url: string;
1205
+
1206
+ type?: 'url_citation';
1207
+ }
1208
+
1209
+ /**
1210
+ * Container file citation annotation referencing a file within a container.
1211
+ */
1212
+ export interface OpenAIResponseAnnotationContainerFileCitation {
1213
+ container_id: string;
1214
+
1215
+ end_index: number;
1216
+
1217
+ file_id: string;
1218
+
1219
+ filename: string;
1220
+
1221
+ start_index: number;
1222
+
1223
+ type?: 'container_file_citation';
1224
+ }
1225
+
1226
+ /**
1227
+ * File path annotation referencing a generated file in response content.
1228
+ */
1229
+ export interface OpenAIResponseAnnotationFilePath {
1230
+ file_id: string;
1231
+
1232
+ index: number;
1233
+
1234
+ type?: 'file_path';
1235
+ }
1236
+
1237
+ /**
1238
+ * The log probability for a token from an OpenAI-compatible chat completion
1239
+ * response.
1240
+ */
1241
+ export interface Logprob {
1242
+ /**
1243
+ * The token.
1244
+ */
1245
+ token: string;
1246
+
1247
+ /**
1248
+ * The log probability of the token.
1249
+ */
1250
+ logprob: number;
1251
+
1252
+ /**
1253
+ * The bytes for the token.
1254
+ */
1255
+ bytes?: Array<number> | null;
1256
+
1257
+ /**
1258
+ * The top log probabilities for the token.
1259
+ */
1260
+ top_logprobs?: Array<Logprob.TopLogprob> | null;
1261
+ }
1262
+
1263
+ export namespace Logprob {
1264
+ /**
1265
+ * The top log probability for a token from an OpenAI-compatible chat completion
1266
+ * response.
1267
+ */
1268
+ export interface TopLogprob {
1269
+ /**
1270
+ * The token.
1271
+ */
1272
+ token: string;
1273
+
1274
+ /**
1275
+ * The log probability of the token.
1276
+ */
1277
+ logprob: number;
1278
+
1279
+ /**
1280
+ * The bytes for the token.
1281
+ */
1282
+ bytes?: Array<number> | null;
1283
+ }
1284
+ }
1285
+ }
1286
+
1287
+ /**
1288
+ * Refusal content within a streamed response part.
1289
+ */
1290
+ export interface OpenAIResponseContentPartRefusal {
1291
+ refusal: string;
1292
+
1293
+ type?: 'refusal';
1294
+ }
1295
+ }
1296
+
1297
+ /**
1298
+ * Web search tool call output message for OpenAI responses.
1299
+ */
1300
+ export interface OpenAIResponseOutputMessageWebSearchToolCall {
1301
+ id: string;
1302
+
1303
+ status: string;
1304
+
1305
+ type?: 'web_search_call';
1306
+ }
1307
+
1308
+ /**
1309
+ * File search tool call output message for OpenAI responses.
1310
+ */
1311
+ export interface OpenAIResponseOutputMessageFileSearchToolCall {
1312
+ id: string;
1313
+
1314
+ queries: Array<string>;
1315
+
1316
+ status: string;
1317
+
1318
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
1319
+
1320
+ type?: 'file_search_call';
1321
+ }
1322
+
1323
+ export namespace OpenAIResponseOutputMessageFileSearchToolCall {
1324
+ /**
1325
+ * Search results returned by the file search operation.
1326
+ */
1327
+ export interface Result {
1328
+ attributes: { [key: string]: unknown };
1329
+
1330
+ file_id: string;
1331
+
1332
+ filename: string;
1333
+
1334
+ score: number;
1335
+
1336
+ text: string;
1337
+ }
1338
+ }
1339
+
1340
+ /**
1341
+ * Function tool call output message for OpenAI responses.
1342
+ */
1343
+ export interface OpenAIResponseOutputMessageFunctionToolCall {
1344
+ arguments: string;
1345
+
1346
+ call_id: string;
1347
+
1348
+ name: string;
1349
+
1350
+ id?: string | null;
1351
+
1352
+ status?: string | null;
1353
+
1354
+ type?: 'function_call';
1355
+ }
1356
+
1357
+ /**
1358
+ * This represents the output of a function call that gets passed back to the
1359
+ * model.
1360
+ */
1361
+ export interface OpenAIResponseInputFunctionToolCallOutput {
1362
+ call_id: string;
1363
+
1364
+ output:
1365
+ | string
1366
+ | Array<
1367
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText
1368
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage
1369
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile
1370
+ >;
1371
+
1372
+ id?: string | null;
1373
+
1374
+ status?: string | null;
1375
+
1376
+ type?: 'function_call_output';
1377
+ }
1378
+
1379
+ export namespace OpenAIResponseInputFunctionToolCallOutput {
1380
+ /**
1381
+ * Text content for input messages in OpenAI response format.
1382
+ */
1383
+ export interface OpenAIResponseInputMessageContentText {
1384
+ text: string;
1385
+
1386
+ type?: 'input_text';
1387
+ }
1388
+
1389
+ /**
1390
+ * Image content for input messages in OpenAI response format.
1391
+ */
1392
+ export interface OpenAIResponseInputMessageContentImage {
1393
+ detail?: 'low' | 'high' | 'auto';
1394
+
1395
+ file_id?: string | null;
1396
+
1397
+ image_url?: string | null;
1398
+
1399
+ type?: 'input_image';
1400
+ }
1401
+
1402
+ /**
1403
+ * File content for input messages in OpenAI response format.
1404
+ */
1405
+ export interface OpenAIResponseInputMessageContentFile {
1406
+ file_data?: string | null;
1407
+
1408
+ file_id?: string | null;
1409
+
1410
+ file_url?: string | null;
1411
+
1412
+ filename?: string | null;
1413
+
1414
+ type?: 'input_file';
1415
+ }
1416
+ }
1417
+
1418
+ /**
1419
+ * A request for human approval of a tool invocation.
1420
+ */
1421
+ export interface OpenAIResponseMcpApprovalRequest {
1422
+ id: string;
1423
+
1424
+ arguments: string;
1425
+
1426
+ name: string;
1427
+
1428
+ server_label: string;
1429
+
1430
+ type?: 'mcp_approval_request';
1431
+ }
1432
+
1433
+ /**
1434
+ * A response to an MCP approval request.
1435
+ */
1436
+ export interface OpenAIResponseMcpApprovalResponse {
1437
+ approval_request_id: string;
1438
+
1439
+ approve: boolean;
1440
+
1441
+ id?: string | null;
1442
+
1443
+ reason?: string | null;
1444
+
1445
+ type?: 'mcp_approval_response';
1446
+ }
1447
+
1448
+ /**
1449
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
1450
+ */
1451
+ export interface OpenAIResponseOutputMessageMcpCall {
1452
+ id: string;
1453
+
1454
+ arguments: string;
1455
+
1456
+ name: string;
1457
+
1458
+ server_label: string;
1459
+
1460
+ error?: string | null;
1461
+
1462
+ output?: string | null;
1463
+
1464
+ type?: 'mcp_call';
1465
+ }
1466
+
1467
+ /**
1468
+ * MCP list tools output message containing available tools from an MCP server.
1469
+ */
1470
+ export interface OpenAIResponseOutputMessageMcpListTools {
1471
+ id: string;
1472
+
1473
+ server_label: string;
1474
+
1475
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
1476
+
1477
+ type?: 'mcp_list_tools';
1478
+ }
1479
+
1480
+ export namespace OpenAIResponseOutputMessageMcpListTools {
1481
+ /**
1482
+ * Tool definition returned by MCP list tools operation.
1483
+ */
1484
+ export interface Tool {
1485
+ input_schema: { [key: string]: unknown };
1486
+
1487
+ name: string;
1488
+
1489
+ description?: string | null;
1490
+ }
1491
+ }
1492
+
1493
+ /**
1494
+ * Reasoning output from the model, representing the model's thinking process.
1495
+ */
1496
+ export interface OpenAIResponseOutputMessageReasoningItem {
1497
+ /**
1498
+ * Unique identifier for the reasoning output item.
1499
+ */
1500
+ id: string;
1501
+
1502
+ /**
1503
+ * Summary of the reasoning output.
1504
+ */
1505
+ summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
1506
+
1507
+ /**
1508
+ * The reasoning content from the model.
1509
+ */
1510
+ content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
1511
+
1512
+ /**
1513
+ * The status of the reasoning output.
1514
+ */
1515
+ status?: 'in_progress' | 'completed' | 'incomplete' | null;
1516
+
1517
+ /**
1518
+ * The type identifier, always 'reasoning'.
1519
+ */
1520
+ type?: 'reasoning';
1521
+ }
1522
+
1523
+ export namespace OpenAIResponseOutputMessageReasoningItem {
1524
+ /**
1525
+ * A summary of reasoning output from the model.
1526
+ */
1527
+ export interface Summary {
1528
+ /**
1529
+ * The summary text of the reasoning output.
1530
+ */
1531
+ text: string;
1532
+
1533
+ /**
1534
+ * The type identifier, always 'summary_text'.
1535
+ */
1536
+ type?: 'summary_text';
1537
+ }
1538
+
1539
+ /**
1540
+ * Reasoning text from the model.
1541
+ */
1542
+ export interface Content {
1543
+ /**
1544
+ * The reasoning text content from the model.
1545
+ */
1546
+ text: string;
1547
+
1548
+ /**
1549
+ * The type identifier, always 'reasoning_text'.
1550
+ */
1551
+ type?: 'reasoning_text';
1552
+ }
1553
+ }
1554
+ }
1555
+
1556
+ export interface ItemCreateParams {
1557
+ /**
1558
+ * Items to include in the conversation context. You may add up to 20 items at a
1559
+ * time.
1560
+ */
1561
+ items: Array<
1562
+ | ItemCreateParams.OpenAIResponseMessageInput
1563
+ | ItemCreateParams.OpenAIResponseOutputMessageWebSearchToolCall
1564
+ | ItemCreateParams.OpenAIResponseOutputMessageFileSearchToolCall
1565
+ | ItemCreateParams.OpenAIResponseOutputMessageFunctionToolCall
1566
+ | ItemCreateParams.OpenAIResponseInputFunctionToolCallOutput
1567
+ | ItemCreateParams.OpenAIResponseMcpApprovalRequest
1568
+ | ItemCreateParams.OpenAIResponseMcpApprovalResponse
1569
+ | ItemCreateParams.OpenAIResponseOutputMessageMcpCall
1570
+ | ItemCreateParams.OpenAIResponseOutputMessageMcpListTools
1571
+ | ItemCreateParams.OpenAIResponseOutputMessageReasoningItem
1572
+ >;
1573
+ }
1574
+
1575
+ export namespace ItemCreateParams {
1576
+ /**
1577
+ * Corresponds to the various Message types in the Responses API. They are all
1578
+ * under one type because the Responses API gives them all the same "type" value,
1579
+ * and there is no way to tell them apart in certain scenarios.
1580
+ */
1581
+ export interface OpenAIResponseMessageInput {
1582
+ content:
1583
+ | string
1584
+ | Array<
1585
+ | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText
1586
+ | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage
1587
+ | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile
1588
+ >
1589
+ | Array<
1590
+ | OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput
1591
+ | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal
1592
+ >;
1593
+
1594
+ role: 'system' | 'developer' | 'user' | 'assistant';
1595
+
1596
+ id?: string | null;
1597
+
1598
+ status?: string | null;
1599
+
1600
+ type?: 'message';
1601
+ }
1602
+
1603
+ export namespace OpenAIResponseMessageInput {
1604
+ /**
1605
+ * Text content for input messages in OpenAI response format.
1606
+ */
1607
+ export interface OpenAIResponseInputMessageContentText {
1608
+ text: string;
1609
+
1610
+ type?: 'input_text';
1611
+ }
1612
+
1613
+ /**
1614
+ * Image content for input messages in OpenAI response format.
1615
+ */
1616
+ export interface OpenAIResponseInputMessageContentImage {
1617
+ detail?: 'low' | 'high' | 'auto';
1618
+
1619
+ file_id?: string | null;
1620
+
1621
+ image_url?: string | null;
1622
+
1623
+ type?: 'input_image';
1624
+ }
1625
+
1626
+ /**
1627
+ * File content for input messages in OpenAI response format.
1628
+ */
1629
+ export interface OpenAIResponseInputMessageContentFile {
1630
+ file_data?: string | null;
1631
+
1632
+ file_id?: string | null;
1633
+
1634
+ file_url?: string | null;
1635
+
1636
+ filename?: string | null;
1637
+
1638
+ type?: 'input_file';
1639
+ }
1640
+
1641
+ /**
1642
+ * Text content within an output message of an OpenAI response.
1643
+ */
1644
+ export interface OpenAIResponseOutputMessageContentOutputTextInput {
1645
+ text: string;
1646
+
1647
+ annotations?: Array<
1648
+ | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation
1649
+ | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation
1650
+ | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation
1651
+ | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath
1652
+ >;
1653
+
1654
+ logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
1655
+
1656
+ type?: 'output_text';
1657
+ }
1658
+
1659
+ export namespace OpenAIResponseOutputMessageContentOutputTextInput {
1660
+ /**
1661
+ * File citation annotation for referencing specific files in response content.
1662
+ */
1663
+ export interface OpenAIResponseAnnotationFileCitation {
1664
+ file_id: string;
1665
+
1666
+ filename: string;
1667
+
1668
+ index: number;
1669
+
1670
+ type?: 'file_citation';
1671
+ }
1672
+
1673
+ /**
1674
+ * URL citation annotation for referencing external web resources.
1675
+ */
1676
+ export interface OpenAIResponseAnnotationCitation {
1677
+ end_index: number;
1678
+
1679
+ start_index: number;
1680
+
1681
+ title: string;
1682
+
1683
+ url: string;
1684
+
1685
+ type?: 'url_citation';
1686
+ }
1687
+
1688
+ /**
1689
+ * Container file citation annotation referencing a file within a container.
1690
+ */
1691
+ export interface OpenAIResponseAnnotationContainerFileCitation {
1692
+ container_id: string;
1693
+
1694
+ end_index: number;
1695
+
1696
+ file_id: string;
1697
+
1698
+ filename: string;
1699
+
1700
+ start_index: number;
1701
+
1702
+ type?: 'container_file_citation';
1703
+ }
1704
+
1705
+ /**
1706
+ * File path annotation referencing a generated file in response content.
1707
+ */
1708
+ export interface OpenAIResponseAnnotationFilePath {
1709
+ file_id: string;
1710
+
1711
+ index: number;
1712
+
1713
+ type?: 'file_path';
1714
+ }
1715
+
1716
+ /**
1717
+ * The log probability for a token from an OpenAI-compatible chat completion
1718
+ * response.
1719
+ */
1720
+ export interface Logprob {
1721
+ /**
1722
+ * The token.
1723
+ */
1724
+ token: string;
1725
+
1726
+ /**
1727
+ * The log probability of the token.
1728
+ */
1729
+ logprob: number;
1730
+
1731
+ /**
1732
+ * The bytes for the token.
1733
+ */
1734
+ bytes?: Array<number> | null;
1735
+
1736
+ /**
1737
+ * The top log probabilities for the token.
1738
+ */
1739
+ top_logprobs?: Array<Logprob.TopLogprob> | null;
1740
+ }
1741
+
1742
+ export namespace Logprob {
1743
+ /**
1744
+ * The top log probability for a token from an OpenAI-compatible chat completion
1745
+ * response.
1746
+ */
1747
+ export interface TopLogprob {
1748
+ /**
1749
+ * The token.
1750
+ */
1751
+ token: string;
1752
+
1753
+ /**
1754
+ * The log probability of the token.
1755
+ */
1756
+ logprob: number;
1757
+
1758
+ /**
1759
+ * The bytes for the token.
1760
+ */
1761
+ bytes?: Array<number> | null;
1762
+ }
1763
+ }
1764
+ }
1765
+
1766
+ /**
1767
+ * Refusal content within a streamed response part.
1768
+ */
1769
+ export interface OpenAIResponseContentPartRefusal {
1770
+ refusal: string;
1771
+
1772
+ type?: 'refusal';
1773
+ }
1774
+ }
1775
+
1776
+ /**
1777
+ * Web search tool call output message for OpenAI responses.
1778
+ */
1779
+ export interface OpenAIResponseOutputMessageWebSearchToolCall {
1780
+ id: string;
1781
+
1782
+ status: string;
1783
+
1784
+ type?: 'web_search_call';
1785
+ }
1786
+
1787
+ /**
1788
+ * File search tool call output message for OpenAI responses.
1789
+ */
1790
+ export interface OpenAIResponseOutputMessageFileSearchToolCall {
1791
+ id: string;
1792
+
1793
+ queries: Array<string>;
1794
+
1795
+ status: string;
1796
+
1797
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
1798
+
1799
+ type?: 'file_search_call';
1800
+ }
1801
+
1802
+ export namespace OpenAIResponseOutputMessageFileSearchToolCall {
1803
+ /**
1804
+ * Search results returned by the file search operation.
1805
+ */
1806
+ export interface Result {
1807
+ attributes: { [key: string]: unknown };
1808
+
1809
+ file_id: string;
1810
+
1811
+ filename: string;
1812
+
1813
+ score: number;
1814
+
1815
+ text: string;
1816
+ }
1817
+ }
1818
+
1819
+ /**
1820
+ * Function tool call output message for OpenAI responses.
1821
+ */
1822
+ export interface OpenAIResponseOutputMessageFunctionToolCall {
1823
+ arguments: string;
1824
+
1825
+ call_id: string;
1826
+
1827
+ name: string;
1828
+
1829
+ id?: string | null;
1830
+
1831
+ status?: string | null;
1832
+
1833
+ type?: 'function_call';
1834
+ }
1835
+
1836
+ /**
1837
+ * This represents the output of a function call that gets passed back to the
1838
+ * model.
1839
+ */
1840
+ export interface OpenAIResponseInputFunctionToolCallOutput {
1841
+ call_id: string;
1842
+
1843
+ output:
1844
+ | string
1845
+ | Array<
1846
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentText
1847
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentImage
1848
+ | OpenAIResponseInputFunctionToolCallOutput.OpenAIResponseInputMessageContentFile
1849
+ >;
1850
+
1851
+ id?: string | null;
1852
+
1853
+ status?: string | null;
1854
+
1855
+ type?: 'function_call_output';
1856
+ }
1857
+
1858
+ export namespace OpenAIResponseInputFunctionToolCallOutput {
1859
+ /**
1860
+ * Text content for input messages in OpenAI response format.
1861
+ */
1862
+ export interface OpenAIResponseInputMessageContentText {
1863
+ text: string;
1864
+
1865
+ type?: 'input_text';
1866
+ }
1867
+
1868
+ /**
1869
+ * Image content for input messages in OpenAI response format.
1870
+ */
1871
+ export interface OpenAIResponseInputMessageContentImage {
1872
+ detail?: 'low' | 'high' | 'auto';
1873
+
1874
+ file_id?: string | null;
1875
+
1876
+ image_url?: string | null;
1877
+
1878
+ type?: 'input_image';
1879
+ }
1880
+
1881
+ /**
1882
+ * File content for input messages in OpenAI response format.
1883
+ */
1884
+ export interface OpenAIResponseInputMessageContentFile {
1885
+ file_data?: string | null;
1886
+
1887
+ file_id?: string | null;
1888
+
1889
+ file_url?: string | null;
1890
+
1891
+ filename?: string | null;
1892
+
1893
+ type?: 'input_file';
1894
+ }
1895
+ }
1896
+
1897
+ /**
1898
+ * A request for human approval of a tool invocation.
1899
+ */
1900
+ export interface OpenAIResponseMcpApprovalRequest {
1901
+ id: string;
1902
+
1903
+ arguments: string;
1904
+
1905
+ name: string;
1906
+
1907
+ server_label: string;
1908
+
1909
+ type?: 'mcp_approval_request';
1910
+ }
1911
+
1912
+ /**
1913
+ * A response to an MCP approval request.
1914
+ */
1915
+ export interface OpenAIResponseMcpApprovalResponse {
1916
+ approval_request_id: string;
1917
+
1918
+ approve: boolean;
1919
+
1920
+ id?: string | null;
1921
+
1922
+ reason?: string | null;
1923
+
1924
+ type?: 'mcp_approval_response';
1925
+ }
1926
+
1927
+ /**
1928
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
1929
+ */
1930
+ export interface OpenAIResponseOutputMessageMcpCall {
1931
+ id: string;
1932
+
1933
+ arguments: string;
1934
+
1935
+ name: string;
1936
+
1937
+ server_label: string;
1938
+
1939
+ error?: string | null;
1940
+
1941
+ output?: string | null;
1942
+
1943
+ type?: 'mcp_call';
1944
+ }
1945
+
1946
+ /**
1947
+ * MCP list tools output message containing available tools from an MCP server.
1948
+ */
1949
+ export interface OpenAIResponseOutputMessageMcpListTools {
1950
+ id: string;
1951
+
1952
+ server_label: string;
1953
+
1954
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
1955
+
1956
+ type?: 'mcp_list_tools';
1957
+ }
1958
+
1959
+ export namespace OpenAIResponseOutputMessageMcpListTools {
1960
+ /**
1961
+ * Tool definition returned by MCP list tools operation.
1962
+ */
1963
+ export interface Tool {
1964
+ input_schema: { [key: string]: unknown };
1965
+
1966
+ name: string;
1967
+
1968
+ description?: string | null;
1969
+ }
1970
+ }
1971
+
1972
+ /**
1973
+ * Reasoning output from the model, representing the model's thinking process.
1974
+ */
1975
+ export interface OpenAIResponseOutputMessageReasoningItem {
1976
+ /**
1977
+ * Unique identifier for the reasoning output item.
1978
+ */
1979
+ id: string;
1980
+
1981
+ /**
1982
+ * Summary of the reasoning output.
1983
+ */
1984
+ summary: Array<OpenAIResponseOutputMessageReasoningItem.Summary>;
1985
+
1986
+ /**
1987
+ * The reasoning content from the model.
1988
+ */
1989
+ content?: Array<OpenAIResponseOutputMessageReasoningItem.Content> | null;
1990
+
1991
+ /**
1992
+ * The status of the reasoning output.
1993
+ */
1994
+ status?: 'in_progress' | 'completed' | 'incomplete' | null;
1995
+
1996
+ /**
1997
+ * The type identifier, always 'reasoning'.
1998
+ */
1999
+ type?: 'reasoning';
2000
+ }
2001
+
2002
+ export namespace OpenAIResponseOutputMessageReasoningItem {
2003
+ /**
2004
+ * A summary of reasoning output from the model.
2005
+ */
2006
+ export interface Summary {
2007
+ /**
2008
+ * The summary text of the reasoning output.
2009
+ */
2010
+ text: string;
2011
+
2012
+ /**
2013
+ * The type identifier, always 'summary_text'.
2014
+ */
2015
+ type?: 'summary_text';
2016
+ }
2017
+
2018
+ /**
2019
+ * Reasoning text from the model.
2020
+ */
2021
+ export interface Content {
2022
+ /**
2023
+ * The reasoning text content from the model.
2024
+ */
2025
+ text: string;
2026
+
2027
+ /**
2028
+ * The type identifier, always 'reasoning_text'.
2029
+ */
2030
+ type?: 'reasoning_text';
2031
+ }
2032
+ }
2033
+ }
2034
+
2035
+ export interface ItemListParams extends OpenAICursorPageParams {
2036
+ include?: Array<
2037
+ | 'web_search_call.action.sources'
2038
+ | 'code_interpreter_call.outputs'
2039
+ | 'computer_call_output.output.image_url'
2040
+ | 'file_search_call.results'
2041
+ | 'message.input_image.image_url'
2042
+ | 'message.output_text.logprobs'
2043
+ | 'reasoning.encrypted_content'
2044
+ > | null;
2045
+
2046
+ order?: 'asc' | 'desc' | null;
2047
+ }
2048
+
2049
+ Items.ItemListResponsesOpenAICursorPage = ItemListResponsesOpenAICursorPage;
2050
+
2051
+ export declare namespace Items {
2052
+ export {
2053
+ type ItemCreateResponse as ItemCreateResponse,
2054
+ type ItemListResponse as ItemListResponse,
2055
+ type ItemDeleteResponse as ItemDeleteResponse,
2056
+ type ItemGetResponse as ItemGetResponse,
2057
+ ItemListResponsesOpenAICursorPage as ItemListResponsesOpenAICursorPage,
2058
+ type ItemCreateParams as ItemCreateParams,
2059
+ type ItemListParams as ItemListParams,
2060
+ };
2061
+ }