llama-stack-client 0.3.4-rc3 → 0.4.0-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 (573) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +19 -21
  3. package/error.d.ts.map +1 -1
  4. package/error.js +1 -0
  5. package/error.js.map +1 -1
  6. package/error.mjs.map +1 -1
  7. package/index.d.mts +23 -50
  8. package/index.d.ts +23 -50
  9. package/index.d.ts.map +1 -1
  10. package/index.js +20 -29
  11. package/index.js.map +1 -1
  12. package/index.mjs +18 -28
  13. package/index.mjs.map +1 -1
  14. package/lib/response-helpers.d.ts +23 -0
  15. package/lib/response-helpers.d.ts.map +1 -0
  16. package/lib/response-helpers.js +53 -0
  17. package/lib/response-helpers.js.map +1 -0
  18. package/lib/response-helpers.mjs +49 -0
  19. package/lib/response-helpers.mjs.map +1 -0
  20. package/package.json +1 -1
  21. package/pagination.d.ts.map +1 -1
  22. package/pagination.js +2 -4
  23. package/pagination.js.map +1 -1
  24. package/pagination.mjs +1 -4
  25. package/pagination.mjs.map +1 -1
  26. package/resource.d.ts.map +1 -1
  27. package/resource.js.map +1 -1
  28. package/resource.mjs.map +1 -1
  29. package/resources/alpha/alpha.d.ts +22 -0
  30. package/resources/alpha/alpha.d.ts.map +1 -0
  31. package/resources/alpha/alpha.js +57 -0
  32. package/resources/alpha/alpha.js.map +1 -0
  33. package/resources/alpha/alpha.mjs +30 -0
  34. package/resources/alpha/alpha.mjs.map +1 -0
  35. package/resources/{benchmarks.d.ts → alpha/benchmarks.d.ts} +25 -35
  36. package/resources/alpha/benchmarks.d.ts.map +1 -0
  37. package/resources/{benchmarks.js → alpha/benchmarks.js} +18 -4
  38. package/resources/alpha/benchmarks.js.map +1 -0
  39. package/resources/alpha/benchmarks.mjs +44 -0
  40. package/resources/alpha/benchmarks.mjs.map +1 -0
  41. package/resources/alpha/eval/eval.d.ts +160 -0
  42. package/resources/alpha/eval/eval.d.ts.map +1 -0
  43. package/resources/{eval → alpha/eval}/eval.js +7 -6
  44. package/resources/alpha/eval/eval.js.map +1 -0
  45. package/resources/{eval → alpha/eval}/eval.mjs +7 -5
  46. package/resources/alpha/eval/eval.mjs.map +1 -0
  47. package/resources/alpha/eval/index.d.ts +3 -0
  48. package/resources/alpha/eval/index.d.ts.map +1 -0
  49. package/resources/{eval → alpha/eval}/index.js +2 -1
  50. package/resources/alpha/eval/index.js.map +1 -0
  51. package/resources/{eval → alpha/eval}/index.mjs +2 -0
  52. package/resources/alpha/eval/index.mjs.map +1 -0
  53. package/resources/{eval → alpha/eval}/jobs.d.ts +2 -2
  54. package/resources/alpha/eval/jobs.d.ts.map +1 -0
  55. package/resources/{eval → alpha/eval}/jobs.js +6 -5
  56. package/resources/alpha/eval/jobs.js.map +1 -0
  57. package/resources/{eval → alpha/eval}/jobs.mjs +6 -4
  58. package/resources/alpha/eval/jobs.mjs.map +1 -0
  59. package/resources/alpha/eval.d.ts.map +1 -0
  60. package/resources/{eval.js → alpha/eval.js} +1 -0
  61. package/resources/alpha/eval.js.map +1 -0
  62. package/resources/alpha/eval.mjs.map +1 -0
  63. package/resources/alpha/index.d.ts +6 -0
  64. package/resources/alpha/index.d.ts.map +1 -0
  65. package/resources/alpha/index.js +21 -0
  66. package/resources/alpha/index.js.map +1 -0
  67. package/resources/alpha/index.mjs +13 -0
  68. package/resources/alpha/index.mjs.map +1 -0
  69. package/resources/alpha/inference.d.ts +85 -0
  70. package/resources/alpha/inference.d.ts.map +1 -0
  71. package/resources/{agents/steps.js → alpha/inference.js} +9 -8
  72. package/resources/alpha/inference.js.map +1 -0
  73. package/resources/alpha/inference.mjs +17 -0
  74. package/resources/alpha/inference.mjs.map +1 -0
  75. package/resources/alpha/post-training/index.d.ts +3 -0
  76. package/resources/alpha/post-training/index.d.ts.map +1 -0
  77. package/resources/{post-training → alpha/post-training}/index.js +2 -1
  78. package/resources/alpha/post-training/index.js.map +1 -0
  79. package/resources/{post-training → alpha/post-training}/index.mjs +2 -0
  80. package/resources/alpha/post-training/index.mjs.map +1 -0
  81. package/resources/alpha/post-training/job.d.ts +116 -0
  82. package/resources/alpha/post-training/job.d.ts.map +1 -0
  83. package/resources/{post-training → alpha/post-training}/job.js +7 -6
  84. package/resources/alpha/post-training/job.js.map +1 -0
  85. package/resources/{post-training → alpha/post-training}/job.mjs +7 -5
  86. package/resources/alpha/post-training/job.mjs.map +1 -0
  87. package/resources/alpha/post-training/post-training.d.ts +242 -0
  88. package/resources/alpha/post-training/post-training.d.ts.map +1 -0
  89. package/resources/{post-training → alpha/post-training}/post-training.js +5 -4
  90. package/resources/alpha/post-training/post-training.js.map +1 -0
  91. package/resources/{post-training → alpha/post-training}/post-training.mjs +5 -3
  92. package/resources/alpha/post-training/post-training.mjs.map +1 -0
  93. package/resources/alpha/post-training.d.ts.map +1 -0
  94. package/resources/{post-training.js → alpha/post-training.js} +2 -1
  95. package/resources/alpha/post-training.js.map +1 -0
  96. package/resources/{post-training.mjs → alpha/post-training.mjs} +2 -0
  97. package/resources/alpha/post-training.mjs.map +1 -0
  98. package/resources/alpha.d.ts +2 -0
  99. package/resources/alpha.d.ts.map +1 -0
  100. package/resources/alpha.js +25 -0
  101. package/resources/alpha.js.map +1 -0
  102. package/resources/alpha.mjs +9 -0
  103. package/resources/alpha.mjs.map +1 -0
  104. package/resources/batches.d.ts +322 -0
  105. package/resources/batches.d.ts.map +1 -0
  106. package/resources/batches.js +45 -0
  107. package/resources/batches.js.map +1 -0
  108. package/resources/batches.mjs +40 -0
  109. package/resources/batches.mjs.map +1 -0
  110. package/resources/beta/beta.d.ts +10 -0
  111. package/resources/beta/beta.d.ts.map +1 -0
  112. package/resources/{tool-runtime/tool-runtime.js → beta/beta.js} +10 -22
  113. package/resources/beta/beta.js.map +1 -0
  114. package/resources/beta/beta.mjs +18 -0
  115. package/resources/beta/beta.mjs.map +1 -0
  116. package/resources/beta/datasets.d.ts +257 -0
  117. package/resources/beta/datasets.d.ts.map +1 -0
  118. package/resources/{datasets.js → beta/datasets.js} +14 -9
  119. package/resources/beta/datasets.js.map +1 -0
  120. package/resources/{datasets.mjs → beta/datasets.mjs} +14 -8
  121. package/resources/beta/datasets.mjs.map +1 -0
  122. package/resources/beta/index.d.ts +3 -0
  123. package/resources/beta/index.d.ts.map +1 -0
  124. package/resources/beta/index.js +15 -0
  125. package/resources/beta/index.js.map +1 -0
  126. package/resources/beta/index.mjs +10 -0
  127. package/resources/beta/index.mjs.map +1 -0
  128. package/resources/beta.d.ts +2 -0
  129. package/resources/beta.d.ts.map +1 -0
  130. package/resources/{agents.js → beta.js} +4 -3
  131. package/resources/beta.js.map +1 -0
  132. package/resources/beta.mjs +9 -0
  133. package/resources/beta.mjs.map +1 -0
  134. package/resources/chat/chat.d.ts +73 -78
  135. package/resources/chat/chat.d.ts.map +1 -1
  136. package/resources/chat/chat.js +2 -2
  137. package/resources/chat/chat.js.map +1 -1
  138. package/resources/chat/chat.mjs +3 -2
  139. package/resources/chat/chat.mjs.map +1 -1
  140. package/resources/chat/completions.d.ts +756 -1402
  141. package/resources/chat/completions.d.ts.map +1 -1
  142. package/resources/chat/completions.js +8 -14
  143. package/resources/chat/completions.js.map +1 -1
  144. package/resources/chat/completions.mjs +7 -11
  145. package/resources/chat/completions.mjs.map +1 -1
  146. package/resources/chat/index.d.ts +1 -1
  147. package/resources/chat/index.d.ts.map +1 -1
  148. package/resources/chat/index.js +3 -3
  149. package/resources/chat/index.js.map +1 -1
  150. package/resources/chat/index.mjs +3 -1
  151. package/resources/chat/index.mjs.map +1 -1
  152. package/resources/chat.js +2 -1
  153. package/resources/chat.js.map +1 -1
  154. package/resources/chat.mjs +2 -0
  155. package/resources/chat.mjs.map +1 -1
  156. package/resources/completions.d.ts +52 -95
  157. package/resources/completions.d.ts.map +1 -1
  158. package/resources/completions.js +3 -6
  159. package/resources/completions.js.map +1 -1
  160. package/resources/completions.mjs +3 -5
  161. package/resources/completions.mjs.map +1 -1
  162. package/resources/conversations/conversations.d.ts +292 -0
  163. package/resources/conversations/conversations.d.ts.map +1 -0
  164. package/resources/conversations/conversations.js +78 -0
  165. package/resources/conversations/conversations.js.map +1 -0
  166. package/resources/conversations/conversations.mjs +51 -0
  167. package/resources/conversations/conversations.mjs.map +1 -0
  168. package/resources/conversations/index.d.ts +3 -0
  169. package/resources/conversations/index.d.ts.map +1 -0
  170. package/resources/conversations/index.js +16 -0
  171. package/resources/conversations/index.js.map +1 -0
  172. package/resources/conversations/index.mjs +10 -0
  173. package/resources/conversations/index.mjs.map +1 -0
  174. package/resources/conversations/items.d.ts +762 -0
  175. package/resources/conversations/items.d.ts.map +1 -0
  176. package/resources/conversations/items.js +51 -0
  177. package/resources/conversations/items.js.map +1 -0
  178. package/resources/conversations/items.mjs +46 -0
  179. package/resources/conversations/items.mjs.map +1 -0
  180. package/resources/conversations.d.ts +2 -0
  181. package/resources/conversations.d.ts.map +1 -0
  182. package/resources/conversations.js +25 -0
  183. package/resources/conversations.js.map +1 -0
  184. package/resources/conversations.mjs +9 -0
  185. package/resources/conversations.mjs.map +1 -0
  186. package/resources/embeddings.d.ts +10 -52
  187. package/resources/embeddings.d.ts.map +1 -1
  188. package/resources/embeddings.js +5 -2
  189. package/resources/embeddings.js.map +1 -1
  190. package/resources/embeddings.mjs +5 -1
  191. package/resources/embeddings.mjs.map +1 -1
  192. package/resources/files.d.ts +44 -54
  193. package/resources/files.d.ts.map +1 -1
  194. package/resources/files.js +18 -9
  195. package/resources/files.js.map +1 -1
  196. package/resources/files.mjs +18 -8
  197. package/resources/files.mjs.map +1 -1
  198. package/resources/index.d.ts +9 -13
  199. package/resources/index.d.ts.map +1 -1
  200. package/resources/index.js +15 -21
  201. package/resources/index.js.map +1 -1
  202. package/resources/index.mjs +9 -11
  203. package/resources/index.mjs.map +1 -1
  204. package/resources/inspect.d.ts +6 -32
  205. package/resources/inspect.d.ts.map +1 -1
  206. package/resources/inspect.js +6 -1
  207. package/resources/inspect.js.map +1 -1
  208. package/resources/inspect.mjs +6 -0
  209. package/resources/inspect.mjs.map +1 -1
  210. package/resources/models/index.d.ts +2 -2
  211. package/resources/models/index.d.ts.map +1 -1
  212. package/resources/models/index.js +2 -1
  213. package/resources/models/index.js.map +1 -1
  214. package/resources/models/index.mjs +2 -0
  215. package/resources/models/index.mjs.map +1 -1
  216. package/resources/models/models.d.ts +71 -31
  217. package/resources/models/models.d.ts.map +1 -1
  218. package/resources/models/models.js +13 -2
  219. package/resources/models/models.js.map +1 -1
  220. package/resources/models/models.mjs +13 -1
  221. package/resources/models/models.mjs.map +1 -1
  222. package/resources/models/openai.d.ts +2 -16
  223. package/resources/models/openai.d.ts.map +1 -1
  224. package/resources/models/openai.js +3 -2
  225. package/resources/models/openai.js.map +1 -1
  226. package/resources/models/openai.mjs +3 -1
  227. package/resources/models/openai.mjs.map +1 -1
  228. package/resources/models.js +2 -1
  229. package/resources/models.js.map +1 -1
  230. package/resources/models.mjs +2 -0
  231. package/resources/models.mjs.map +1 -1
  232. package/resources/moderations.d.ts +9 -35
  233. package/resources/moderations.d.ts.map +1 -1
  234. package/resources/moderations.js +5 -2
  235. package/resources/moderations.js.map +1 -1
  236. package/resources/moderations.mjs +5 -1
  237. package/resources/moderations.mjs.map +1 -1
  238. package/resources/prompts/index.d.ts +3 -0
  239. package/resources/prompts/index.d.ts.map +1 -0
  240. package/resources/prompts/index.js +15 -0
  241. package/resources/prompts/index.js.map +1 -0
  242. package/resources/prompts/index.mjs +10 -0
  243. package/resources/prompts/index.mjs.map +1 -0
  244. package/resources/prompts/prompts.d.ts +96 -0
  245. package/resources/prompts/prompts.d.ts.map +1 -0
  246. package/resources/{agents/agents.js → prompts/prompts.js} +43 -30
  247. package/resources/prompts/prompts.js.map +1 -0
  248. package/resources/prompts/prompts.mjs +66 -0
  249. package/resources/prompts/prompts.mjs.map +1 -0
  250. package/resources/prompts/versions.d.ts +12 -0
  251. package/resources/prompts/versions.d.ts.map +1 -0
  252. package/resources/prompts/versions.js +23 -0
  253. package/resources/prompts/versions.js.map +1 -0
  254. package/resources/prompts/versions.mjs +19 -0
  255. package/resources/prompts/versions.mjs.map +1 -0
  256. package/resources/prompts.d.ts +2 -0
  257. package/resources/prompts.d.ts.map +1 -0
  258. package/resources/prompts.js +25 -0
  259. package/resources/prompts.js.map +1 -0
  260. package/resources/prompts.mjs +9 -0
  261. package/resources/prompts.mjs.map +1 -0
  262. package/resources/providers.d.ts +4 -6
  263. package/resources/providers.d.ts.map +1 -1
  264. package/resources/providers.js +6 -1
  265. package/resources/providers.js.map +1 -1
  266. package/resources/providers.mjs +6 -0
  267. package/resources/providers.mjs.map +1 -1
  268. package/resources/responses/index.js +2 -1
  269. package/resources/responses/index.js.map +1 -1
  270. package/resources/responses/index.mjs +2 -0
  271. package/resources/responses/index.mjs.map +1 -1
  272. package/resources/responses/input-items.d.ts +190 -151
  273. package/resources/responses/input-items.d.ts.map +1 -1
  274. package/resources/responses/input-items.js +3 -2
  275. package/resources/responses/input-items.js.map +1 -1
  276. package/resources/responses/input-items.mjs +3 -1
  277. package/resources/responses/input-items.mjs.map +1 -1
  278. package/resources/responses/responses.d.ts +1387 -1449
  279. package/resources/responses/responses.d.ts.map +1 -1
  280. package/resources/responses/responses.js +8 -11
  281. package/resources/responses/responses.js.map +1 -1
  282. package/resources/responses/responses.mjs +8 -10
  283. package/resources/responses/responses.mjs.map +1 -1
  284. package/resources/responses.js +2 -1
  285. package/resources/responses.js.map +1 -1
  286. package/resources/responses.mjs +2 -0
  287. package/resources/responses.mjs.map +1 -1
  288. package/resources/routes.d.ts +7 -7
  289. package/resources/routes.d.ts.map +1 -1
  290. package/resources/routes.js +8 -6
  291. package/resources/routes.js.map +1 -1
  292. package/resources/routes.mjs +8 -5
  293. package/resources/routes.mjs.map +1 -1
  294. package/resources/safety.d.ts +144 -10
  295. package/resources/safety.d.ts.map +1 -1
  296. package/resources/safety.js +4 -1
  297. package/resources/safety.js.map +1 -1
  298. package/resources/safety.mjs +4 -0
  299. package/resources/safety.mjs.map +1 -1
  300. package/resources/scoring-functions.d.ts +120 -50
  301. package/resources/scoring-functions.d.ts.map +1 -1
  302. package/resources/scoring-functions.js +15 -1
  303. package/resources/scoring-functions.js.map +1 -1
  304. package/resources/scoring-functions.mjs +15 -0
  305. package/resources/scoring-functions.mjs.map +1 -1
  306. package/resources/scoring.d.ts +85 -26
  307. package/resources/scoring.d.ts.map +1 -1
  308. package/resources/scoring.js +2 -1
  309. package/resources/scoring.js.map +1 -1
  310. package/resources/scoring.mjs +2 -0
  311. package/resources/scoring.mjs.map +1 -1
  312. package/resources/shared.d.ts +125 -629
  313. package/resources/shared.d.ts.map +1 -1
  314. package/resources/shared.js +2 -0
  315. package/resources/shared.js.map +1 -1
  316. package/resources/shared.mjs +2 -0
  317. package/resources/shared.mjs.map +1 -1
  318. package/resources/shields.d.ts +19 -24
  319. package/resources/shields.d.ts.map +1 -1
  320. package/resources/shields.js +6 -1
  321. package/resources/shields.js.map +1 -1
  322. package/resources/shields.mjs +6 -0
  323. package/resources/shields.mjs.map +1 -1
  324. package/resources/tool-runtime.d.ts +151 -1
  325. package/resources/tool-runtime.d.ts.map +1 -1
  326. package/resources/tool-runtime.js +22 -16
  327. package/resources/tool-runtime.js.map +1 -1
  328. package/resources/tool-runtime.mjs +20 -1
  329. package/resources/tool-runtime.mjs.map +1 -1
  330. package/resources/toolgroups.d.ts +27 -37
  331. package/resources/toolgroups.d.ts.map +1 -1
  332. package/resources/toolgroups.js +10 -1
  333. package/resources/toolgroups.js.map +1 -1
  334. package/resources/toolgroups.mjs +10 -0
  335. package/resources/toolgroups.mjs.map +1 -1
  336. package/resources/tools.d.ts +9 -76
  337. package/resources/tools.d.ts.map +1 -1
  338. package/resources/tools.js +4 -1
  339. package/resources/tools.js.map +1 -1
  340. package/resources/tools.mjs +4 -0
  341. package/resources/tools.mjs.map +1 -1
  342. package/resources/vector-io.d.ts +272 -148
  343. package/resources/vector-io.d.ts.map +1 -1
  344. package/resources/vector-io.js +2 -1
  345. package/resources/vector-io.js.map +1 -1
  346. package/resources/vector-io.mjs +2 -0
  347. package/resources/vector-io.mjs.map +1 -1
  348. package/resources/vector-stores/file-batches.d.ts +111 -0
  349. package/resources/vector-stores/file-batches.d.ts.map +1 -0
  350. package/resources/vector-stores/file-batches.js +45 -0
  351. package/resources/vector-stores/file-batches.js.map +1 -0
  352. package/resources/vector-stores/file-batches.mjs +41 -0
  353. package/resources/vector-stores/file-batches.mjs.map +1 -0
  354. package/resources/vector-stores/files.d.ts +83 -135
  355. package/resources/vector-stores/files.d.ts.map +1 -1
  356. package/resources/vector-stores/files.js +15 -14
  357. package/resources/vector-stores/files.js.map +1 -1
  358. package/resources/vector-stores/files.mjs +15 -13
  359. package/resources/vector-stores/files.mjs.map +1 -1
  360. package/resources/vector-stores/index.d.ts +2 -1
  361. package/resources/vector-stores/index.d.ts.map +1 -1
  362. package/resources/vector-stores/index.js +5 -2
  363. package/resources/vector-stores/index.js.map +1 -1
  364. package/resources/vector-stores/index.mjs +3 -0
  365. package/resources/vector-stores/index.mjs.map +1 -1
  366. package/resources/vector-stores/vector-stores.d.ts +118 -217
  367. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  368. package/resources/vector-stores/vector-stores.js +18 -12
  369. package/resources/vector-stores/vector-stores.js.map +1 -1
  370. package/resources/vector-stores/vector-stores.mjs +18 -11
  371. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  372. package/resources/vector-stores.js +2 -1
  373. package/resources/vector-stores.js.map +1 -1
  374. package/resources/vector-stores.mjs +2 -0
  375. package/resources/vector-stores.mjs.map +1 -1
  376. package/src/error.ts +1 -0
  377. package/src/index.ts +82 -252
  378. package/src/lib/response-helpers.ts +60 -0
  379. package/src/pagination.ts +2 -5
  380. package/src/resource.ts +1 -0
  381. package/src/resources/alpha/alpha.ts +85 -0
  382. package/src/resources/{benchmarks.ts → alpha/benchmarks.ts} +36 -37
  383. package/src/resources/{eval → alpha/eval}/eval.ts +83 -65
  384. package/src/resources/{eval → alpha/eval}/index.ts +1 -2
  385. package/src/resources/{eval → alpha/eval}/jobs.ts +6 -6
  386. package/src/resources/{eval.ts → alpha/eval.ts} +1 -0
  387. package/src/resources/alpha/index.ts +34 -0
  388. package/src/resources/alpha/inference.ts +132 -0
  389. package/src/resources/{post-training → alpha/post-training}/index.ts +2 -2
  390. package/src/resources/alpha/post-training/job.ts +182 -0
  391. package/src/resources/alpha/post-training/post-training.ts +369 -0
  392. package/src/resources/{post-training.ts → alpha/post-training.ts} +1 -1
  393. package/src/resources/alpha.ts +9 -0
  394. package/src/resources/batches.ts +572 -0
  395. package/src/resources/beta/beta.ts +41 -0
  396. package/src/resources/beta/datasets.ts +350 -0
  397. package/src/resources/beta/index.ts +20 -0
  398. package/src/resources/{agents.ts → beta.ts} +2 -2
  399. package/src/resources/chat/chat.ts +82 -81
  400. package/src/resources/chat/completions.ts +874 -1484
  401. package/src/resources/chat/index.ts +1 -2
  402. package/src/resources/chat.ts +1 -1
  403. package/src/resources/completions.ts +57 -101
  404. package/src/resources/conversations/conversations.ts +455 -0
  405. package/src/resources/conversations/index.ts +25 -0
  406. package/src/resources/conversations/items.ts +1221 -0
  407. package/src/resources/conversations.ts +9 -0
  408. package/src/resources/embeddings.ts +14 -55
  409. package/src/resources/files.ts +54 -61
  410. package/src/resources/index.ts +33 -109
  411. package/src/resources/inspect.ts +7 -33
  412. package/src/resources/models/index.ts +4 -2
  413. package/src/resources/models/models.ts +79 -30
  414. package/src/resources/models/openai.ts +4 -24
  415. package/src/resources/models.ts +1 -1
  416. package/src/resources/moderations.ts +10 -36
  417. package/src/resources/prompts/index.ts +19 -0
  418. package/src/resources/prompts/prompts.ts +171 -0
  419. package/src/resources/prompts/versions.ts +26 -0
  420. package/src/resources/prompts.ts +9 -0
  421. package/src/resources/providers.ts +5 -7
  422. package/src/resources/responses/index.ts +1 -1
  423. package/src/resources/responses/input-items.ts +293 -161
  424. package/src/resources/responses/responses.ts +2112 -1632
  425. package/src/resources/responses.ts +1 -1
  426. package/src/resources/routes.ts +25 -10
  427. package/src/resources/safety.ts +199 -9
  428. package/src/resources/scoring-functions.ts +168 -52
  429. package/src/resources/scoring.ts +125 -22
  430. package/src/resources/shared.ts +141 -714
  431. package/src/resources/shields.ts +18 -23
  432. package/src/resources/tool-runtime.ts +210 -2
  433. package/src/resources/toolgroups.ts +26 -36
  434. package/src/resources/tools.ts +10 -94
  435. package/src/resources/vector-io.ts +323 -145
  436. package/src/resources/vector-stores/file-batches.ts +201 -0
  437. package/src/resources/vector-stores/files.ts +123 -143
  438. package/src/resources/vector-stores/index.ts +9 -1
  439. package/src/resources/vector-stores/vector-stores.ts +150 -216
  440. package/src/resources/vector-stores.ts +1 -1
  441. package/src/version.ts +1 -1
  442. package/version.d.ts +1 -1
  443. package/version.js +1 -1
  444. package/version.mjs +1 -1
  445. package/resources/agents/agents.d.ts +0 -246
  446. package/resources/agents/agents.d.ts.map +0 -1
  447. package/resources/agents/agents.js.map +0 -1
  448. package/resources/agents/agents.mjs +0 -52
  449. package/resources/agents/agents.mjs.map +0 -1
  450. package/resources/agents/index.d.ts +0 -5
  451. package/resources/agents/index.d.ts.map +0 -1
  452. package/resources/agents/index.js +0 -18
  453. package/resources/agents/index.js.map +0 -1
  454. package/resources/agents/index.mjs +0 -10
  455. package/resources/agents/index.mjs.map +0 -1
  456. package/resources/agents/session.d.ts +0 -98
  457. package/resources/agents/session.d.ts.map +0 -1
  458. package/resources/agents/session.js +0 -42
  459. package/resources/agents/session.js.map +0 -1
  460. package/resources/agents/session.mjs +0 -37
  461. package/resources/agents/session.mjs.map +0 -1
  462. package/resources/agents/steps.d.ts +0 -22
  463. package/resources/agents/steps.d.ts.map +0 -1
  464. package/resources/agents/steps.js.map +0 -1
  465. package/resources/agents/steps.mjs +0 -15
  466. package/resources/agents/steps.mjs.map +0 -1
  467. package/resources/agents/turn.d.ts +0 -461
  468. package/resources/agents/turn.d.ts.map +0 -1
  469. package/resources/agents/turn.js +0 -34
  470. package/resources/agents/turn.js.map +0 -1
  471. package/resources/agents/turn.mjs +0 -29
  472. package/resources/agents/turn.mjs.map +0 -1
  473. package/resources/agents.d.ts +0 -2
  474. package/resources/agents.d.ts.map +0 -1
  475. package/resources/agents.js.map +0 -1
  476. package/resources/agents.mjs +0 -7
  477. package/resources/agents.mjs.map +0 -1
  478. package/resources/benchmarks.d.ts.map +0 -1
  479. package/resources/benchmarks.js.map +0 -1
  480. package/resources/benchmarks.mjs +0 -31
  481. package/resources/benchmarks.mjs.map +0 -1
  482. package/resources/datasets.d.ts +0 -320
  483. package/resources/datasets.d.ts.map +0 -1
  484. package/resources/datasets.js.map +0 -1
  485. package/resources/datasets.mjs.map +0 -1
  486. package/resources/eval/eval.d.ts +0 -159
  487. package/resources/eval/eval.d.ts.map +0 -1
  488. package/resources/eval/eval.js.map +0 -1
  489. package/resources/eval/eval.mjs.map +0 -1
  490. package/resources/eval/index.d.ts +0 -3
  491. package/resources/eval/index.d.ts.map +0 -1
  492. package/resources/eval/index.js.map +0 -1
  493. package/resources/eval/index.mjs.map +0 -1
  494. package/resources/eval/jobs.d.ts.map +0 -1
  495. package/resources/eval/jobs.js.map +0 -1
  496. package/resources/eval/jobs.mjs.map +0 -1
  497. package/resources/eval.d.ts.map +0 -1
  498. package/resources/eval.js.map +0 -1
  499. package/resources/eval.mjs.map +0 -1
  500. package/resources/inference.d.ts +0 -580
  501. package/resources/inference.d.ts.map +0 -1
  502. package/resources/inference.js +0 -54
  503. package/resources/inference.js.map +0 -1
  504. package/resources/inference.mjs +0 -49
  505. package/resources/inference.mjs.map +0 -1
  506. package/resources/post-training/index.d.ts +0 -3
  507. package/resources/post-training/index.d.ts.map +0 -1
  508. package/resources/post-training/index.js.map +0 -1
  509. package/resources/post-training/index.mjs.map +0 -1
  510. package/resources/post-training/job.d.ts +0 -205
  511. package/resources/post-training/job.d.ts.map +0 -1
  512. package/resources/post-training/job.js.map +0 -1
  513. package/resources/post-training/job.mjs.map +0 -1
  514. package/resources/post-training/post-training.d.ts +0 -402
  515. package/resources/post-training/post-training.d.ts.map +0 -1
  516. package/resources/post-training/post-training.js.map +0 -1
  517. package/resources/post-training/post-training.mjs.map +0 -1
  518. package/resources/post-training.d.ts.map +0 -1
  519. package/resources/post-training.js.map +0 -1
  520. package/resources/post-training.mjs.map +0 -1
  521. package/resources/synthetic-data-generation.d.ts +0 -47
  522. package/resources/synthetic-data-generation.d.ts.map +0 -1
  523. package/resources/synthetic-data-generation.js +0 -20
  524. package/resources/synthetic-data-generation.js.map +0 -1
  525. package/resources/synthetic-data-generation.mjs +0 -15
  526. package/resources/synthetic-data-generation.mjs.map +0 -1
  527. package/resources/telemetry.d.ts +0 -519
  528. package/resources/telemetry.d.ts.map +0 -1
  529. package/resources/telemetry.js +0 -70
  530. package/resources/telemetry.js.map +0 -1
  531. package/resources/telemetry.mjs +0 -65
  532. package/resources/telemetry.mjs.map +0 -1
  533. package/resources/tool-runtime/index.d.ts +0 -3
  534. package/resources/tool-runtime/index.d.ts.map +0 -1
  535. package/resources/tool-runtime/index.js +0 -14
  536. package/resources/tool-runtime/index.js.map +0 -1
  537. package/resources/tool-runtime/index.mjs +0 -8
  538. package/resources/tool-runtime/index.mjs.map +0 -1
  539. package/resources/tool-runtime/rag-tool.d.ts +0 -45
  540. package/resources/tool-runtime/rag-tool.d.ts.map +0 -1
  541. package/resources/tool-runtime/rag-tool.js +0 -30
  542. package/resources/tool-runtime/rag-tool.js.map +0 -1
  543. package/resources/tool-runtime/rag-tool.mjs +0 -25
  544. package/resources/tool-runtime/rag-tool.mjs.map +0 -1
  545. package/resources/tool-runtime/tool-runtime.d.ts +0 -132
  546. package/resources/tool-runtime/tool-runtime.d.ts.map +0 -1
  547. package/resources/tool-runtime/tool-runtime.js.map +0 -1
  548. package/resources/tool-runtime/tool-runtime.mjs +0 -29
  549. package/resources/tool-runtime/tool-runtime.mjs.map +0 -1
  550. package/resources/vector-dbs.d.ts +0 -128
  551. package/resources/vector-dbs.d.ts.map +0 -1
  552. package/resources/vector-dbs.js +0 -41
  553. package/resources/vector-dbs.js.map +0 -1
  554. package/resources/vector-dbs.mjs +0 -36
  555. package/resources/vector-dbs.mjs.map +0 -1
  556. package/src/resources/agents/agents.ts +0 -372
  557. package/src/resources/agents/index.ts +0 -44
  558. package/src/resources/agents/session.ts +0 -169
  559. package/src/resources/agents/steps.ts +0 -47
  560. package/src/resources/agents/turn.ts +0 -638
  561. package/src/resources/datasets.ts +0 -413
  562. package/src/resources/inference.ts +0 -768
  563. package/src/resources/post-training/job.ts +0 -274
  564. package/src/resources/post-training/post-training.ts +0 -516
  565. package/src/resources/synthetic-data-generation.ts +0 -65
  566. package/src/resources/telemetry.ts +0 -692
  567. package/src/resources/tool-runtime/index.ts +0 -17
  568. package/src/resources/tool-runtime/rag-tool.ts +0 -69
  569. package/src/resources/tool-runtime/tool-runtime.ts +0 -191
  570. package/src/resources/vector-dbs.ts +0 -191
  571. /package/resources/{eval.d.ts → alpha/eval.d.ts} +0 -0
  572. /package/resources/{eval.mjs → alpha/eval.mjs} +0 -0
  573. /package/resources/{post-training.d.ts → alpha/post-training.d.ts} +0 -0
@@ -9,22 +9,22 @@ import { Stream } from "../../streaming.js";
9
9
  export declare class Responses extends APIResource {
10
10
  inputItems: InputItemsAPI.InputItems;
11
11
  /**
12
- * Create a new OpenAI response.
12
+ * Create a model response.
13
13
  */
14
14
  create(body: ResponseCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ResponseObject>;
15
15
  create(body: ResponseCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream>>;
16
16
  create(body: ResponseCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream> | ResponseObject>;
17
17
  /**
18
- * Retrieve an OpenAI response by its ID.
18
+ * Get a model response.
19
19
  */
20
20
  retrieve(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseObject>;
21
21
  /**
22
- * List all OpenAI responses.
22
+ * List all responses.
23
23
  */
24
24
  list(query?: ResponseListParams, options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
25
25
  list(options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
26
26
  /**
27
- * Delete an OpenAI response by its ID.
27
+ * Delete a response.
28
28
  */
29
29
  delete(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseDeleteResponse>;
30
30
  }
@@ -34,62 +34,39 @@ export declare class ResponseListResponsesOpenAICursorPage extends OpenAICursorP
34
34
  * Complete OpenAI response object containing generation results and metadata.
35
35
  */
36
36
  export interface ResponseObject {
37
- /**
38
- * Unique identifier for this response
39
- */
40
37
  id: string;
41
- /**
42
- * Unix timestamp when the response was created
43
- */
44
38
  created_at: number;
45
- /**
46
- * Model identifier used for generation
47
- */
48
39
  model: string;
49
- /**
50
- * Object type identifier, always "response"
51
- */
52
- object: 'response';
53
- /**
54
- * List of generated output items (messages, tool calls, etc.)
55
- */
56
- output: Array<ResponseObject.OpenAIResponseMessage | ResponseObject.OpenAIResponseOutputMessageWebSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFileSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFunctionToolCall | ResponseObject.OpenAIResponseOutputMessageMcpCall | ResponseObject.OpenAIResponseOutputMessageMcpListTools>;
57
- /**
58
- * Whether tool calls can be executed in parallel
59
- */
60
- parallel_tool_calls: boolean;
61
- /**
62
- * Current status of the response generation
63
- */
40
+ output: Array<ResponseObject.OpenAIResponseMessageOutput | ResponseObject.OpenAIResponseOutputMessageWebSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFileSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFunctionToolCall | ResponseObject.OpenAIResponseOutputMessageMcpCall | ResponseObject.OpenAIResponseOutputMessageMcpListTools | ResponseObject.OpenAIResponseMcpApprovalRequest>;
64
41
  status: string;
65
42
  /**
66
- * Text formatting configuration for the response
67
- */
68
- text: ResponseObject.Text;
69
- /**
70
- * (Optional) Error details if the response generation failed
43
+ * Error details for failed OpenAI response requests.
71
44
  */
72
- error?: ResponseObject.Error;
45
+ error?: ResponseObject.Error | null;
46
+ instructions?: string | null;
47
+ max_tool_calls?: number | null;
48
+ metadata?: {
49
+ [key: string]: string;
50
+ } | null;
51
+ object?: 'response';
52
+ parallel_tool_calls?: boolean | null;
53
+ previous_response_id?: string | null;
73
54
  /**
74
- * (Optional) ID of the previous response in a conversation
55
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
75
56
  */
76
- previous_response_id?: string;
57
+ prompt?: ResponseObject.Prompt | null;
58
+ temperature?: number | null;
77
59
  /**
78
- * (Optional) Sampling temperature used for generation
79
- */
80
- temperature?: number;
81
- /**
82
- * (Optional) Nucleus sampling parameter used for generation
83
- */
84
- top_p?: number;
85
- /**
86
- * (Optional) Truncation strategy applied to the response
60
+ * Text response configuration for OpenAI responses.
87
61
  */
88
- truncation?: string;
62
+ text?: ResponseObject.Text;
63
+ tools?: Array<ResponseObject.OpenAIResponseInputToolWebSearch | ResponseObject.OpenAIResponseInputToolFileSearch | ResponseObject.OpenAIResponseInputToolFunction | ResponseObject.OpenAIResponseToolMcp> | null;
64
+ top_p?: number | null;
65
+ truncation?: string | null;
89
66
  /**
90
- * (Optional) User identifier associated with the request
67
+ * Usage information for OpenAI response.
91
68
  */
92
- user?: string;
69
+ usage?: ResponseObject.Usage | null;
93
70
  }
94
71
  export declare namespace ResponseObject {
95
72
  /**
@@ -97,95 +74,64 @@ export declare namespace ResponseObject {
97
74
  * under one type because the Responses API gives them all the same "type" value,
98
75
  * and there is no way to tell them apart in certain scenarios.
99
76
  */
100
- interface OpenAIResponseMessage {
101
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
77
+ interface OpenAIResponseMessageOutput {
78
+ content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
102
79
  role: 'system' | 'developer' | 'user' | 'assistant';
103
- type: 'message';
104
- id?: string;
105
- status?: string;
80
+ id?: string | null;
81
+ status?: string | null;
82
+ type?: 'message';
106
83
  }
107
- namespace OpenAIResponseMessage {
84
+ namespace OpenAIResponseMessageOutput {
108
85
  /**
109
86
  * Text content for input messages in OpenAI response format.
110
87
  */
111
88
  interface OpenAIResponseInputMessageContentText {
112
- /**
113
- * The text content of the input message
114
- */
115
89
  text: string;
116
- /**
117
- * Content type identifier, always "input_text"
118
- */
119
- type: 'input_text';
90
+ type?: 'input_text';
120
91
  }
121
92
  /**
122
93
  * Image content for input messages in OpenAI response format.
123
94
  */
124
95
  interface OpenAIResponseInputMessageContentImage {
125
- /**
126
- * Level of detail for image processing, can be "low", "high", or "auto"
127
- */
128
- detail: 'low' | 'high' | 'auto';
129
- /**
130
- * Content type identifier, always "input_image"
131
- */
132
- type: 'input_image';
133
- /**
134
- * (Optional) URL of the image content
135
- */
136
- image_url?: string;
96
+ detail?: 'low' | 'high' | 'auto';
97
+ file_id?: string | null;
98
+ image_url?: string | null;
99
+ type?: 'input_image';
100
+ }
101
+ /**
102
+ * File content for input messages in OpenAI response format.
103
+ */
104
+ interface OpenAIResponseInputMessageContentFile {
105
+ file_data?: string | null;
106
+ file_id?: string | null;
107
+ file_url?: string | null;
108
+ filename?: string | null;
109
+ type?: 'input_file';
137
110
  }
138
- interface UnionMember2 {
139
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
111
+ interface OpenAIResponseOutputMessageContentOutputText {
140
112
  text: string;
141
- type: 'output_text';
113
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
114
+ type?: 'output_text';
142
115
  }
143
- namespace UnionMember2 {
116
+ namespace OpenAIResponseOutputMessageContentOutputText {
144
117
  /**
145
118
  * File citation annotation for referencing specific files in response content.
146
119
  */
147
120
  interface OpenAIResponseAnnotationFileCitation {
148
- /**
149
- * Unique identifier of the referenced file
150
- */
151
121
  file_id: string;
152
- /**
153
- * Name of the referenced file
154
- */
155
122
  filename: string;
156
- /**
157
- * Position index of the citation within the content
158
- */
159
123
  index: number;
160
- /**
161
- * Annotation type identifier, always "file_citation"
162
- */
163
- type: 'file_citation';
124
+ type?: 'file_citation';
164
125
  }
165
126
  /**
166
127
  * URL citation annotation for referencing external web resources.
167
128
  */
168
129
  interface OpenAIResponseAnnotationCitation {
169
- /**
170
- * End position of the citation span in the content
171
- */
172
130
  end_index: number;
173
- /**
174
- * Start position of the citation span in the content
175
- */
176
131
  start_index: number;
177
- /**
178
- * Title of the referenced web resource
179
- */
180
132
  title: string;
181
- /**
182
- * Annotation type identifier, always "url_citation"
183
- */
184
- type: 'url_citation';
185
- /**
186
- * URL of the referenced web resource
187
- */
188
133
  url: string;
134
+ type?: 'url_citation';
189
135
  }
190
136
  interface OpenAIResponseAnnotationContainerFileCitation {
191
137
  container_id: string;
@@ -193,83 +139,51 @@ export declare namespace ResponseObject {
193
139
  file_id: string;
194
140
  filename: string;
195
141
  start_index: number;
196
- type: 'container_file_citation';
142
+ type?: 'container_file_citation';
197
143
  }
198
144
  interface OpenAIResponseAnnotationFilePath {
199
145
  file_id: string;
200
146
  index: number;
201
- type: 'file_path';
147
+ type?: 'file_path';
202
148
  }
203
149
  }
150
+ /**
151
+ * Refusal content within a streamed response part.
152
+ */
153
+ interface OpenAIResponseContentPartRefusal {
154
+ refusal: string;
155
+ type?: 'refusal';
156
+ }
204
157
  }
205
158
  /**
206
159
  * Web search tool call output message for OpenAI responses.
207
160
  */
208
161
  interface OpenAIResponseOutputMessageWebSearchToolCall {
209
- /**
210
- * Unique identifier for this tool call
211
- */
212
162
  id: string;
213
- /**
214
- * Current status of the web search operation
215
- */
216
163
  status: string;
217
- /**
218
- * Tool call type identifier, always "web_search_call"
219
- */
220
- type: 'web_search_call';
164
+ type?: 'web_search_call';
221
165
  }
222
166
  /**
223
167
  * File search tool call output message for OpenAI responses.
224
168
  */
225
169
  interface OpenAIResponseOutputMessageFileSearchToolCall {
226
- /**
227
- * Unique identifier for this tool call
228
- */
229
170
  id: string;
230
- /**
231
- * List of search queries executed
232
- */
233
171
  queries: Array<string>;
234
- /**
235
- * Current status of the file search operation
236
- */
237
172
  status: string;
238
- /**
239
- * Tool call type identifier, always "file_search_call"
240
- */
241
- type: 'file_search_call';
242
- /**
243
- * (Optional) Search results returned by the file search operation
244
- */
245
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
173
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
174
+ type?: 'file_search_call';
246
175
  }
247
176
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
248
177
  /**
249
178
  * Search results returned by the file search operation.
250
179
  */
251
180
  interface Result {
252
- /**
253
- * (Optional) Key-value attributes associated with the file
254
- */
255
181
  attributes: {
256
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
182
+ [key: string]: unknown;
257
183
  };
258
- /**
259
- * Unique identifier of the file containing the result
260
- */
261
184
  file_id: string;
262
- /**
263
- * Name of the file containing the result
264
- */
265
185
  filename: string;
266
- /**
267
- * Relevance score for this search result (between 0 and 1)
268
- */
269
186
  score: number;
270
- /**
271
- * Text content of the search result
272
- */
273
187
  text: string;
274
188
  }
275
189
  }
@@ -277,202 +191,257 @@ export declare namespace ResponseObject {
277
191
  * Function tool call output message for OpenAI responses.
278
192
  */
279
193
  interface OpenAIResponseOutputMessageFunctionToolCall {
280
- /**
281
- * JSON string containing the function arguments
282
- */
283
194
  arguments: string;
284
- /**
285
- * Unique identifier for the function call
286
- */
287
195
  call_id: string;
288
- /**
289
- * Name of the function being called
290
- */
291
196
  name: string;
292
- /**
293
- * Tool call type identifier, always "function_call"
294
- */
295
- type: 'function_call';
296
- /**
297
- * (Optional) Additional identifier for the tool call
298
- */
299
- id?: string;
300
- /**
301
- * (Optional) Current status of the function call execution
302
- */
303
- status?: string;
197
+ id?: string | null;
198
+ status?: string | null;
199
+ type?: 'function_call';
304
200
  }
305
201
  /**
306
202
  * Model Context Protocol (MCP) call output message for OpenAI responses.
307
203
  */
308
204
  interface OpenAIResponseOutputMessageMcpCall {
309
- /**
310
- * Unique identifier for this MCP call
311
- */
312
205
  id: string;
313
- /**
314
- * JSON string containing the MCP call arguments
315
- */
316
206
  arguments: string;
317
- /**
318
- * Name of the MCP method being called
319
- */
320
207
  name: string;
321
- /**
322
- * Label identifying the MCP server handling the call
323
- */
324
208
  server_label: string;
325
- /**
326
- * Tool call type identifier, always "mcp_call"
327
- */
328
- type: 'mcp_call';
329
- /**
330
- * (Optional) Error message if the MCP call failed
331
- */
332
- error?: string;
333
- /**
334
- * (Optional) Output result from the successful MCP call
335
- */
336
- output?: string;
209
+ error?: string | null;
210
+ output?: string | null;
211
+ type?: 'mcp_call';
337
212
  }
338
213
  /**
339
214
  * MCP list tools output message containing available tools from an MCP server.
340
215
  */
341
216
  interface OpenAIResponseOutputMessageMcpListTools {
342
- /**
343
- * Unique identifier for this MCP list tools operation
344
- */
345
217
  id: string;
346
- /**
347
- * Label identifying the MCP server providing the tools
348
- */
349
218
  server_label: string;
350
- /**
351
- * List of available tools provided by the MCP server
352
- */
353
219
  tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
354
- /**
355
- * Tool call type identifier, always "mcp_list_tools"
356
- */
357
- type: 'mcp_list_tools';
220
+ type?: 'mcp_list_tools';
358
221
  }
359
222
  namespace OpenAIResponseOutputMessageMcpListTools {
360
223
  /**
361
224
  * Tool definition returned by MCP list tools operation.
362
225
  */
363
226
  interface Tool {
364
- /**
365
- * JSON schema defining the tool's input parameters
366
- */
367
227
  input_schema: {
368
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
228
+ [key: string]: unknown;
369
229
  };
370
- /**
371
- * Name of the tool
372
- */
373
230
  name: string;
374
- /**
375
- * (Optional) Description of what the tool does
376
- */
377
- description?: string;
231
+ description?: string | null;
232
+ }
233
+ }
234
+ /**
235
+ * A request for human approval of a tool invocation.
236
+ */
237
+ interface OpenAIResponseMcpApprovalRequest {
238
+ id: string;
239
+ arguments: string;
240
+ name: string;
241
+ server_label: string;
242
+ type?: 'mcp_approval_request';
243
+ }
244
+ /**
245
+ * Error details for failed OpenAI response requests.
246
+ */
247
+ interface Error {
248
+ code: string;
249
+ message: string;
250
+ }
251
+ /**
252
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
253
+ */
254
+ interface Prompt {
255
+ id: string;
256
+ variables?: {
257
+ [key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
258
+ } | null;
259
+ version?: string | null;
260
+ }
261
+ namespace Prompt {
262
+ /**
263
+ * Text content for input messages in OpenAI response format.
264
+ */
265
+ interface OpenAIResponseInputMessageContentText {
266
+ text: string;
267
+ type?: 'input_text';
268
+ }
269
+ /**
270
+ * Image content for input messages in OpenAI response format.
271
+ */
272
+ interface OpenAIResponseInputMessageContentImage {
273
+ detail?: 'low' | 'high' | 'auto';
274
+ file_id?: string | null;
275
+ image_url?: string | null;
276
+ type?: 'input_image';
277
+ }
278
+ /**
279
+ * File content for input messages in OpenAI response format.
280
+ */
281
+ interface OpenAIResponseInputMessageContentFile {
282
+ file_data?: string | null;
283
+ file_id?: string | null;
284
+ file_url?: string | null;
285
+ filename?: string | null;
286
+ type?: 'input_file';
378
287
  }
379
288
  }
380
289
  /**
381
- * Text formatting configuration for the response
290
+ * Text response configuration for OpenAI responses.
382
291
  */
383
292
  interface Text {
384
293
  /**
385
- * (Optional) Text format configuration specifying output format requirements
294
+ * Configuration for Responses API text format.
386
295
  */
387
- format?: Text.Format;
296
+ format?: Text.Format | null;
388
297
  }
389
298
  namespace Text {
390
299
  /**
391
- * (Optional) Text format configuration specifying output format requirements
300
+ * Configuration for Responses API text format.
392
301
  */
393
302
  interface Format {
394
- /**
395
- * Must be "text", "json_schema", or "json_object" to identify the format type
396
- */
397
- type: 'text' | 'json_schema' | 'json_object';
398
- /**
399
- * (Optional) A description of the response format. Only used for json_schema.
400
- */
401
- description?: string;
402
- /**
403
- * The name of the response format. Only used for json_schema.
404
- */
405
- name?: string;
406
- /**
407
- * The JSON schema the response should conform to. In a Python SDK, this is often a
408
- * `pydantic` model. Only used for json_schema.
409
- */
303
+ description?: string | null;
304
+ name?: string | null;
410
305
  schema?: {
411
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
412
- };
413
- /**
414
- * (Optional) Whether to strictly enforce the JSON schema. If true, the response
415
- * must match the schema exactly. Only used for json_schema.
416
- */
417
- strict?: boolean;
306
+ [key: string]: unknown;
307
+ } | null;
308
+ strict?: boolean | null;
309
+ type?: 'text' | 'json_schema' | 'json_object';
418
310
  }
419
311
  }
420
312
  /**
421
- * (Optional) Error details if the response generation failed
313
+ * Web search tool configuration for OpenAI response inputs.
314
+ */
315
+ interface OpenAIResponseInputToolWebSearch {
316
+ search_context_size?: string | null;
317
+ type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
318
+ }
319
+ /**
320
+ * File search tool configuration for OpenAI response inputs.
422
321
  */
423
- interface Error {
322
+ interface OpenAIResponseInputToolFileSearch {
323
+ vector_store_ids: Array<string>;
324
+ filters?: {
325
+ [key: string]: unknown;
326
+ } | null;
327
+ max_num_results?: number | null;
424
328
  /**
425
- * Error code identifying the type of failure
329
+ * Options for ranking and filtering search results.
426
330
  */
427
- code: string;
331
+ ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
332
+ type?: 'file_search';
333
+ }
334
+ namespace OpenAIResponseInputToolFileSearch {
428
335
  /**
429
- * Human-readable error message describing the failure
336
+ * Options for ranking and filtering search results.
430
337
  */
431
- message: string;
338
+ interface RankingOptions {
339
+ ranker?: string | null;
340
+ score_threshold?: number | null;
341
+ }
342
+ }
343
+ /**
344
+ * Function tool configuration for OpenAI response inputs.
345
+ */
346
+ interface OpenAIResponseInputToolFunction {
347
+ name: string;
348
+ parameters: {
349
+ [key: string]: unknown;
350
+ } | null;
351
+ description?: string | null;
352
+ strict?: boolean | null;
353
+ type?: 'function';
354
+ }
355
+ /**
356
+ * Model Context Protocol (MCP) tool configuration for OpenAI response object.
357
+ */
358
+ interface OpenAIResponseToolMcp {
359
+ server_label: string;
360
+ /**
361
+ * Filter configuration for restricting which MCP tools can be used.
362
+ */
363
+ allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
364
+ type?: 'mcp';
365
+ }
366
+ namespace OpenAIResponseToolMcp {
367
+ /**
368
+ * Filter configuration for restricting which MCP tools can be used.
369
+ */
370
+ interface AllowedToolsFilter {
371
+ tool_names?: Array<string> | null;
372
+ }
373
+ }
374
+ /**
375
+ * Usage information for OpenAI response.
376
+ */
377
+ interface Usage {
378
+ input_tokens: number;
379
+ output_tokens: number;
380
+ total_tokens: number;
381
+ /**
382
+ * Token details for input tokens in OpenAI response usage.
383
+ */
384
+ input_tokens_details?: Usage.InputTokensDetails | null;
385
+ /**
386
+ * Token details for output tokens in OpenAI response usage.
387
+ */
388
+ output_tokens_details?: Usage.OutputTokensDetails | null;
389
+ }
390
+ namespace Usage {
391
+ /**
392
+ * Token details for input tokens in OpenAI response usage.
393
+ */
394
+ interface InputTokensDetails {
395
+ cached_tokens?: number | null;
396
+ }
397
+ /**
398
+ * Token details for output tokens in OpenAI response usage.
399
+ */
400
+ interface OutputTokensDetails {
401
+ reasoning_tokens?: number | null;
402
+ }
432
403
  }
433
404
  }
434
405
  /**
435
406
  * Streaming event indicating a new response has been created.
436
407
  */
437
- export type ResponseObjectStream = ResponseObjectStream.OpenAIResponseObjectStreamResponseCreated | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseCompleted;
408
+ export type ResponseObjectStream = ResponseObjectStream.OpenAIResponseObjectStreamResponseCreated | ResponseObjectStream.OpenAIResponseObjectStreamResponseInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseIncomplete | ResponseObjectStream.OpenAIResponseObjectStreamResponseFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseCompleted;
438
409
  export declare namespace ResponseObjectStream {
439
410
  /**
440
411
  * Streaming event indicating a new response has been created.
441
412
  */
442
413
  interface OpenAIResponseObjectStreamResponseCreated {
443
414
  /**
444
- * The newly created response object
415
+ * Complete OpenAI response object containing generation results and metadata.
445
416
  */
446
417
  response: ResponsesAPI.ResponseObject;
418
+ type?: 'response.created';
419
+ }
420
+ /**
421
+ * Streaming event indicating the response remains in progress.
422
+ */
423
+ interface OpenAIResponseObjectStreamResponseInProgress {
447
424
  /**
448
- * Event type identifier, always "response.created"
425
+ * Complete OpenAI response object containing generation results and metadata.
449
426
  */
450
- type: 'response.created';
427
+ response: ResponsesAPI.ResponseObject;
428
+ sequence_number: number;
429
+ type?: 'response.in_progress';
451
430
  }
452
431
  /**
453
432
  * Streaming event for when a new output item is added to the response.
454
433
  */
455
434
  interface OpenAIResponseObjectStreamResponseOutputItemAdded {
456
435
  /**
457
- * The output item that was added (message, tool call, etc.)
458
- */
459
- item: OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpListTools;
460
- /**
461
- * Index position of this item in the output list
436
+ * Corresponds to the various Message types in the Responses API. They are all
437
+ * under one type because the Responses API gives them all the same "type" value,
438
+ * and there is no way to tell them apart in certain scenarios.
462
439
  */
440
+ item: OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMcpApprovalRequest;
463
441
  output_index: number;
464
- /**
465
- * Unique identifier of the response containing this output
466
- */
467
442
  response_id: string;
468
- /**
469
- * Sequential number for ordering streaming events
470
- */
471
443
  sequence_number: number;
472
- /**
473
- * Event type identifier, always "response.output_item.added"
474
- */
475
- type: 'response.output_item.added';
444
+ type?: 'response.output_item.added';
476
445
  }
477
446
  namespace OpenAIResponseObjectStreamResponseOutputItemAdded {
478
447
  /**
@@ -481,94 +450,63 @@ export declare namespace ResponseObjectStream {
481
450
  * and there is no way to tell them apart in certain scenarios.
482
451
  */
483
452
  interface OpenAIResponseMessage {
484
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
453
+ content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage | OpenAIResponseMessage.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessage.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessage.OpenAIResponseContentPartRefusal>;
485
454
  role: 'system' | 'developer' | 'user' | 'assistant';
486
- type: 'message';
487
- id?: string;
488
- status?: string;
455
+ id?: string | null;
456
+ status?: string | null;
457
+ type?: 'message';
489
458
  }
490
459
  namespace OpenAIResponseMessage {
491
460
  /**
492
461
  * Text content for input messages in OpenAI response format.
493
462
  */
494
463
  interface OpenAIResponseInputMessageContentText {
495
- /**
496
- * The text content of the input message
497
- */
498
464
  text: string;
499
- /**
500
- * Content type identifier, always "input_text"
501
- */
502
- type: 'input_text';
465
+ type?: 'input_text';
503
466
  }
504
467
  /**
505
468
  * Image content for input messages in OpenAI response format.
506
469
  */
507
470
  interface OpenAIResponseInputMessageContentImage {
508
- /**
509
- * Level of detail for image processing, can be "low", "high", or "auto"
510
- */
511
- detail: 'low' | 'high' | 'auto';
512
- /**
513
- * Content type identifier, always "input_image"
514
- */
515
- type: 'input_image';
516
- /**
517
- * (Optional) URL of the image content
518
- */
519
- image_url?: string;
471
+ detail?: 'low' | 'high' | 'auto';
472
+ file_id?: string | null;
473
+ image_url?: string | null;
474
+ type?: 'input_image';
475
+ }
476
+ /**
477
+ * File content for input messages in OpenAI response format.
478
+ */
479
+ interface OpenAIResponseInputMessageContentFile {
480
+ file_data?: string | null;
481
+ file_id?: string | null;
482
+ file_url?: string | null;
483
+ filename?: string | null;
484
+ type?: 'input_file';
520
485
  }
521
- interface UnionMember2 {
522
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
486
+ interface OpenAIResponseOutputMessageContentOutputText {
523
487
  text: string;
524
- type: 'output_text';
488
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
489
+ type?: 'output_text';
525
490
  }
526
- namespace UnionMember2 {
491
+ namespace OpenAIResponseOutputMessageContentOutputText {
527
492
  /**
528
493
  * File citation annotation for referencing specific files in response content.
529
494
  */
530
495
  interface OpenAIResponseAnnotationFileCitation {
531
- /**
532
- * Unique identifier of the referenced file
533
- */
534
496
  file_id: string;
535
- /**
536
- * Name of the referenced file
537
- */
538
497
  filename: string;
539
- /**
540
- * Position index of the citation within the content
541
- */
542
498
  index: number;
543
- /**
544
- * Annotation type identifier, always "file_citation"
545
- */
546
- type: 'file_citation';
499
+ type?: 'file_citation';
547
500
  }
548
501
  /**
549
502
  * URL citation annotation for referencing external web resources.
550
503
  */
551
504
  interface OpenAIResponseAnnotationCitation {
552
- /**
553
- * End position of the citation span in the content
554
- */
555
505
  end_index: number;
556
- /**
557
- * Start position of the citation span in the content
558
- */
559
506
  start_index: number;
560
- /**
561
- * Title of the referenced web resource
562
- */
563
507
  title: string;
564
- /**
565
- * Annotation type identifier, always "url_citation"
566
- */
567
- type: 'url_citation';
568
- /**
569
- * URL of the referenced web resource
570
- */
571
508
  url: string;
509
+ type?: 'url_citation';
572
510
  }
573
511
  interface OpenAIResponseAnnotationContainerFileCitation {
574
512
  container_id: string;
@@ -576,83 +514,51 @@ export declare namespace ResponseObjectStream {
576
514
  file_id: string;
577
515
  filename: string;
578
516
  start_index: number;
579
- type: 'container_file_citation';
517
+ type?: 'container_file_citation';
580
518
  }
581
519
  interface OpenAIResponseAnnotationFilePath {
582
520
  file_id: string;
583
521
  index: number;
584
- type: 'file_path';
522
+ type?: 'file_path';
585
523
  }
586
524
  }
525
+ /**
526
+ * Refusal content within a streamed response part.
527
+ */
528
+ interface OpenAIResponseContentPartRefusal {
529
+ refusal: string;
530
+ type?: 'refusal';
531
+ }
587
532
  }
588
533
  /**
589
534
  * Web search tool call output message for OpenAI responses.
590
535
  */
591
536
  interface OpenAIResponseOutputMessageWebSearchToolCall {
592
- /**
593
- * Unique identifier for this tool call
594
- */
595
537
  id: string;
596
- /**
597
- * Current status of the web search operation
598
- */
599
538
  status: string;
600
- /**
601
- * Tool call type identifier, always "web_search_call"
602
- */
603
- type: 'web_search_call';
539
+ type?: 'web_search_call';
604
540
  }
605
541
  /**
606
542
  * File search tool call output message for OpenAI responses.
607
543
  */
608
544
  interface OpenAIResponseOutputMessageFileSearchToolCall {
609
- /**
610
- * Unique identifier for this tool call
611
- */
612
545
  id: string;
613
- /**
614
- * List of search queries executed
615
- */
616
546
  queries: Array<string>;
617
- /**
618
- * Current status of the file search operation
619
- */
620
547
  status: string;
621
- /**
622
- * Tool call type identifier, always "file_search_call"
623
- */
624
- type: 'file_search_call';
625
- /**
626
- * (Optional) Search results returned by the file search operation
627
- */
628
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
548
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
549
+ type?: 'file_search_call';
629
550
  }
630
551
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
631
552
  /**
632
553
  * Search results returned by the file search operation.
633
554
  */
634
555
  interface Result {
635
- /**
636
- * (Optional) Key-value attributes associated with the file
637
- */
638
556
  attributes: {
639
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
557
+ [key: string]: unknown;
640
558
  };
641
- /**
642
- * Unique identifier of the file containing the result
643
- */
644
559
  file_id: string;
645
- /**
646
- * Name of the file containing the result
647
- */
648
560
  filename: string;
649
- /**
650
- * Relevance score for this search result (between 0 and 1)
651
- */
652
561
  score: number;
653
- /**
654
- * Text content of the search result
655
- */
656
562
  text: string;
657
563
  }
658
564
  }
@@ -660,131 +566,71 @@ export declare namespace ResponseObjectStream {
660
566
  * Function tool call output message for OpenAI responses.
661
567
  */
662
568
  interface OpenAIResponseOutputMessageFunctionToolCall {
663
- /**
664
- * JSON string containing the function arguments
665
- */
666
569
  arguments: string;
667
- /**
668
- * Unique identifier for the function call
669
- */
670
570
  call_id: string;
671
- /**
672
- * Name of the function being called
673
- */
674
571
  name: string;
675
- /**
676
- * Tool call type identifier, always "function_call"
677
- */
678
- type: 'function_call';
679
- /**
680
- * (Optional) Additional identifier for the tool call
681
- */
682
- id?: string;
683
- /**
684
- * (Optional) Current status of the function call execution
685
- */
686
- status?: string;
572
+ id?: string | null;
573
+ status?: string | null;
574
+ type?: 'function_call';
687
575
  }
688
576
  /**
689
577
  * Model Context Protocol (MCP) call output message for OpenAI responses.
690
578
  */
691
579
  interface OpenAIResponseOutputMessageMcpCall {
692
- /**
693
- * Unique identifier for this MCP call
694
- */
695
580
  id: string;
696
- /**
697
- * JSON string containing the MCP call arguments
698
- */
699
581
  arguments: string;
700
- /**
701
- * Name of the MCP method being called
702
- */
703
582
  name: string;
704
- /**
705
- * Label identifying the MCP server handling the call
706
- */
707
583
  server_label: string;
708
- /**
709
- * Tool call type identifier, always "mcp_call"
710
- */
711
- type: 'mcp_call';
712
- /**
713
- * (Optional) Error message if the MCP call failed
714
- */
715
- error?: string;
716
- /**
717
- * (Optional) Output result from the successful MCP call
718
- */
719
- output?: string;
584
+ error?: string | null;
585
+ output?: string | null;
586
+ type?: 'mcp_call';
720
587
  }
721
588
  /**
722
589
  * MCP list tools output message containing available tools from an MCP server.
723
590
  */
724
591
  interface OpenAIResponseOutputMessageMcpListTools {
725
- /**
726
- * Unique identifier for this MCP list tools operation
727
- */
728
592
  id: string;
729
- /**
730
- * Label identifying the MCP server providing the tools
731
- */
732
593
  server_label: string;
733
- /**
734
- * List of available tools provided by the MCP server
735
- */
736
594
  tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
737
- /**
738
- * Tool call type identifier, always "mcp_list_tools"
739
- */
740
- type: 'mcp_list_tools';
595
+ type?: 'mcp_list_tools';
741
596
  }
742
597
  namespace OpenAIResponseOutputMessageMcpListTools {
743
598
  /**
744
599
  * Tool definition returned by MCP list tools operation.
745
600
  */
746
601
  interface Tool {
747
- /**
748
- * JSON schema defining the tool's input parameters
749
- */
750
602
  input_schema: {
751
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
603
+ [key: string]: unknown;
752
604
  };
753
- /**
754
- * Name of the tool
755
- */
756
605
  name: string;
757
- /**
758
- * (Optional) Description of what the tool does
759
- */
760
- description?: string;
606
+ description?: string | null;
761
607
  }
762
608
  }
609
+ /**
610
+ * A request for human approval of a tool invocation.
611
+ */
612
+ interface OpenAIResponseMcpApprovalRequest {
613
+ id: string;
614
+ arguments: string;
615
+ name: string;
616
+ server_label: string;
617
+ type?: 'mcp_approval_request';
618
+ }
763
619
  }
764
620
  /**
765
621
  * Streaming event for when an output item is completed.
766
622
  */
767
623
  interface OpenAIResponseObjectStreamResponseOutputItemDone {
768
624
  /**
769
- * The completed output item (message, tool call, etc.)
770
- */
771
- item: OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpListTools;
772
- /**
773
- * Index position of this item in the output list
625
+ * Corresponds to the various Message types in the Responses API. They are all
626
+ * under one type because the Responses API gives them all the same "type" value,
627
+ * and there is no way to tell them apart in certain scenarios.
774
628
  */
629
+ item: OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMcpApprovalRequest;
775
630
  output_index: number;
776
- /**
777
- * Unique identifier of the response containing this output
778
- */
779
631
  response_id: string;
780
- /**
781
- * Sequential number for ordering streaming events
782
- */
783
632
  sequence_number: number;
784
- /**
785
- * Event type identifier, always "response.output_item.done"
786
- */
787
- type: 'response.output_item.done';
633
+ type?: 'response.output_item.done';
788
634
  }
789
635
  namespace OpenAIResponseObjectStreamResponseOutputItemDone {
790
636
  /**
@@ -793,94 +639,63 @@ export declare namespace ResponseObjectStream {
793
639
  * and there is no way to tell them apart in certain scenarios.
794
640
  */
795
641
  interface OpenAIResponseMessage {
796
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
642
+ content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage | OpenAIResponseMessage.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessage.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessage.OpenAIResponseContentPartRefusal>;
797
643
  role: 'system' | 'developer' | 'user' | 'assistant';
798
- type: 'message';
799
- id?: string;
800
- status?: string;
644
+ id?: string | null;
645
+ status?: string | null;
646
+ type?: 'message';
801
647
  }
802
648
  namespace OpenAIResponseMessage {
803
649
  /**
804
650
  * Text content for input messages in OpenAI response format.
805
651
  */
806
652
  interface OpenAIResponseInputMessageContentText {
807
- /**
808
- * The text content of the input message
809
- */
810
653
  text: string;
811
- /**
812
- * Content type identifier, always "input_text"
813
- */
814
- type: 'input_text';
654
+ type?: 'input_text';
815
655
  }
816
656
  /**
817
657
  * Image content for input messages in OpenAI response format.
818
658
  */
819
659
  interface OpenAIResponseInputMessageContentImage {
820
- /**
821
- * Level of detail for image processing, can be "low", "high", or "auto"
822
- */
823
- detail: 'low' | 'high' | 'auto';
824
- /**
825
- * Content type identifier, always "input_image"
826
- */
827
- type: 'input_image';
828
- /**
829
- * (Optional) URL of the image content
830
- */
831
- image_url?: string;
660
+ detail?: 'low' | 'high' | 'auto';
661
+ file_id?: string | null;
662
+ image_url?: string | null;
663
+ type?: 'input_image';
664
+ }
665
+ /**
666
+ * File content for input messages in OpenAI response format.
667
+ */
668
+ interface OpenAIResponseInputMessageContentFile {
669
+ file_data?: string | null;
670
+ file_id?: string | null;
671
+ file_url?: string | null;
672
+ filename?: string | null;
673
+ type?: 'input_file';
832
674
  }
833
- interface UnionMember2 {
834
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
675
+ interface OpenAIResponseOutputMessageContentOutputText {
835
676
  text: string;
836
- type: 'output_text';
677
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
678
+ type?: 'output_text';
837
679
  }
838
- namespace UnionMember2 {
680
+ namespace OpenAIResponseOutputMessageContentOutputText {
839
681
  /**
840
682
  * File citation annotation for referencing specific files in response content.
841
683
  */
842
684
  interface OpenAIResponseAnnotationFileCitation {
843
- /**
844
- * Unique identifier of the referenced file
845
- */
846
685
  file_id: string;
847
- /**
848
- * Name of the referenced file
849
- */
850
686
  filename: string;
851
- /**
852
- * Position index of the citation within the content
853
- */
854
687
  index: number;
855
- /**
856
- * Annotation type identifier, always "file_citation"
857
- */
858
- type: 'file_citation';
688
+ type?: 'file_citation';
859
689
  }
860
690
  /**
861
691
  * URL citation annotation for referencing external web resources.
862
692
  */
863
693
  interface OpenAIResponseAnnotationCitation {
864
- /**
865
- * End position of the citation span in the content
866
- */
867
694
  end_index: number;
868
- /**
869
- * Start position of the citation span in the content
870
- */
871
695
  start_index: number;
872
- /**
873
- * Title of the referenced web resource
874
- */
875
696
  title: string;
876
- /**
877
- * Annotation type identifier, always "url_citation"
878
- */
879
- type: 'url_citation';
880
- /**
881
- * URL of the referenced web resource
882
- */
883
697
  url: string;
698
+ type?: 'url_citation';
884
699
  }
885
700
  interface OpenAIResponseAnnotationContainerFileCitation {
886
701
  container_id: string;
@@ -888,83 +703,51 @@ export declare namespace ResponseObjectStream {
888
703
  file_id: string;
889
704
  filename: string;
890
705
  start_index: number;
891
- type: 'container_file_citation';
706
+ type?: 'container_file_citation';
892
707
  }
893
708
  interface OpenAIResponseAnnotationFilePath {
894
709
  file_id: string;
895
710
  index: number;
896
- type: 'file_path';
711
+ type?: 'file_path';
897
712
  }
898
713
  }
714
+ /**
715
+ * Refusal content within a streamed response part.
716
+ */
717
+ interface OpenAIResponseContentPartRefusal {
718
+ refusal: string;
719
+ type?: 'refusal';
720
+ }
899
721
  }
900
722
  /**
901
723
  * Web search tool call output message for OpenAI responses.
902
724
  */
903
725
  interface OpenAIResponseOutputMessageWebSearchToolCall {
904
- /**
905
- * Unique identifier for this tool call
906
- */
907
726
  id: string;
908
- /**
909
- * Current status of the web search operation
910
- */
911
727
  status: string;
912
- /**
913
- * Tool call type identifier, always "web_search_call"
914
- */
915
- type: 'web_search_call';
728
+ type?: 'web_search_call';
916
729
  }
917
730
  /**
918
731
  * File search tool call output message for OpenAI responses.
919
732
  */
920
733
  interface OpenAIResponseOutputMessageFileSearchToolCall {
921
- /**
922
- * Unique identifier for this tool call
923
- */
924
734
  id: string;
925
- /**
926
- * List of search queries executed
927
- */
928
735
  queries: Array<string>;
929
- /**
930
- * Current status of the file search operation
931
- */
932
736
  status: string;
933
- /**
934
- * Tool call type identifier, always "file_search_call"
935
- */
936
- type: 'file_search_call';
937
- /**
938
- * (Optional) Search results returned by the file search operation
939
- */
940
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
737
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
738
+ type?: 'file_search_call';
941
739
  }
942
740
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
943
741
  /**
944
742
  * Search results returned by the file search operation.
945
743
  */
946
744
  interface Result {
947
- /**
948
- * (Optional) Key-value attributes associated with the file
949
- */
950
745
  attributes: {
951
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
746
+ [key: string]: unknown;
952
747
  };
953
- /**
954
- * Unique identifier of the file containing the result
955
- */
956
748
  file_id: string;
957
- /**
958
- * Name of the file containing the result
959
- */
960
749
  filename: string;
961
- /**
962
- * Relevance score for this search result (between 0 and 1)
963
- */
964
750
  score: number;
965
- /**
966
- * Text content of the search result
967
- */
968
751
  text: string;
969
752
  }
970
753
  }
@@ -972,585 +755,756 @@ export declare namespace ResponseObjectStream {
972
755
  * Function tool call output message for OpenAI responses.
973
756
  */
974
757
  interface OpenAIResponseOutputMessageFunctionToolCall {
975
- /**
976
- * JSON string containing the function arguments
977
- */
978
758
  arguments: string;
979
- /**
980
- * Unique identifier for the function call
981
- */
982
759
  call_id: string;
983
- /**
984
- * Name of the function being called
985
- */
986
760
  name: string;
987
- /**
988
- * Tool call type identifier, always "function_call"
989
- */
990
- type: 'function_call';
991
- /**
992
- * (Optional) Additional identifier for the tool call
993
- */
994
- id?: string;
995
- /**
996
- * (Optional) Current status of the function call execution
997
- */
998
- status?: string;
761
+ id?: string | null;
762
+ status?: string | null;
763
+ type?: 'function_call';
999
764
  }
1000
765
  /**
1001
766
  * Model Context Protocol (MCP) call output message for OpenAI responses.
1002
767
  */
1003
768
  interface OpenAIResponseOutputMessageMcpCall {
1004
- /**
1005
- * Unique identifier for this MCP call
1006
- */
1007
769
  id: string;
1008
- /**
1009
- * JSON string containing the MCP call arguments
1010
- */
1011
770
  arguments: string;
1012
- /**
1013
- * Name of the MCP method being called
1014
- */
1015
771
  name: string;
1016
- /**
1017
- * Label identifying the MCP server handling the call
1018
- */
1019
772
  server_label: string;
1020
- /**
1021
- * Tool call type identifier, always "mcp_call"
1022
- */
1023
- type: 'mcp_call';
1024
- /**
1025
- * (Optional) Error message if the MCP call failed
1026
- */
1027
- error?: string;
1028
- /**
1029
- * (Optional) Output result from the successful MCP call
1030
- */
1031
- output?: string;
773
+ error?: string | null;
774
+ output?: string | null;
775
+ type?: 'mcp_call';
1032
776
  }
1033
777
  /**
1034
778
  * MCP list tools output message containing available tools from an MCP server.
1035
779
  */
1036
780
  interface OpenAIResponseOutputMessageMcpListTools {
1037
- /**
1038
- * Unique identifier for this MCP list tools operation
1039
- */
1040
781
  id: string;
1041
- /**
1042
- * Label identifying the MCP server providing the tools
1043
- */
1044
782
  server_label: string;
1045
- /**
1046
- * List of available tools provided by the MCP server
1047
- */
1048
783
  tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
1049
- /**
1050
- * Tool call type identifier, always "mcp_list_tools"
1051
- */
1052
- type: 'mcp_list_tools';
784
+ type?: 'mcp_list_tools';
1053
785
  }
1054
786
  namespace OpenAIResponseOutputMessageMcpListTools {
1055
787
  /**
1056
788
  * Tool definition returned by MCP list tools operation.
1057
789
  */
1058
790
  interface Tool {
1059
- /**
1060
- * JSON schema defining the tool's input parameters
1061
- */
1062
791
  input_schema: {
1063
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
792
+ [key: string]: unknown;
1064
793
  };
1065
- /**
1066
- * Name of the tool
1067
- */
1068
794
  name: string;
1069
- /**
1070
- * (Optional) Description of what the tool does
1071
- */
1072
- description?: string;
795
+ description?: string | null;
1073
796
  }
1074
797
  }
798
+ /**
799
+ * A request for human approval of a tool invocation.
800
+ */
801
+ interface OpenAIResponseMcpApprovalRequest {
802
+ id: string;
803
+ arguments: string;
804
+ name: string;
805
+ server_label: string;
806
+ type?: 'mcp_approval_request';
807
+ }
1075
808
  }
1076
809
  /**
1077
810
  * Streaming event for incremental text content updates.
1078
811
  */
1079
812
  interface OpenAIResponseObjectStreamResponseOutputTextDelta {
1080
- /**
1081
- * Index position within the text content
1082
- */
1083
813
  content_index: number;
1084
- /**
1085
- * Incremental text content being added
1086
- */
1087
814
  delta: string;
1088
- /**
1089
- * Unique identifier of the output item being updated
1090
- */
1091
815
  item_id: string;
1092
- /**
1093
- * Index position of the item in the output list
1094
- */
1095
816
  output_index: number;
1096
- /**
1097
- * Sequential number for ordering streaming events
1098
- */
1099
817
  sequence_number: number;
1100
- /**
1101
- * Event type identifier, always "response.output_text.delta"
1102
- */
1103
- type: 'response.output_text.delta';
818
+ type?: 'response.output_text.delta';
1104
819
  }
1105
820
  /**
1106
821
  * Streaming event for when text output is completed.
1107
822
  */
1108
823
  interface OpenAIResponseObjectStreamResponseOutputTextDone {
1109
- /**
1110
- * Index position within the text content
1111
- */
1112
824
  content_index: number;
1113
- /**
1114
- * Unique identifier of the completed output item
1115
- */
1116
825
  item_id: string;
1117
- /**
1118
- * Index position of the item in the output list
1119
- */
1120
826
  output_index: number;
1121
- /**
1122
- * Sequential number for ordering streaming events
1123
- */
1124
827
  sequence_number: number;
1125
- /**
1126
- * Final complete text content of the output item
1127
- */
1128
828
  text: string;
1129
- /**
1130
- * Event type identifier, always "response.output_text.done"
1131
- */
1132
- type: 'response.output_text.done';
829
+ type?: 'response.output_text.done';
1133
830
  }
1134
831
  /**
1135
832
  * Streaming event for incremental function call argument updates.
1136
833
  */
1137
834
  interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta {
1138
- /**
1139
- * Incremental function call arguments being added
1140
- */
1141
835
  delta: string;
1142
- /**
1143
- * Unique identifier of the function call being updated
1144
- */
1145
836
  item_id: string;
1146
- /**
1147
- * Index position of the item in the output list
1148
- */
1149
837
  output_index: number;
1150
- /**
1151
- * Sequential number for ordering streaming events
1152
- */
1153
838
  sequence_number: number;
1154
- /**
1155
- * Event type identifier, always "response.function_call_arguments.delta"
1156
- */
1157
- type: 'response.function_call_arguments.delta';
839
+ type?: 'response.function_call_arguments.delta';
1158
840
  }
1159
841
  /**
1160
842
  * Streaming event for when function call arguments are completed.
1161
843
  */
1162
844
  interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone {
1163
- /**
1164
- * Final complete arguments JSON string for the function call
1165
- */
1166
845
  arguments: string;
1167
- /**
1168
- * Unique identifier of the completed function call
1169
- */
1170
846
  item_id: string;
1171
- /**
1172
- * Index position of the item in the output list
1173
- */
1174
847
  output_index: number;
1175
- /**
1176
- * Sequential number for ordering streaming events
1177
- */
1178
848
  sequence_number: number;
1179
- /**
1180
- * Event type identifier, always "response.function_call_arguments.done"
1181
- */
1182
- type: 'response.function_call_arguments.done';
849
+ type?: 'response.function_call_arguments.done';
1183
850
  }
1184
851
  /**
1185
852
  * Streaming event for web search calls in progress.
1186
853
  */
1187
854
  interface OpenAIResponseObjectStreamResponseWebSearchCallInProgress {
1188
- /**
1189
- * Unique identifier of the web search call
1190
- */
1191
855
  item_id: string;
1192
- /**
1193
- * Index position of the item in the output list
1194
- */
1195
856
  output_index: number;
1196
- /**
1197
- * Sequential number for ordering streaming events
1198
- */
1199
857
  sequence_number: number;
1200
- /**
1201
- * Event type identifier, always "response.web_search_call.in_progress"
1202
- */
1203
- type: 'response.web_search_call.in_progress';
858
+ type?: 'response.web_search_call.in_progress';
1204
859
  }
1205
860
  interface OpenAIResponseObjectStreamResponseWebSearchCallSearching {
1206
861
  item_id: string;
1207
862
  output_index: number;
1208
863
  sequence_number: number;
1209
- type: 'response.web_search_call.searching';
864
+ type?: 'response.web_search_call.searching';
1210
865
  }
1211
866
  /**
1212
867
  * Streaming event for completed web search calls.
1213
868
  */
1214
869
  interface OpenAIResponseObjectStreamResponseWebSearchCallCompleted {
1215
- /**
1216
- * Unique identifier of the completed web search call
1217
- */
1218
870
  item_id: string;
1219
- /**
1220
- * Index position of the item in the output list
1221
- */
1222
871
  output_index: number;
1223
- /**
1224
- * Sequential number for ordering streaming events
1225
- */
1226
872
  sequence_number: number;
1227
- /**
1228
- * Event type identifier, always "response.web_search_call.completed"
1229
- */
1230
- type: 'response.web_search_call.completed';
873
+ type?: 'response.web_search_call.completed';
1231
874
  }
1232
875
  interface OpenAIResponseObjectStreamResponseMcpListToolsInProgress {
1233
876
  sequence_number: number;
1234
- type: 'response.mcp_list_tools.in_progress';
877
+ type?: 'response.mcp_list_tools.in_progress';
1235
878
  }
1236
879
  interface OpenAIResponseObjectStreamResponseMcpListToolsFailed {
1237
880
  sequence_number: number;
1238
- type: 'response.mcp_list_tools.failed';
881
+ type?: 'response.mcp_list_tools.failed';
1239
882
  }
1240
883
  interface OpenAIResponseObjectStreamResponseMcpListToolsCompleted {
1241
884
  sequence_number: number;
1242
- type: 'response.mcp_list_tools.completed';
885
+ type?: 'response.mcp_list_tools.completed';
1243
886
  }
1244
887
  interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta {
1245
888
  delta: string;
1246
889
  item_id: string;
1247
890
  output_index: number;
1248
891
  sequence_number: number;
1249
- type: 'response.mcp_call.arguments.delta';
892
+ type?: 'response.mcp_call.arguments.delta';
1250
893
  }
1251
894
  interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDone {
1252
895
  arguments: string;
1253
896
  item_id: string;
1254
897
  output_index: number;
1255
898
  sequence_number: number;
1256
- type: 'response.mcp_call.arguments.done';
899
+ type?: 'response.mcp_call.arguments.done';
1257
900
  }
1258
901
  /**
1259
902
  * Streaming event for MCP calls in progress.
1260
903
  */
1261
904
  interface OpenAIResponseObjectStreamResponseMcpCallInProgress {
1262
- /**
1263
- * Unique identifier of the MCP call
1264
- */
1265
905
  item_id: string;
1266
- /**
1267
- * Index position of the item in the output list
1268
- */
1269
906
  output_index: number;
1270
- /**
1271
- * Sequential number for ordering streaming events
1272
- */
1273
907
  sequence_number: number;
1274
- /**
1275
- * Event type identifier, always "response.mcp_call.in_progress"
1276
- */
1277
- type: 'response.mcp_call.in_progress';
908
+ type?: 'response.mcp_call.in_progress';
1278
909
  }
1279
910
  /**
1280
911
  * Streaming event for failed MCP calls.
1281
912
  */
1282
913
  interface OpenAIResponseObjectStreamResponseMcpCallFailed {
1283
- /**
1284
- * Sequential number for ordering streaming events
1285
- */
1286
914
  sequence_number: number;
1287
- /**
1288
- * Event type identifier, always "response.mcp_call.failed"
1289
- */
1290
- type: 'response.mcp_call.failed';
915
+ type?: 'response.mcp_call.failed';
1291
916
  }
1292
917
  /**
1293
918
  * Streaming event for completed MCP calls.
1294
919
  */
1295
920
  interface OpenAIResponseObjectStreamResponseMcpCallCompleted {
1296
- /**
1297
- * Sequential number for ordering streaming events
1298
- */
1299
921
  sequence_number: number;
1300
- /**
1301
- * Event type identifier, always "response.mcp_call.completed"
1302
- */
1303
- type: 'response.mcp_call.completed';
922
+ type?: 'response.mcp_call.completed';
1304
923
  }
1305
924
  /**
1306
925
  * Streaming event for when a new content part is added to a response item.
1307
926
  */
1308
927
  interface OpenAIResponseObjectStreamResponseContentPartAdded {
1309
- /**
1310
- * Unique identifier of the output item containing this content part
1311
- */
928
+ content_index: number;
1312
929
  item_id: string;
930
+ output_index: number;
1313
931
  /**
1314
- * The content part that was added
1315
- */
1316
- part: OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartRefusal;
1317
- /**
1318
- * Unique identifier of the response containing this content
932
+ * Text content within a streamed response part.
1319
933
  */
934
+ part: OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartReasoningText;
1320
935
  response_id: string;
1321
- /**
1322
- * Sequential number for ordering streaming events
1323
- */
1324
936
  sequence_number: number;
1325
- /**
1326
- * Event type identifier, always "response.content_part.added"
1327
- */
1328
- type: 'response.content_part.added';
937
+ type?: 'response.content_part.added';
1329
938
  }
1330
939
  namespace OpenAIResponseObjectStreamResponseContentPartAdded {
940
+ /**
941
+ * Text content within a streamed response part.
942
+ */
1331
943
  interface OpenAIResponseContentPartOutputText {
1332
944
  text: string;
1333
- type: 'output_text';
1334
- }
1335
- interface OpenAIResponseContentPartRefusal {
1336
- refusal: string;
1337
- type: 'refusal';
945
+ annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
946
+ logprobs?: Array<{
947
+ [key: string]: unknown;
948
+ }> | null;
949
+ type?: 'output_text';
950
+ }
951
+ namespace OpenAIResponseContentPartOutputText {
952
+ /**
953
+ * File citation annotation for referencing specific files in response content.
954
+ */
955
+ interface OpenAIResponseAnnotationFileCitation {
956
+ file_id: string;
957
+ filename: string;
958
+ index: number;
959
+ type?: 'file_citation';
960
+ }
961
+ /**
962
+ * URL citation annotation for referencing external web resources.
963
+ */
964
+ interface OpenAIResponseAnnotationCitation {
965
+ end_index: number;
966
+ start_index: number;
967
+ title: string;
968
+ url: string;
969
+ type?: 'url_citation';
970
+ }
971
+ interface OpenAIResponseAnnotationContainerFileCitation {
972
+ container_id: string;
973
+ end_index: number;
974
+ file_id: string;
975
+ filename: string;
976
+ start_index: number;
977
+ type?: 'container_file_citation';
978
+ }
979
+ interface OpenAIResponseAnnotationFilePath {
980
+ file_id: string;
981
+ index: number;
982
+ type?: 'file_path';
983
+ }
984
+ }
985
+ /**
986
+ * Refusal content within a streamed response part.
987
+ */
988
+ interface OpenAIResponseContentPartRefusal {
989
+ refusal: string;
990
+ type?: 'refusal';
991
+ }
992
+ /**
993
+ * Reasoning text emitted as part of a streamed response.
994
+ */
995
+ interface OpenAIResponseContentPartReasoningText {
996
+ text: string;
997
+ type?: 'reasoning_text';
1338
998
  }
1339
999
  }
1340
1000
  /**
1341
1001
  * Streaming event for when a content part is completed.
1342
1002
  */
1343
1003
  interface OpenAIResponseObjectStreamResponseContentPartDone {
1004
+ content_index: number;
1005
+ item_id: string;
1006
+ output_index: number;
1344
1007
  /**
1345
- * Unique identifier of the output item containing this content part
1008
+ * Text content within a streamed response part.
1346
1009
  */
1347
- item_id: string;
1010
+ part: OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartReasoningText;
1011
+ response_id: string;
1012
+ sequence_number: number;
1013
+ type?: 'response.content_part.done';
1014
+ }
1015
+ namespace OpenAIResponseObjectStreamResponseContentPartDone {
1348
1016
  /**
1349
- * The completed content part
1017
+ * Text content within a streamed response part.
1350
1018
  */
1351
- part: OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartRefusal;
1019
+ interface OpenAIResponseContentPartOutputText {
1020
+ text: string;
1021
+ annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
1022
+ logprobs?: Array<{
1023
+ [key: string]: unknown;
1024
+ }> | null;
1025
+ type?: 'output_text';
1026
+ }
1027
+ namespace OpenAIResponseContentPartOutputText {
1028
+ /**
1029
+ * File citation annotation for referencing specific files in response content.
1030
+ */
1031
+ interface OpenAIResponseAnnotationFileCitation {
1032
+ file_id: string;
1033
+ filename: string;
1034
+ index: number;
1035
+ type?: 'file_citation';
1036
+ }
1037
+ /**
1038
+ * URL citation annotation for referencing external web resources.
1039
+ */
1040
+ interface OpenAIResponseAnnotationCitation {
1041
+ end_index: number;
1042
+ start_index: number;
1043
+ title: string;
1044
+ url: string;
1045
+ type?: 'url_citation';
1046
+ }
1047
+ interface OpenAIResponseAnnotationContainerFileCitation {
1048
+ container_id: string;
1049
+ end_index: number;
1050
+ file_id: string;
1051
+ filename: string;
1052
+ start_index: number;
1053
+ type?: 'container_file_citation';
1054
+ }
1055
+ interface OpenAIResponseAnnotationFilePath {
1056
+ file_id: string;
1057
+ index: number;
1058
+ type?: 'file_path';
1059
+ }
1060
+ }
1352
1061
  /**
1353
- * Unique identifier of the response containing this content
1062
+ * Refusal content within a streamed response part.
1354
1063
  */
1355
- response_id: string;
1064
+ interface OpenAIResponseContentPartRefusal {
1065
+ refusal: string;
1066
+ type?: 'refusal';
1067
+ }
1356
1068
  /**
1357
- * Sequential number for ordering streaming events
1069
+ * Reasoning text emitted as part of a streamed response.
1358
1070
  */
1071
+ interface OpenAIResponseContentPartReasoningText {
1072
+ text: string;
1073
+ type?: 'reasoning_text';
1074
+ }
1075
+ }
1076
+ /**
1077
+ * Streaming event for incremental reasoning text updates.
1078
+ */
1079
+ interface OpenAIResponseObjectStreamResponseReasoningTextDelta {
1080
+ content_index: number;
1081
+ delta: string;
1082
+ item_id: string;
1083
+ output_index: number;
1359
1084
  sequence_number: number;
1085
+ type?: 'response.reasoning_text.delta';
1086
+ }
1087
+ /**
1088
+ * Streaming event for when reasoning text is completed.
1089
+ */
1090
+ interface OpenAIResponseObjectStreamResponseReasoningTextDone {
1091
+ content_index: number;
1092
+ item_id: string;
1093
+ output_index: number;
1094
+ sequence_number: number;
1095
+ text: string;
1096
+ type?: 'response.reasoning_text.done';
1097
+ }
1098
+ /**
1099
+ * Streaming event for when a new reasoning summary part is added.
1100
+ */
1101
+ interface OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
1102
+ item_id: string;
1103
+ output_index: number;
1360
1104
  /**
1361
- * Event type identifier, always "response.content_part.done"
1105
+ * Reasoning summary part in a streamed response.
1362
1106
  */
1363
- type: 'response.content_part.done';
1107
+ part: OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded.Part;
1108
+ sequence_number: number;
1109
+ summary_index: number;
1110
+ type?: 'response.reasoning_summary_part.added';
1364
1111
  }
1365
- namespace OpenAIResponseObjectStreamResponseContentPartDone {
1366
- interface OpenAIResponseContentPartOutputText {
1112
+ namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
1113
+ /**
1114
+ * Reasoning summary part in a streamed response.
1115
+ */
1116
+ interface Part {
1367
1117
  text: string;
1368
- type: 'output_text';
1369
- }
1370
- interface OpenAIResponseContentPartRefusal {
1371
- refusal: string;
1372
- type: 'refusal';
1118
+ type?: 'summary_text';
1373
1119
  }
1374
1120
  }
1375
1121
  /**
1376
- * Streaming event indicating a response has been completed.
1122
+ * Streaming event for when a reasoning summary part is completed.
1377
1123
  */
1378
- interface OpenAIResponseObjectStreamResponseCompleted {
1124
+ interface OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
1125
+ item_id: string;
1126
+ output_index: number;
1379
1127
  /**
1380
- * The completed response object
1128
+ * Reasoning summary part in a streamed response.
1381
1129
  */
1382
- response: ResponsesAPI.ResponseObject;
1130
+ part: OpenAIResponseObjectStreamResponseReasoningSummaryPartDone.Part;
1131
+ sequence_number: number;
1132
+ summary_index: number;
1133
+ type?: 'response.reasoning_summary_part.done';
1134
+ }
1135
+ namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
1383
1136
  /**
1384
- * Event type identifier, always "response.completed"
1137
+ * Reasoning summary part in a streamed response.
1385
1138
  */
1386
- type: 'response.completed';
1139
+ interface Part {
1140
+ text: string;
1141
+ type?: 'summary_text';
1142
+ }
1387
1143
  }
1388
- }
1389
- /**
1390
- * OpenAI response object extended with input context information.
1391
- */
1392
- export interface ResponseListResponse {
1393
1144
  /**
1394
- * Unique identifier for this response
1145
+ * Streaming event for incremental reasoning summary text updates.
1395
1146
  */
1396
- id: string;
1147
+ interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta {
1148
+ delta: string;
1149
+ item_id: string;
1150
+ output_index: number;
1151
+ sequence_number: number;
1152
+ summary_index: number;
1153
+ type?: 'response.reasoning_summary_text.delta';
1154
+ }
1397
1155
  /**
1398
- * Unix timestamp when the response was created
1156
+ * Streaming event for when reasoning summary text is completed.
1399
1157
  */
1400
- created_at: number;
1158
+ interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDone {
1159
+ item_id: string;
1160
+ output_index: number;
1161
+ sequence_number: number;
1162
+ summary_index: number;
1163
+ text: string;
1164
+ type?: 'response.reasoning_summary_text.done';
1165
+ }
1401
1166
  /**
1402
- * List of input items that led to this response
1167
+ * Streaming event for incremental refusal text updates.
1403
1168
  */
1404
- input: Array<ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseInputFunctionToolCallOutput | ResponseListResponse.OpenAIResponseMessage>;
1169
+ interface OpenAIResponseObjectStreamResponseRefusalDelta {
1170
+ content_index: number;
1171
+ delta: string;
1172
+ item_id: string;
1173
+ output_index: number;
1174
+ sequence_number: number;
1175
+ type?: 'response.refusal.delta';
1176
+ }
1405
1177
  /**
1406
- * Model identifier used for generation
1178
+ * Streaming event for when refusal text is completed.
1407
1179
  */
1408
- model: string;
1180
+ interface OpenAIResponseObjectStreamResponseRefusalDone {
1181
+ content_index: number;
1182
+ item_id: string;
1183
+ output_index: number;
1184
+ refusal: string;
1185
+ sequence_number: number;
1186
+ type?: 'response.refusal.done';
1187
+ }
1409
1188
  /**
1410
- * Object type identifier, always "response"
1189
+ * Streaming event for when an annotation is added to output text.
1411
1190
  */
1412
- object: 'response';
1191
+ interface OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
1192
+ /**
1193
+ * File citation annotation for referencing specific files in response content.
1194
+ */
1195
+ annotation: OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFilePath;
1196
+ annotation_index: number;
1197
+ content_index: number;
1198
+ item_id: string;
1199
+ output_index: number;
1200
+ sequence_number: number;
1201
+ type?: 'response.output_text.annotation.added';
1202
+ }
1203
+ namespace OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
1204
+ /**
1205
+ * File citation annotation for referencing specific files in response content.
1206
+ */
1207
+ interface OpenAIResponseAnnotationFileCitation {
1208
+ file_id: string;
1209
+ filename: string;
1210
+ index: number;
1211
+ type?: 'file_citation';
1212
+ }
1213
+ /**
1214
+ * URL citation annotation for referencing external web resources.
1215
+ */
1216
+ interface OpenAIResponseAnnotationCitation {
1217
+ end_index: number;
1218
+ start_index: number;
1219
+ title: string;
1220
+ url: string;
1221
+ type?: 'url_citation';
1222
+ }
1223
+ interface OpenAIResponseAnnotationContainerFileCitation {
1224
+ container_id: string;
1225
+ end_index: number;
1226
+ file_id: string;
1227
+ filename: string;
1228
+ start_index: number;
1229
+ type?: 'container_file_citation';
1230
+ }
1231
+ interface OpenAIResponseAnnotationFilePath {
1232
+ file_id: string;
1233
+ index: number;
1234
+ type?: 'file_path';
1235
+ }
1236
+ }
1413
1237
  /**
1414
- * List of generated output items (messages, tool calls, etc.)
1238
+ * Streaming event for file search calls in progress.
1415
1239
  */
1416
- output: Array<ResponseListResponse.OpenAIResponseMessage | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools>;
1240
+ interface OpenAIResponseObjectStreamResponseFileSearchCallInProgress {
1241
+ item_id: string;
1242
+ output_index: number;
1243
+ sequence_number: number;
1244
+ type?: 'response.file_search_call.in_progress';
1245
+ }
1417
1246
  /**
1418
- * Whether tool calls can be executed in parallel
1247
+ * Streaming event for file search currently searching.
1419
1248
  */
1420
- parallel_tool_calls: boolean;
1249
+ interface OpenAIResponseObjectStreamResponseFileSearchCallSearching {
1250
+ item_id: string;
1251
+ output_index: number;
1252
+ sequence_number: number;
1253
+ type?: 'response.file_search_call.searching';
1254
+ }
1421
1255
  /**
1422
- * Current status of the response generation
1256
+ * Streaming event for completed file search calls.
1423
1257
  */
1424
- status: string;
1258
+ interface OpenAIResponseObjectStreamResponseFileSearchCallCompleted {
1259
+ item_id: string;
1260
+ output_index: number;
1261
+ sequence_number: number;
1262
+ type?: 'response.file_search_call.completed';
1263
+ }
1425
1264
  /**
1426
- * Text formatting configuration for the response
1265
+ * Streaming event emitted when a response ends in an incomplete state.
1427
1266
  */
1428
- text: ResponseListResponse.Text;
1267
+ interface OpenAIResponseObjectStreamResponseIncomplete {
1268
+ /**
1269
+ * Complete OpenAI response object containing generation results and metadata.
1270
+ */
1271
+ response: ResponsesAPI.ResponseObject;
1272
+ sequence_number: number;
1273
+ type?: 'response.incomplete';
1274
+ }
1429
1275
  /**
1430
- * (Optional) Error details if the response generation failed
1276
+ * Streaming event emitted when a response fails.
1431
1277
  */
1432
- error?: ResponseListResponse.Error;
1278
+ interface OpenAIResponseObjectStreamResponseFailed {
1279
+ /**
1280
+ * Complete OpenAI response object containing generation results and metadata.
1281
+ */
1282
+ response: ResponsesAPI.ResponseObject;
1283
+ sequence_number: number;
1284
+ type?: 'response.failed';
1285
+ }
1433
1286
  /**
1434
- * (Optional) ID of the previous response in a conversation
1287
+ * Streaming event indicating a response has been completed.
1435
1288
  */
1436
- previous_response_id?: string;
1289
+ interface OpenAIResponseObjectStreamResponseCompleted {
1290
+ /**
1291
+ * Complete OpenAI response object containing generation results and metadata.
1292
+ */
1293
+ response: ResponsesAPI.ResponseObject;
1294
+ type?: 'response.completed';
1295
+ }
1296
+ }
1297
+ /**
1298
+ * OpenAI response object extended with input context information.
1299
+ */
1300
+ export interface ResponseListResponse {
1301
+ id: string;
1302
+ created_at: number;
1303
+ input: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest | ResponseListResponse.OpenAIResponseInputFunctionToolCallOutput | ResponseListResponse.OpenAIResponseMcpApprovalResponse | ResponseListResponse.OpenAIResponseMessageOutput>;
1304
+ model: string;
1305
+ output: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest>;
1306
+ status: string;
1437
1307
  /**
1438
- * (Optional) Sampling temperature used for generation
1308
+ * Error details for failed OpenAI response requests.
1439
1309
  */
1440
- temperature?: number;
1310
+ error?: ResponseListResponse.Error | null;
1311
+ instructions?: string | null;
1312
+ max_tool_calls?: number | null;
1313
+ metadata?: {
1314
+ [key: string]: string;
1315
+ } | null;
1316
+ object?: 'response';
1317
+ parallel_tool_calls?: boolean | null;
1318
+ previous_response_id?: string | null;
1441
1319
  /**
1442
- * (Optional) Nucleus sampling parameter used for generation
1320
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
1443
1321
  */
1444
- top_p?: number;
1322
+ prompt?: ResponseListResponse.Prompt | null;
1323
+ temperature?: number | null;
1445
1324
  /**
1446
- * (Optional) Truncation strategy applied to the response
1325
+ * Text response configuration for OpenAI responses.
1447
1326
  */
1448
- truncation?: string;
1327
+ text?: ResponseListResponse.Text;
1328
+ tools?: Array<ResponseListResponse.OpenAIResponseInputToolWebSearch | ResponseListResponse.OpenAIResponseInputToolFileSearch | ResponseListResponse.OpenAIResponseInputToolFunction | ResponseListResponse.OpenAIResponseToolMcp> | null;
1329
+ top_p?: number | null;
1330
+ truncation?: string | null;
1449
1331
  /**
1450
- * (Optional) User identifier associated with the request
1332
+ * Usage information for OpenAI response.
1451
1333
  */
1452
- user?: string;
1334
+ usage?: ResponseListResponse.Usage | null;
1453
1335
  }
1454
1336
  export declare namespace ResponseListResponse {
1455
1337
  /**
1456
- * Web search tool call output message for OpenAI responses.
1338
+ * Corresponds to the various Message types in the Responses API. They are all
1339
+ * under one type because the Responses API gives them all the same "type" value,
1340
+ * and there is no way to tell them apart in certain scenarios.
1457
1341
  */
1458
- interface OpenAIResponseOutputMessageWebSearchToolCall {
1342
+ interface OpenAIResponseMessageOutput {
1343
+ content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
1344
+ role: 'system' | 'developer' | 'user' | 'assistant';
1345
+ id?: string | null;
1346
+ status?: string | null;
1347
+ type?: 'message';
1348
+ }
1349
+ namespace OpenAIResponseMessageOutput {
1459
1350
  /**
1460
- * Unique identifier for this tool call
1351
+ * Text content for input messages in OpenAI response format.
1461
1352
  */
1462
- id: string;
1353
+ interface OpenAIResponseInputMessageContentText {
1354
+ text: string;
1355
+ type?: 'input_text';
1356
+ }
1463
1357
  /**
1464
- * Current status of the web search operation
1358
+ * Image content for input messages in OpenAI response format.
1465
1359
  */
1466
- status: string;
1360
+ interface OpenAIResponseInputMessageContentImage {
1361
+ detail?: 'low' | 'high' | 'auto';
1362
+ file_id?: string | null;
1363
+ image_url?: string | null;
1364
+ type?: 'input_image';
1365
+ }
1467
1366
  /**
1468
- * Tool call type identifier, always "web_search_call"
1367
+ * File content for input messages in OpenAI response format.
1469
1368
  */
1470
- type: 'web_search_call';
1369
+ interface OpenAIResponseInputMessageContentFile {
1370
+ file_data?: string | null;
1371
+ file_id?: string | null;
1372
+ file_url?: string | null;
1373
+ filename?: string | null;
1374
+ type?: 'input_file';
1375
+ }
1376
+ interface OpenAIResponseOutputMessageContentOutputText {
1377
+ text: string;
1378
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
1379
+ type?: 'output_text';
1380
+ }
1381
+ namespace OpenAIResponseOutputMessageContentOutputText {
1382
+ /**
1383
+ * File citation annotation for referencing specific files in response content.
1384
+ */
1385
+ interface OpenAIResponseAnnotationFileCitation {
1386
+ file_id: string;
1387
+ filename: string;
1388
+ index: number;
1389
+ type?: 'file_citation';
1390
+ }
1391
+ /**
1392
+ * URL citation annotation for referencing external web resources.
1393
+ */
1394
+ interface OpenAIResponseAnnotationCitation {
1395
+ end_index: number;
1396
+ start_index: number;
1397
+ title: string;
1398
+ url: string;
1399
+ type?: 'url_citation';
1400
+ }
1401
+ interface OpenAIResponseAnnotationContainerFileCitation {
1402
+ container_id: string;
1403
+ end_index: number;
1404
+ file_id: string;
1405
+ filename: string;
1406
+ start_index: number;
1407
+ type?: 'container_file_citation';
1408
+ }
1409
+ interface OpenAIResponseAnnotationFilePath {
1410
+ file_id: string;
1411
+ index: number;
1412
+ type?: 'file_path';
1413
+ }
1414
+ }
1415
+ /**
1416
+ * Refusal content within a streamed response part.
1417
+ */
1418
+ interface OpenAIResponseContentPartRefusal {
1419
+ refusal: string;
1420
+ type?: 'refusal';
1421
+ }
1422
+ }
1423
+ /**
1424
+ * Web search tool call output message for OpenAI responses.
1425
+ */
1426
+ interface OpenAIResponseOutputMessageWebSearchToolCall {
1427
+ id: string;
1428
+ status: string;
1429
+ type?: 'web_search_call';
1471
1430
  }
1472
1431
  /**
1473
1432
  * File search tool call output message for OpenAI responses.
1474
1433
  */
1475
1434
  interface OpenAIResponseOutputMessageFileSearchToolCall {
1476
- /**
1477
- * Unique identifier for this tool call
1478
- */
1479
1435
  id: string;
1480
- /**
1481
- * List of search queries executed
1482
- */
1483
1436
  queries: Array<string>;
1484
- /**
1485
- * Current status of the file search operation
1486
- */
1487
1437
  status: string;
1488
- /**
1489
- * Tool call type identifier, always "file_search_call"
1490
- */
1491
- type: 'file_search_call';
1492
- /**
1493
- * (Optional) Search results returned by the file search operation
1494
- */
1495
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
1438
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
1439
+ type?: 'file_search_call';
1496
1440
  }
1497
1441
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
1498
1442
  /**
1499
1443
  * Search results returned by the file search operation.
1500
1444
  */
1501
1445
  interface Result {
1502
- /**
1503
- * (Optional) Key-value attributes associated with the file
1504
- */
1505
1446
  attributes: {
1506
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
1447
+ [key: string]: unknown;
1507
1448
  };
1508
- /**
1509
- * Unique identifier of the file containing the result
1510
- */
1511
1449
  file_id: string;
1512
- /**
1513
- * Name of the file containing the result
1514
- */
1515
1450
  filename: string;
1516
- /**
1517
- * Relevance score for this search result (between 0 and 1)
1518
- */
1519
1451
  score: number;
1520
- /**
1521
- * Text content of the search result
1522
- */
1523
1452
  text: string;
1524
1453
  }
1525
1454
  }
1526
1455
  /**
1527
- * Function tool call output message for OpenAI responses.
1456
+ * Function tool call output message for OpenAI responses.
1457
+ */
1458
+ interface OpenAIResponseOutputMessageFunctionToolCall {
1459
+ arguments: string;
1460
+ call_id: string;
1461
+ name: string;
1462
+ id?: string | null;
1463
+ status?: string | null;
1464
+ type?: 'function_call';
1465
+ }
1466
+ /**
1467
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
1468
+ */
1469
+ interface OpenAIResponseOutputMessageMcpCall {
1470
+ id: string;
1471
+ arguments: string;
1472
+ name: string;
1473
+ server_label: string;
1474
+ error?: string | null;
1475
+ output?: string | null;
1476
+ type?: 'mcp_call';
1477
+ }
1478
+ /**
1479
+ * MCP list tools output message containing available tools from an MCP server.
1480
+ */
1481
+ interface OpenAIResponseOutputMessageMcpListTools {
1482
+ id: string;
1483
+ server_label: string;
1484
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
1485
+ type?: 'mcp_list_tools';
1486
+ }
1487
+ namespace OpenAIResponseOutputMessageMcpListTools {
1488
+ /**
1489
+ * Tool definition returned by MCP list tools operation.
1490
+ */
1491
+ interface Tool {
1492
+ input_schema: {
1493
+ [key: string]: unknown;
1494
+ };
1495
+ name: string;
1496
+ description?: string | null;
1497
+ }
1498
+ }
1499
+ /**
1500
+ * A request for human approval of a tool invocation.
1528
1501
  */
1529
- interface OpenAIResponseOutputMessageFunctionToolCall {
1530
- /**
1531
- * JSON string containing the function arguments
1532
- */
1502
+ interface OpenAIResponseMcpApprovalRequest {
1503
+ id: string;
1533
1504
  arguments: string;
1534
- /**
1535
- * Unique identifier for the function call
1536
- */
1537
- call_id: string;
1538
- /**
1539
- * Name of the function being called
1540
- */
1541
1505
  name: string;
1542
- /**
1543
- * Tool call type identifier, always "function_call"
1544
- */
1545
- type: 'function_call';
1546
- /**
1547
- * (Optional) Additional identifier for the tool call
1548
- */
1549
- id?: string;
1550
- /**
1551
- * (Optional) Current status of the function call execution
1552
- */
1553
- status?: string;
1506
+ server_label: string;
1507
+ type?: 'mcp_approval_request';
1554
1508
  }
1555
1509
  /**
1556
1510
  * This represents the output of a function call that gets passed back to the
@@ -1559,104 +1513,83 @@ export declare namespace ResponseListResponse {
1559
1513
  interface OpenAIResponseInputFunctionToolCallOutput {
1560
1514
  call_id: string;
1561
1515
  output: string;
1562
- type: 'function_call_output';
1563
- id?: string;
1564
- status?: string;
1516
+ id?: string | null;
1517
+ status?: string | null;
1518
+ type?: 'function_call_output';
1519
+ }
1520
+ /**
1521
+ * A response to an MCP approval request.
1522
+ */
1523
+ interface OpenAIResponseMcpApprovalResponse {
1524
+ approval_request_id: string;
1525
+ approve: boolean;
1526
+ id?: string | null;
1527
+ reason?: string | null;
1528
+ type?: 'mcp_approval_response';
1565
1529
  }
1566
1530
  /**
1567
1531
  * Corresponds to the various Message types in the Responses API. They are all
1568
1532
  * under one type because the Responses API gives them all the same "type" value,
1569
1533
  * and there is no way to tell them apart in certain scenarios.
1570
1534
  */
1571
- interface OpenAIResponseMessage {
1572
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
1535
+ interface OpenAIResponseMessageOutput {
1536
+ content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
1573
1537
  role: 'system' | 'developer' | 'user' | 'assistant';
1574
- type: 'message';
1575
- id?: string;
1576
- status?: string;
1538
+ id?: string | null;
1539
+ status?: string | null;
1540
+ type?: 'message';
1577
1541
  }
1578
- namespace OpenAIResponseMessage {
1542
+ namespace OpenAIResponseMessageOutput {
1579
1543
  /**
1580
1544
  * Text content for input messages in OpenAI response format.
1581
1545
  */
1582
1546
  interface OpenAIResponseInputMessageContentText {
1583
- /**
1584
- * The text content of the input message
1585
- */
1586
1547
  text: string;
1587
- /**
1588
- * Content type identifier, always "input_text"
1589
- */
1590
- type: 'input_text';
1548
+ type?: 'input_text';
1591
1549
  }
1592
1550
  /**
1593
1551
  * Image content for input messages in OpenAI response format.
1594
1552
  */
1595
1553
  interface OpenAIResponseInputMessageContentImage {
1596
- /**
1597
- * Level of detail for image processing, can be "low", "high", or "auto"
1598
- */
1599
- detail: 'low' | 'high' | 'auto';
1600
- /**
1601
- * Content type identifier, always "input_image"
1602
- */
1603
- type: 'input_image';
1604
- /**
1605
- * (Optional) URL of the image content
1606
- */
1607
- image_url?: string;
1554
+ detail?: 'low' | 'high' | 'auto';
1555
+ file_id?: string | null;
1556
+ image_url?: string | null;
1557
+ type?: 'input_image';
1608
1558
  }
1609
- interface UnionMember2 {
1610
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
1559
+ /**
1560
+ * File content for input messages in OpenAI response format.
1561
+ */
1562
+ interface OpenAIResponseInputMessageContentFile {
1563
+ file_data?: string | null;
1564
+ file_id?: string | null;
1565
+ file_url?: string | null;
1566
+ filename?: string | null;
1567
+ type?: 'input_file';
1568
+ }
1569
+ interface OpenAIResponseOutputMessageContentOutputText {
1611
1570
  text: string;
1612
- type: 'output_text';
1571
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
1572
+ type?: 'output_text';
1613
1573
  }
1614
- namespace UnionMember2 {
1574
+ namespace OpenAIResponseOutputMessageContentOutputText {
1615
1575
  /**
1616
1576
  * File citation annotation for referencing specific files in response content.
1617
1577
  */
1618
1578
  interface OpenAIResponseAnnotationFileCitation {
1619
- /**
1620
- * Unique identifier of the referenced file
1621
- */
1622
1579
  file_id: string;
1623
- /**
1624
- * Name of the referenced file
1625
- */
1626
1580
  filename: string;
1627
- /**
1628
- * Position index of the citation within the content
1629
- */
1630
1581
  index: number;
1631
- /**
1632
- * Annotation type identifier, always "file_citation"
1633
- */
1634
- type: 'file_citation';
1582
+ type?: 'file_citation';
1635
1583
  }
1636
1584
  /**
1637
1585
  * URL citation annotation for referencing external web resources.
1638
1586
  */
1639
1587
  interface OpenAIResponseAnnotationCitation {
1640
- /**
1641
- * End position of the citation span in the content
1642
- */
1643
1588
  end_index: number;
1644
- /**
1645
- * Start position of the citation span in the content
1646
- */
1647
1589
  start_index: number;
1648
- /**
1649
- * Title of the referenced web resource
1650
- */
1651
1590
  title: string;
1652
- /**
1653
- * Annotation type identifier, always "url_citation"
1654
- */
1655
- type: 'url_citation';
1656
- /**
1657
- * URL of the referenced web resource
1658
- */
1659
1591
  url: string;
1592
+ type?: 'url_citation';
1660
1593
  }
1661
1594
  interface OpenAIResponseAnnotationContainerFileCitation {
1662
1595
  container_id: string;
@@ -1664,109 +1597,85 @@ export declare namespace ResponseListResponse {
1664
1597
  file_id: string;
1665
1598
  filename: string;
1666
1599
  start_index: number;
1667
- type: 'container_file_citation';
1600
+ type?: 'container_file_citation';
1668
1601
  }
1669
1602
  interface OpenAIResponseAnnotationFilePath {
1670
1603
  file_id: string;
1671
1604
  index: number;
1672
- type: 'file_path';
1605
+ type?: 'file_path';
1673
1606
  }
1674
1607
  }
1608
+ /**
1609
+ * Refusal content within a streamed response part.
1610
+ */
1611
+ interface OpenAIResponseContentPartRefusal {
1612
+ refusal: string;
1613
+ type?: 'refusal';
1614
+ }
1675
1615
  }
1676
1616
  /**
1677
1617
  * Corresponds to the various Message types in the Responses API. They are all
1678
1618
  * under one type because the Responses API gives them all the same "type" value,
1679
1619
  * and there is no way to tell them apart in certain scenarios.
1680
1620
  */
1681
- interface OpenAIResponseMessage {
1682
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
1621
+ interface OpenAIResponseMessageOutput {
1622
+ content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
1683
1623
  role: 'system' | 'developer' | 'user' | 'assistant';
1684
- type: 'message';
1685
- id?: string;
1686
- status?: string;
1624
+ id?: string | null;
1625
+ status?: string | null;
1626
+ type?: 'message';
1687
1627
  }
1688
- namespace OpenAIResponseMessage {
1628
+ namespace OpenAIResponseMessageOutput {
1689
1629
  /**
1690
1630
  * Text content for input messages in OpenAI response format.
1691
1631
  */
1692
1632
  interface OpenAIResponseInputMessageContentText {
1693
- /**
1694
- * The text content of the input message
1695
- */
1696
1633
  text: string;
1697
- /**
1698
- * Content type identifier, always "input_text"
1699
- */
1700
- type: 'input_text';
1634
+ type?: 'input_text';
1701
1635
  }
1702
1636
  /**
1703
1637
  * Image content for input messages in OpenAI response format.
1704
1638
  */
1705
1639
  interface OpenAIResponseInputMessageContentImage {
1706
- /**
1707
- * Level of detail for image processing, can be "low", "high", or "auto"
1708
- */
1709
- detail: 'low' | 'high' | 'auto';
1710
- /**
1711
- * Content type identifier, always "input_image"
1712
- */
1713
- type: 'input_image';
1714
- /**
1715
- * (Optional) URL of the image content
1716
- */
1717
- image_url?: string;
1640
+ detail?: 'low' | 'high' | 'auto';
1641
+ file_id?: string | null;
1642
+ image_url?: string | null;
1643
+ type?: 'input_image';
1718
1644
  }
1719
- interface UnionMember2 {
1720
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
1645
+ /**
1646
+ * File content for input messages in OpenAI response format.
1647
+ */
1648
+ interface OpenAIResponseInputMessageContentFile {
1649
+ file_data?: string | null;
1650
+ file_id?: string | null;
1651
+ file_url?: string | null;
1652
+ filename?: string | null;
1653
+ type?: 'input_file';
1654
+ }
1655
+ interface OpenAIResponseOutputMessageContentOutputText {
1721
1656
  text: string;
1722
- type: 'output_text';
1657
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
1658
+ type?: 'output_text';
1723
1659
  }
1724
- namespace UnionMember2 {
1660
+ namespace OpenAIResponseOutputMessageContentOutputText {
1725
1661
  /**
1726
1662
  * File citation annotation for referencing specific files in response content.
1727
1663
  */
1728
1664
  interface OpenAIResponseAnnotationFileCitation {
1729
- /**
1730
- * Unique identifier of the referenced file
1731
- */
1732
1665
  file_id: string;
1733
- /**
1734
- * Name of the referenced file
1735
- */
1736
1666
  filename: string;
1737
- /**
1738
- * Position index of the citation within the content
1739
- */
1740
1667
  index: number;
1741
- /**
1742
- * Annotation type identifier, always "file_citation"
1743
- */
1744
- type: 'file_citation';
1668
+ type?: 'file_citation';
1745
1669
  }
1746
1670
  /**
1747
1671
  * URL citation annotation for referencing external web resources.
1748
1672
  */
1749
1673
  interface OpenAIResponseAnnotationCitation {
1750
- /**
1751
- * End position of the citation span in the content
1752
- */
1753
1674
  end_index: number;
1754
- /**
1755
- * Start position of the citation span in the content
1756
- */
1757
1675
  start_index: number;
1758
- /**
1759
- * Title of the referenced web resource
1760
- */
1761
1676
  title: string;
1762
- /**
1763
- * Annotation type identifier, always "url_citation"
1764
- */
1765
- type: 'url_citation';
1766
- /**
1767
- * URL of the referenced web resource
1768
- */
1769
1677
  url: string;
1678
+ type?: 'url_citation';
1770
1679
  }
1771
1680
  interface OpenAIResponseAnnotationContainerFileCitation {
1772
1681
  container_id: string;
@@ -1774,83 +1683,51 @@ export declare namespace ResponseListResponse {
1774
1683
  file_id: string;
1775
1684
  filename: string;
1776
1685
  start_index: number;
1777
- type: 'container_file_citation';
1686
+ type?: 'container_file_citation';
1778
1687
  }
1779
1688
  interface OpenAIResponseAnnotationFilePath {
1780
1689
  file_id: string;
1781
1690
  index: number;
1782
- type: 'file_path';
1691
+ type?: 'file_path';
1783
1692
  }
1784
1693
  }
1694
+ /**
1695
+ * Refusal content within a streamed response part.
1696
+ */
1697
+ interface OpenAIResponseContentPartRefusal {
1698
+ refusal: string;
1699
+ type?: 'refusal';
1700
+ }
1785
1701
  }
1786
1702
  /**
1787
1703
  * Web search tool call output message for OpenAI responses.
1788
1704
  */
1789
1705
  interface OpenAIResponseOutputMessageWebSearchToolCall {
1790
- /**
1791
- * Unique identifier for this tool call
1792
- */
1793
1706
  id: string;
1794
- /**
1795
- * Current status of the web search operation
1796
- */
1797
1707
  status: string;
1798
- /**
1799
- * Tool call type identifier, always "web_search_call"
1800
- */
1801
- type: 'web_search_call';
1708
+ type?: 'web_search_call';
1802
1709
  }
1803
1710
  /**
1804
1711
  * File search tool call output message for OpenAI responses.
1805
1712
  */
1806
1713
  interface OpenAIResponseOutputMessageFileSearchToolCall {
1807
- /**
1808
- * Unique identifier for this tool call
1809
- */
1810
1714
  id: string;
1811
- /**
1812
- * List of search queries executed
1813
- */
1814
1715
  queries: Array<string>;
1815
- /**
1816
- * Current status of the file search operation
1817
- */
1818
1716
  status: string;
1819
- /**
1820
- * Tool call type identifier, always "file_search_call"
1821
- */
1822
- type: 'file_search_call';
1823
- /**
1824
- * (Optional) Search results returned by the file search operation
1825
- */
1826
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
1717
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
1718
+ type?: 'file_search_call';
1827
1719
  }
1828
1720
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
1829
1721
  /**
1830
1722
  * Search results returned by the file search operation.
1831
1723
  */
1832
1724
  interface Result {
1833
- /**
1834
- * (Optional) Key-value attributes associated with the file
1835
- */
1836
1725
  attributes: {
1837
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
1726
+ [key: string]: unknown;
1838
1727
  };
1839
- /**
1840
- * Unique identifier of the file containing the result
1841
- */
1842
1728
  file_id: string;
1843
- /**
1844
- * Name of the file containing the result
1845
- */
1846
1729
  filename: string;
1847
- /**
1848
- * Relevance score for this search result (between 0 and 1)
1849
- */
1850
1730
  score: number;
1851
- /**
1852
- * Text content of the search result
1853
- */
1854
1731
  text: string;
1855
1732
  }
1856
1733
  }
@@ -1858,277 +1735,368 @@ export declare namespace ResponseListResponse {
1858
1735
  * Function tool call output message for OpenAI responses.
1859
1736
  */
1860
1737
  interface OpenAIResponseOutputMessageFunctionToolCall {
1861
- /**
1862
- * JSON string containing the function arguments
1863
- */
1864
1738
  arguments: string;
1865
- /**
1866
- * Unique identifier for the function call
1867
- */
1868
1739
  call_id: string;
1869
- /**
1870
- * Name of the function being called
1871
- */
1872
1740
  name: string;
1873
- /**
1874
- * Tool call type identifier, always "function_call"
1875
- */
1876
- type: 'function_call';
1877
- /**
1878
- * (Optional) Additional identifier for the tool call
1879
- */
1880
- id?: string;
1881
- /**
1882
- * (Optional) Current status of the function call execution
1883
- */
1884
- status?: string;
1741
+ id?: string | null;
1742
+ status?: string | null;
1743
+ type?: 'function_call';
1885
1744
  }
1886
1745
  /**
1887
1746
  * Model Context Protocol (MCP) call output message for OpenAI responses.
1888
1747
  */
1889
1748
  interface OpenAIResponseOutputMessageMcpCall {
1890
- /**
1891
- * Unique identifier for this MCP call
1892
- */
1893
1749
  id: string;
1894
- /**
1895
- * JSON string containing the MCP call arguments
1896
- */
1897
1750
  arguments: string;
1898
- /**
1899
- * Name of the MCP method being called
1900
- */
1901
1751
  name: string;
1902
- /**
1903
- * Label identifying the MCP server handling the call
1904
- */
1905
1752
  server_label: string;
1906
- /**
1907
- * Tool call type identifier, always "mcp_call"
1908
- */
1909
- type: 'mcp_call';
1910
- /**
1911
- * (Optional) Error message if the MCP call failed
1912
- */
1913
- error?: string;
1914
- /**
1915
- * (Optional) Output result from the successful MCP call
1916
- */
1917
- output?: string;
1753
+ error?: string | null;
1754
+ output?: string | null;
1755
+ type?: 'mcp_call';
1918
1756
  }
1919
1757
  /**
1920
1758
  * MCP list tools output message containing available tools from an MCP server.
1921
1759
  */
1922
1760
  interface OpenAIResponseOutputMessageMcpListTools {
1923
- /**
1924
- * Unique identifier for this MCP list tools operation
1925
- */
1926
1761
  id: string;
1927
- /**
1928
- * Label identifying the MCP server providing the tools
1929
- */
1930
1762
  server_label: string;
1931
- /**
1932
- * List of available tools provided by the MCP server
1933
- */
1934
1763
  tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
1935
- /**
1936
- * Tool call type identifier, always "mcp_list_tools"
1937
- */
1938
- type: 'mcp_list_tools';
1764
+ type?: 'mcp_list_tools';
1939
1765
  }
1940
1766
  namespace OpenAIResponseOutputMessageMcpListTools {
1941
1767
  /**
1942
1768
  * Tool definition returned by MCP list tools operation.
1943
1769
  */
1944
1770
  interface Tool {
1945
- /**
1946
- * JSON schema defining the tool's input parameters
1947
- */
1948
1771
  input_schema: {
1949
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
1772
+ [key: string]: unknown;
1950
1773
  };
1951
- /**
1952
- * Name of the tool
1953
- */
1954
1774
  name: string;
1955
- /**
1956
- * (Optional) Description of what the tool does
1957
- */
1958
- description?: string;
1775
+ description?: string | null;
1776
+ }
1777
+ }
1778
+ /**
1779
+ * A request for human approval of a tool invocation.
1780
+ */
1781
+ interface OpenAIResponseMcpApprovalRequest {
1782
+ id: string;
1783
+ arguments: string;
1784
+ name: string;
1785
+ server_label: string;
1786
+ type?: 'mcp_approval_request';
1787
+ }
1788
+ /**
1789
+ * Error details for failed OpenAI response requests.
1790
+ */
1791
+ interface Error {
1792
+ code: string;
1793
+ message: string;
1794
+ }
1795
+ /**
1796
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
1797
+ */
1798
+ interface Prompt {
1799
+ id: string;
1800
+ variables?: {
1801
+ [key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
1802
+ } | null;
1803
+ version?: string | null;
1804
+ }
1805
+ namespace Prompt {
1806
+ /**
1807
+ * Text content for input messages in OpenAI response format.
1808
+ */
1809
+ interface OpenAIResponseInputMessageContentText {
1810
+ text: string;
1811
+ type?: 'input_text';
1812
+ }
1813
+ /**
1814
+ * Image content for input messages in OpenAI response format.
1815
+ */
1816
+ interface OpenAIResponseInputMessageContentImage {
1817
+ detail?: 'low' | 'high' | 'auto';
1818
+ file_id?: string | null;
1819
+ image_url?: string | null;
1820
+ type?: 'input_image';
1821
+ }
1822
+ /**
1823
+ * File content for input messages in OpenAI response format.
1824
+ */
1825
+ interface OpenAIResponseInputMessageContentFile {
1826
+ file_data?: string | null;
1827
+ file_id?: string | null;
1828
+ file_url?: string | null;
1829
+ filename?: string | null;
1830
+ type?: 'input_file';
1959
1831
  }
1960
1832
  }
1961
1833
  /**
1962
- * Text formatting configuration for the response
1834
+ * Text response configuration for OpenAI responses.
1963
1835
  */
1964
1836
  interface Text {
1965
1837
  /**
1966
- * (Optional) Text format configuration specifying output format requirements
1838
+ * Configuration for Responses API text format.
1967
1839
  */
1968
- format?: Text.Format;
1840
+ format?: Text.Format | null;
1969
1841
  }
1970
1842
  namespace Text {
1971
1843
  /**
1972
- * (Optional) Text format configuration specifying output format requirements
1844
+ * Configuration for Responses API text format.
1973
1845
  */
1974
1846
  interface Format {
1975
- /**
1976
- * Must be "text", "json_schema", or "json_object" to identify the format type
1977
- */
1978
- type: 'text' | 'json_schema' | 'json_object';
1979
- /**
1980
- * (Optional) A description of the response format. Only used for json_schema.
1981
- */
1982
- description?: string;
1983
- /**
1984
- * The name of the response format. Only used for json_schema.
1985
- */
1986
- name?: string;
1987
- /**
1988
- * The JSON schema the response should conform to. In a Python SDK, this is often a
1989
- * `pydantic` model. Only used for json_schema.
1990
- */
1847
+ description?: string | null;
1848
+ name?: string | null;
1991
1849
  schema?: {
1992
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
1993
- };
1994
- /**
1995
- * (Optional) Whether to strictly enforce the JSON schema. If true, the response
1996
- * must match the schema exactly. Only used for json_schema.
1997
- */
1998
- strict?: boolean;
1850
+ [key: string]: unknown;
1851
+ } | null;
1852
+ strict?: boolean | null;
1853
+ type?: 'text' | 'json_schema' | 'json_object';
1999
1854
  }
2000
1855
  }
2001
1856
  /**
2002
- * (Optional) Error details if the response generation failed
1857
+ * Web search tool configuration for OpenAI response inputs.
2003
1858
  */
2004
- interface Error {
1859
+ interface OpenAIResponseInputToolWebSearch {
1860
+ search_context_size?: string | null;
1861
+ type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
1862
+ }
1863
+ /**
1864
+ * File search tool configuration for OpenAI response inputs.
1865
+ */
1866
+ interface OpenAIResponseInputToolFileSearch {
1867
+ vector_store_ids: Array<string>;
1868
+ filters?: {
1869
+ [key: string]: unknown;
1870
+ } | null;
1871
+ max_num_results?: number | null;
2005
1872
  /**
2006
- * Error code identifying the type of failure
1873
+ * Options for ranking and filtering search results.
2007
1874
  */
2008
- code: string;
1875
+ ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
1876
+ type?: 'file_search';
1877
+ }
1878
+ namespace OpenAIResponseInputToolFileSearch {
2009
1879
  /**
2010
- * Human-readable error message describing the failure
1880
+ * Options for ranking and filtering search results.
2011
1881
  */
2012
- message: string;
1882
+ interface RankingOptions {
1883
+ ranker?: string | null;
1884
+ score_threshold?: number | null;
1885
+ }
2013
1886
  }
2014
- }
2015
- /**
2016
- * Response object confirming deletion of an OpenAI response.
2017
- */
2018
- export interface ResponseDeleteResponse {
2019
1887
  /**
2020
- * Unique identifier of the deleted response
1888
+ * Function tool configuration for OpenAI response inputs.
2021
1889
  */
2022
- id: string;
1890
+ interface OpenAIResponseInputToolFunction {
1891
+ name: string;
1892
+ parameters: {
1893
+ [key: string]: unknown;
1894
+ } | null;
1895
+ description?: string | null;
1896
+ strict?: boolean | null;
1897
+ type?: 'function';
1898
+ }
2023
1899
  /**
2024
- * Deletion confirmation flag, always True
1900
+ * Model Context Protocol (MCP) tool configuration for OpenAI response object.
2025
1901
  */
2026
- deleted: boolean;
1902
+ interface OpenAIResponseToolMcp {
1903
+ server_label: string;
1904
+ /**
1905
+ * Filter configuration for restricting which MCP tools can be used.
1906
+ */
1907
+ allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
1908
+ type?: 'mcp';
1909
+ }
1910
+ namespace OpenAIResponseToolMcp {
1911
+ /**
1912
+ * Filter configuration for restricting which MCP tools can be used.
1913
+ */
1914
+ interface AllowedToolsFilter {
1915
+ tool_names?: Array<string> | null;
1916
+ }
1917
+ }
2027
1918
  /**
2028
- * Object type identifier, always "response"
1919
+ * Usage information for OpenAI response.
2029
1920
  */
2030
- object: 'response';
1921
+ interface Usage {
1922
+ input_tokens: number;
1923
+ output_tokens: number;
1924
+ total_tokens: number;
1925
+ /**
1926
+ * Token details for input tokens in OpenAI response usage.
1927
+ */
1928
+ input_tokens_details?: Usage.InputTokensDetails | null;
1929
+ /**
1930
+ * Token details for output tokens in OpenAI response usage.
1931
+ */
1932
+ output_tokens_details?: Usage.OutputTokensDetails | null;
1933
+ }
1934
+ namespace Usage {
1935
+ /**
1936
+ * Token details for input tokens in OpenAI response usage.
1937
+ */
1938
+ interface InputTokensDetails {
1939
+ cached_tokens?: number | null;
1940
+ }
1941
+ /**
1942
+ * Token details for output tokens in OpenAI response usage.
1943
+ */
1944
+ interface OutputTokensDetails {
1945
+ reasoning_tokens?: number | null;
1946
+ }
1947
+ }
1948
+ }
1949
+ /**
1950
+ * Response object confirming deletion of an OpenAI response.
1951
+ */
1952
+ export interface ResponseDeleteResponse {
1953
+ id: string;
1954
+ deleted?: boolean;
1955
+ object?: 'response';
2031
1956
  }
2032
1957
  export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCreateParamsStreaming;
2033
1958
  export interface ResponseCreateParamsBase {
2034
- /**
2035
- * Input message(s) to create the response.
2036
- */
2037
- input: string | Array<ResponseCreateParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCreateParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCreateParams.OpenAIResponseMessage>;
2038
- /**
2039
- * The underlying LLM used for completions.
2040
- */
1959
+ input: string | Array<ResponseCreateParams.OpenAIResponseMessageInput | ResponseCreateParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpListTools | ResponseCreateParams.OpenAIResponseMcpApprovalRequest | ResponseCreateParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCreateParams.OpenAIResponseMcpApprovalResponse | ResponseCreateParams.OpenAIResponseMessageInput>;
2041
1960
  model: string;
2042
- /**
2043
- * (Optional) Additional fields to include in the response.
2044
- */
2045
- include?: Array<string>;
2046
- instructions?: string;
2047
- max_infer_iters?: number;
2048
- /**
2049
- * (Optional) if specified, the new response will be a continuation of the previous
2050
- * response. This can be used to easily fork-off new responses from existing
2051
- * responses.
2052
- */
2053
- previous_response_id?: string;
2054
- store?: boolean;
2055
- stream?: boolean;
2056
- temperature?: number;
1961
+ conversation?: string | null;
1962
+ include?: Array<string> | null;
1963
+ instructions?: string | null;
1964
+ max_infer_iters?: number | null;
1965
+ max_tool_calls?: number | null;
1966
+ metadata?: {
1967
+ [key: string]: string;
1968
+ } | null;
1969
+ parallel_tool_calls?: boolean | null;
1970
+ previous_response_id?: string | null;
1971
+ /**
1972
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
1973
+ */
1974
+ prompt?: ResponseCreateParams.Prompt | null;
1975
+ store?: boolean | null;
1976
+ stream?: boolean | null;
1977
+ temperature?: number | null;
2057
1978
  /**
2058
1979
  * Text response configuration for OpenAI responses.
2059
1980
  */
2060
- text?: ResponseCreateParams.Text;
2061
- tools?: Array<ResponseCreateParams.OpenAIResponseInputToolWebSearch | ResponseCreateParams.OpenAIResponseInputToolFileSearch | ResponseCreateParams.OpenAIResponseInputToolFunction | ResponseCreateParams.OpenAIResponseInputToolMcp>;
1981
+ text?: ResponseCreateParams.Text | null;
1982
+ tools?: Array<ResponseCreateParams.OpenAIResponseInputToolWebSearch | ResponseCreateParams.OpenAIResponseInputToolFileSearch | ResponseCreateParams.OpenAIResponseInputToolFunction | ResponseCreateParams.OpenAIResponseInputToolMcp> | null;
2062
1983
  }
2063
1984
  export declare namespace ResponseCreateParams {
2064
1985
  /**
2065
- * Web search tool call output message for OpenAI responses.
1986
+ * Corresponds to the various Message types in the Responses API. They are all
1987
+ * under one type because the Responses API gives them all the same "type" value,
1988
+ * and there is no way to tell them apart in certain scenarios.
2066
1989
  */
2067
- interface OpenAIResponseOutputMessageWebSearchToolCall {
1990
+ interface OpenAIResponseMessageInput {
1991
+ content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
1992
+ role: 'system' | 'developer' | 'user' | 'assistant';
1993
+ id?: string | null;
1994
+ status?: string | null;
1995
+ type?: 'message';
1996
+ }
1997
+ namespace OpenAIResponseMessageInput {
2068
1998
  /**
2069
- * Unique identifier for this tool call
1999
+ * Text content for input messages in OpenAI response format.
2070
2000
  */
2071
- id: string;
2001
+ interface OpenAIResponseInputMessageContentText {
2002
+ text: string;
2003
+ type?: 'input_text';
2004
+ }
2005
+ /**
2006
+ * Image content for input messages in OpenAI response format.
2007
+ */
2008
+ interface OpenAIResponseInputMessageContentImage {
2009
+ detail?: 'low' | 'high' | 'auto';
2010
+ file_id?: string | null;
2011
+ image_url?: string | null;
2012
+ type?: 'input_image';
2013
+ }
2072
2014
  /**
2073
- * Current status of the web search operation
2015
+ * File content for input messages in OpenAI response format.
2074
2016
  */
2075
- status: string;
2017
+ interface OpenAIResponseInputMessageContentFile {
2018
+ file_data?: string | null;
2019
+ file_id?: string | null;
2020
+ file_url?: string | null;
2021
+ filename?: string | null;
2022
+ type?: 'input_file';
2023
+ }
2024
+ interface OpenAIResponseOutputMessageContentOutputText {
2025
+ text: string;
2026
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
2027
+ type?: 'output_text';
2028
+ }
2029
+ namespace OpenAIResponseOutputMessageContentOutputText {
2030
+ /**
2031
+ * File citation annotation for referencing specific files in response content.
2032
+ */
2033
+ interface OpenAIResponseAnnotationFileCitation {
2034
+ file_id: string;
2035
+ filename: string;
2036
+ index: number;
2037
+ type?: 'file_citation';
2038
+ }
2039
+ /**
2040
+ * URL citation annotation for referencing external web resources.
2041
+ */
2042
+ interface OpenAIResponseAnnotationCitation {
2043
+ end_index: number;
2044
+ start_index: number;
2045
+ title: string;
2046
+ url: string;
2047
+ type?: 'url_citation';
2048
+ }
2049
+ interface OpenAIResponseAnnotationContainerFileCitation {
2050
+ container_id: string;
2051
+ end_index: number;
2052
+ file_id: string;
2053
+ filename: string;
2054
+ start_index: number;
2055
+ type?: 'container_file_citation';
2056
+ }
2057
+ interface OpenAIResponseAnnotationFilePath {
2058
+ file_id: string;
2059
+ index: number;
2060
+ type?: 'file_path';
2061
+ }
2062
+ }
2076
2063
  /**
2077
- * Tool call type identifier, always "web_search_call"
2064
+ * Refusal content within a streamed response part.
2078
2065
  */
2079
- type: 'web_search_call';
2066
+ interface OpenAIResponseContentPartRefusal {
2067
+ refusal: string;
2068
+ type?: 'refusal';
2069
+ }
2070
+ }
2071
+ /**
2072
+ * Web search tool call output message for OpenAI responses.
2073
+ */
2074
+ interface OpenAIResponseOutputMessageWebSearchToolCall {
2075
+ id: string;
2076
+ status: string;
2077
+ type?: 'web_search_call';
2080
2078
  }
2081
2079
  /**
2082
2080
  * File search tool call output message for OpenAI responses.
2083
2081
  */
2084
2082
  interface OpenAIResponseOutputMessageFileSearchToolCall {
2085
- /**
2086
- * Unique identifier for this tool call
2087
- */
2088
2083
  id: string;
2089
- /**
2090
- * List of search queries executed
2091
- */
2092
2084
  queries: Array<string>;
2093
- /**
2094
- * Current status of the file search operation
2095
- */
2096
2085
  status: string;
2097
- /**
2098
- * Tool call type identifier, always "file_search_call"
2099
- */
2100
- type: 'file_search_call';
2101
- /**
2102
- * (Optional) Search results returned by the file search operation
2103
- */
2104
- results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
2086
+ results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
2087
+ type?: 'file_search_call';
2105
2088
  }
2106
2089
  namespace OpenAIResponseOutputMessageFileSearchToolCall {
2107
2090
  /**
2108
2091
  * Search results returned by the file search operation.
2109
2092
  */
2110
2093
  interface Result {
2111
- /**
2112
- * (Optional) Key-value attributes associated with the file
2113
- */
2114
2094
  attributes: {
2115
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
2095
+ [key: string]: unknown;
2116
2096
  };
2117
- /**
2118
- * Unique identifier of the file containing the result
2119
- */
2120
2097
  file_id: string;
2121
- /**
2122
- * Name of the file containing the result
2123
- */
2124
2098
  filename: string;
2125
- /**
2126
- * Relevance score for this search result (between 0 and 1)
2127
- */
2128
2099
  score: number;
2129
- /**
2130
- * Text content of the search result
2131
- */
2132
2100
  text: string;
2133
2101
  }
2134
2102
  }
@@ -2136,30 +2104,55 @@ export declare namespace ResponseCreateParams {
2136
2104
  * Function tool call output message for OpenAI responses.
2137
2105
  */
2138
2106
  interface OpenAIResponseOutputMessageFunctionToolCall {
2139
- /**
2140
- * JSON string containing the function arguments
2141
- */
2142
2107
  arguments: string;
2143
- /**
2144
- * Unique identifier for the function call
2145
- */
2146
2108
  call_id: string;
2147
- /**
2148
- * Name of the function being called
2149
- */
2150
2109
  name: string;
2110
+ id?: string | null;
2111
+ status?: string | null;
2112
+ type?: 'function_call';
2113
+ }
2114
+ /**
2115
+ * Model Context Protocol (MCP) call output message for OpenAI responses.
2116
+ */
2117
+ interface OpenAIResponseOutputMessageMcpCall {
2118
+ id: string;
2119
+ arguments: string;
2120
+ name: string;
2121
+ server_label: string;
2122
+ error?: string | null;
2123
+ output?: string | null;
2124
+ type?: 'mcp_call';
2125
+ }
2126
+ /**
2127
+ * MCP list tools output message containing available tools from an MCP server.
2128
+ */
2129
+ interface OpenAIResponseOutputMessageMcpListTools {
2130
+ id: string;
2131
+ server_label: string;
2132
+ tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
2133
+ type?: 'mcp_list_tools';
2134
+ }
2135
+ namespace OpenAIResponseOutputMessageMcpListTools {
2151
2136
  /**
2152
- * Tool call type identifier, always "function_call"
2153
- */
2154
- type: 'function_call';
2155
- /**
2156
- * (Optional) Additional identifier for the tool call
2157
- */
2158
- id?: string;
2159
- /**
2160
- * (Optional) Current status of the function call execution
2137
+ * Tool definition returned by MCP list tools operation.
2161
2138
  */
2162
- status?: string;
2139
+ interface Tool {
2140
+ input_schema: {
2141
+ [key: string]: unknown;
2142
+ };
2143
+ name: string;
2144
+ description?: string | null;
2145
+ }
2146
+ }
2147
+ /**
2148
+ * A request for human approval of a tool invocation.
2149
+ */
2150
+ interface OpenAIResponseMcpApprovalRequest {
2151
+ id: string;
2152
+ arguments: string;
2153
+ name: string;
2154
+ server_label: string;
2155
+ type?: 'mcp_approval_request';
2163
2156
  }
2164
2157
  /**
2165
2158
  * This represents the output of a function call that gets passed back to the
@@ -2168,104 +2161,83 @@ export declare namespace ResponseCreateParams {
2168
2161
  interface OpenAIResponseInputFunctionToolCallOutput {
2169
2162
  call_id: string;
2170
2163
  output: string;
2171
- type: 'function_call_output';
2172
- id?: string;
2173
- status?: string;
2164
+ id?: string | null;
2165
+ status?: string | null;
2166
+ type?: 'function_call_output';
2167
+ }
2168
+ /**
2169
+ * A response to an MCP approval request.
2170
+ */
2171
+ interface OpenAIResponseMcpApprovalResponse {
2172
+ approval_request_id: string;
2173
+ approve: boolean;
2174
+ id?: string | null;
2175
+ reason?: string | null;
2176
+ type?: 'mcp_approval_response';
2174
2177
  }
2175
2178
  /**
2176
2179
  * Corresponds to the various Message types in the Responses API. They are all
2177
2180
  * under one type because the Responses API gives them all the same "type" value,
2178
2181
  * and there is no way to tell them apart in certain scenarios.
2179
2182
  */
2180
- interface OpenAIResponseMessage {
2181
- content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.UnionMember2>;
2183
+ interface OpenAIResponseMessageInput {
2184
+ content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
2182
2185
  role: 'system' | 'developer' | 'user' | 'assistant';
2183
- type: 'message';
2184
- id?: string;
2185
- status?: string;
2186
+ id?: string | null;
2187
+ status?: string | null;
2188
+ type?: 'message';
2186
2189
  }
2187
- namespace OpenAIResponseMessage {
2190
+ namespace OpenAIResponseMessageInput {
2188
2191
  /**
2189
2192
  * Text content for input messages in OpenAI response format.
2190
2193
  */
2191
2194
  interface OpenAIResponseInputMessageContentText {
2192
- /**
2193
- * The text content of the input message
2194
- */
2195
2195
  text: string;
2196
- /**
2197
- * Content type identifier, always "input_text"
2198
- */
2199
- type: 'input_text';
2196
+ type?: 'input_text';
2200
2197
  }
2201
2198
  /**
2202
2199
  * Image content for input messages in OpenAI response format.
2203
2200
  */
2204
2201
  interface OpenAIResponseInputMessageContentImage {
2205
- /**
2206
- * Level of detail for image processing, can be "low", "high", or "auto"
2207
- */
2208
- detail: 'low' | 'high' | 'auto';
2209
- /**
2210
- * Content type identifier, always "input_image"
2211
- */
2212
- type: 'input_image';
2213
- /**
2214
- * (Optional) URL of the image content
2215
- */
2216
- image_url?: string;
2202
+ detail?: 'low' | 'high' | 'auto';
2203
+ file_id?: string | null;
2204
+ image_url?: string | null;
2205
+ type?: 'input_image';
2206
+ }
2207
+ /**
2208
+ * File content for input messages in OpenAI response format.
2209
+ */
2210
+ interface OpenAIResponseInputMessageContentFile {
2211
+ file_data?: string | null;
2212
+ file_id?: string | null;
2213
+ file_url?: string | null;
2214
+ filename?: string | null;
2215
+ type?: 'input_file';
2217
2216
  }
2218
- interface UnionMember2 {
2219
- annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
2217
+ interface OpenAIResponseOutputMessageContentOutputText {
2220
2218
  text: string;
2221
- type: 'output_text';
2219
+ annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
2220
+ type?: 'output_text';
2222
2221
  }
2223
- namespace UnionMember2 {
2222
+ namespace OpenAIResponseOutputMessageContentOutputText {
2224
2223
  /**
2225
2224
  * File citation annotation for referencing specific files in response content.
2226
2225
  */
2227
2226
  interface OpenAIResponseAnnotationFileCitation {
2228
- /**
2229
- * Unique identifier of the referenced file
2230
- */
2231
2227
  file_id: string;
2232
- /**
2233
- * Name of the referenced file
2234
- */
2235
2228
  filename: string;
2236
- /**
2237
- * Position index of the citation within the content
2238
- */
2239
2229
  index: number;
2240
- /**
2241
- * Annotation type identifier, always "file_citation"
2242
- */
2243
- type: 'file_citation';
2230
+ type?: 'file_citation';
2244
2231
  }
2245
2232
  /**
2246
2233
  * URL citation annotation for referencing external web resources.
2247
2234
  */
2248
2235
  interface OpenAIResponseAnnotationCitation {
2249
- /**
2250
- * End position of the citation span in the content
2251
- */
2252
2236
  end_index: number;
2253
- /**
2254
- * Start position of the citation span in the content
2255
- */
2256
2237
  start_index: number;
2257
- /**
2258
- * Title of the referenced web resource
2259
- */
2260
2238
  title: string;
2261
- /**
2262
- * Annotation type identifier, always "url_citation"
2263
- */
2264
- type: 'url_citation';
2265
- /**
2266
- * URL of the referenced web resource
2267
- */
2268
2239
  url: string;
2240
+ type?: 'url_citation';
2269
2241
  }
2270
2242
  interface OpenAIResponseAnnotationContainerFileCitation {
2271
2243
  container_id: string;
@@ -2273,210 +2245,176 @@ export declare namespace ResponseCreateParams {
2273
2245
  file_id: string;
2274
2246
  filename: string;
2275
2247
  start_index: number;
2276
- type: 'container_file_citation';
2248
+ type?: 'container_file_citation';
2277
2249
  }
2278
2250
  interface OpenAIResponseAnnotationFilePath {
2279
2251
  file_id: string;
2280
2252
  index: number;
2281
- type: 'file_path';
2253
+ type?: 'file_path';
2282
2254
  }
2283
2255
  }
2256
+ /**
2257
+ * Refusal content within a streamed response part.
2258
+ */
2259
+ interface OpenAIResponseContentPartRefusal {
2260
+ refusal: string;
2261
+ type?: 'refusal';
2262
+ }
2263
+ }
2264
+ /**
2265
+ * OpenAI compatible Prompt object that is used in OpenAI responses.
2266
+ */
2267
+ interface Prompt {
2268
+ id: string;
2269
+ variables?: {
2270
+ [key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
2271
+ } | null;
2272
+ version?: string | null;
2273
+ }
2274
+ namespace Prompt {
2275
+ /**
2276
+ * Text content for input messages in OpenAI response format.
2277
+ */
2278
+ interface OpenAIResponseInputMessageContentText {
2279
+ text: string;
2280
+ type?: 'input_text';
2281
+ }
2282
+ /**
2283
+ * Image content for input messages in OpenAI response format.
2284
+ */
2285
+ interface OpenAIResponseInputMessageContentImage {
2286
+ detail?: 'low' | 'high' | 'auto';
2287
+ file_id?: string | null;
2288
+ image_url?: string | null;
2289
+ type?: 'input_image';
2290
+ }
2291
+ /**
2292
+ * File content for input messages in OpenAI response format.
2293
+ */
2294
+ interface OpenAIResponseInputMessageContentFile {
2295
+ file_data?: string | null;
2296
+ file_id?: string | null;
2297
+ file_url?: string | null;
2298
+ filename?: string | null;
2299
+ type?: 'input_file';
2300
+ }
2284
2301
  }
2285
2302
  /**
2286
2303
  * Text response configuration for OpenAI responses.
2287
2304
  */
2288
2305
  interface Text {
2289
2306
  /**
2290
- * (Optional) Text format configuration specifying output format requirements
2307
+ * Configuration for Responses API text format.
2291
2308
  */
2292
- format?: Text.Format;
2309
+ format?: Text.Format | null;
2293
2310
  }
2294
2311
  namespace Text {
2295
2312
  /**
2296
- * (Optional) Text format configuration specifying output format requirements
2313
+ * Configuration for Responses API text format.
2297
2314
  */
2298
2315
  interface Format {
2299
- /**
2300
- * Must be "text", "json_schema", or "json_object" to identify the format type
2301
- */
2302
- type: 'text' | 'json_schema' | 'json_object';
2303
- /**
2304
- * (Optional) A description of the response format. Only used for json_schema.
2305
- */
2306
- description?: string;
2307
- /**
2308
- * The name of the response format. Only used for json_schema.
2309
- */
2310
- name?: string;
2311
- /**
2312
- * The JSON schema the response should conform to. In a Python SDK, this is often a
2313
- * `pydantic` model. Only used for json_schema.
2314
- */
2316
+ description?: string | null;
2317
+ name?: string | null;
2315
2318
  schema?: {
2316
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
2317
- };
2318
- /**
2319
- * (Optional) Whether to strictly enforce the JSON schema. If true, the response
2320
- * must match the schema exactly. Only used for json_schema.
2321
- */
2322
- strict?: boolean;
2319
+ [key: string]: unknown;
2320
+ } | null;
2321
+ strict?: boolean | null;
2322
+ type?: 'text' | 'json_schema' | 'json_object';
2323
2323
  }
2324
2324
  }
2325
2325
  /**
2326
2326
  * Web search tool configuration for OpenAI response inputs.
2327
2327
  */
2328
2328
  interface OpenAIResponseInputToolWebSearch {
2329
- /**
2330
- * Web search tool type variant to use
2331
- */
2332
- type: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11';
2333
- /**
2334
- * (Optional) Size of search context, must be "low", "medium", or "high"
2335
- */
2336
- search_context_size?: string;
2329
+ search_context_size?: string | null;
2330
+ type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
2337
2331
  }
2338
2332
  /**
2339
2333
  * File search tool configuration for OpenAI response inputs.
2340
2334
  */
2341
2335
  interface OpenAIResponseInputToolFileSearch {
2342
- /**
2343
- * Tool type identifier, always "file_search"
2344
- */
2345
- type: 'file_search';
2346
- /**
2347
- * List of vector store identifiers to search within
2348
- */
2349
2336
  vector_store_ids: Array<string>;
2350
- /**
2351
- * (Optional) Additional filters to apply to the search
2352
- */
2353
2337
  filters?: {
2354
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
2355
- };
2338
+ [key: string]: unknown;
2339
+ } | null;
2340
+ max_num_results?: number | null;
2356
2341
  /**
2357
- * (Optional) Maximum number of search results to return (1-50)
2342
+ * Options for ranking and filtering search results.
2358
2343
  */
2359
- max_num_results?: number;
2360
- /**
2361
- * (Optional) Options for ranking and scoring search results
2362
- */
2363
- ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions;
2344
+ ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
2345
+ type?: 'file_search';
2364
2346
  }
2365
2347
  namespace OpenAIResponseInputToolFileSearch {
2366
2348
  /**
2367
- * (Optional) Options for ranking and scoring search results
2349
+ * Options for ranking and filtering search results.
2368
2350
  */
2369
2351
  interface RankingOptions {
2370
- /**
2371
- * (Optional) Name of the ranking algorithm to use
2372
- */
2373
- ranker?: string;
2374
- /**
2375
- * (Optional) Minimum relevance score threshold for results
2376
- */
2377
- score_threshold?: number;
2352
+ ranker?: string | null;
2353
+ score_threshold?: number | null;
2378
2354
  }
2379
2355
  }
2380
2356
  /**
2381
2357
  * Function tool configuration for OpenAI response inputs.
2382
2358
  */
2383
2359
  interface OpenAIResponseInputToolFunction {
2384
- /**
2385
- * Name of the function that can be called
2386
- */
2387
2360
  name: string;
2388
- /**
2389
- * Tool type identifier, always "function"
2390
- */
2391
- type: 'function';
2392
- /**
2393
- * (Optional) Description of what the function does
2394
- */
2395
- description?: string;
2396
- /**
2397
- * (Optional) JSON schema defining the function's parameters
2398
- */
2399
- parameters?: {
2400
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
2401
- };
2402
- /**
2403
- * (Optional) Whether to enforce strict parameter validation
2404
- */
2405
- strict?: boolean;
2361
+ parameters: {
2362
+ [key: string]: unknown;
2363
+ } | null;
2364
+ description?: string | null;
2365
+ strict?: boolean | null;
2366
+ type?: 'function';
2406
2367
  }
2407
2368
  /**
2408
2369
  * Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
2409
2370
  */
2410
2371
  interface OpenAIResponseInputToolMcp {
2411
- /**
2412
- * Approval requirement for tool calls ("always", "never", or filter)
2413
- */
2414
- require_approval: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
2415
- /**
2416
- * Label to identify this MCP server
2417
- */
2418
2372
  server_label: string;
2419
- /**
2420
- * URL endpoint of the MCP server
2421
- */
2422
2373
  server_url: string;
2423
2374
  /**
2424
- * Tool type identifier, always "mcp"
2425
- */
2426
- type: 'mcp';
2427
- /**
2428
- * (Optional) Restriction on which tools can be used from this server
2375
+ * Filter configuration for restricting which MCP tools can be used.
2429
2376
  */
2430
- allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter;
2377
+ allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter | null;
2378
+ authorization?: string | null;
2379
+ headers?: {
2380
+ [key: string]: unknown;
2381
+ } | null;
2431
2382
  /**
2432
- * (Optional) HTTP headers to include when connecting to the server
2383
+ * Filter configuration for MCP tool approval requirements.
2433
2384
  */
2434
- headers?: {
2435
- [key: string]: boolean | number | string | Array<unknown> | unknown | null;
2436
- };
2385
+ require_approval?: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
2386
+ type?: 'mcp';
2437
2387
  }
2438
2388
  namespace OpenAIResponseInputToolMcp {
2439
2389
  /**
2440
- * Filter configuration for MCP tool approval requirements.
2390
+ * Filter configuration for restricting which MCP tools can be used.
2441
2391
  */
2442
- interface ApprovalFilter {
2443
- /**
2444
- * (Optional) List of tool names that always require approval
2445
- */
2446
- always?: Array<string>;
2447
- /**
2448
- * (Optional) List of tool names that never require approval
2449
- */
2450
- never?: Array<string>;
2392
+ interface AllowedToolsFilter {
2393
+ tool_names?: Array<string> | null;
2451
2394
  }
2452
2395
  /**
2453
- * Filter configuration for restricting which MCP tools can be used.
2396
+ * Filter configuration for MCP tool approval requirements.
2454
2397
  */
2455
- interface AllowedToolsFilter {
2456
- /**
2457
- * (Optional) List of specific tool names that are allowed
2458
- */
2459
- tool_names?: Array<string>;
2398
+ interface ApprovalFilter {
2399
+ always?: Array<string> | null;
2400
+ never?: Array<string> | null;
2460
2401
  }
2461
2402
  }
2462
2403
  type ResponseCreateParamsNonStreaming = ResponsesAPI.ResponseCreateParamsNonStreaming;
2463
2404
  type ResponseCreateParamsStreaming = ResponsesAPI.ResponseCreateParamsStreaming;
2464
2405
  }
2465
2406
  export interface ResponseCreateParamsNonStreaming extends ResponseCreateParamsBase {
2466
- stream?: false;
2407
+ stream?: false | null;
2467
2408
  }
2468
2409
  export interface ResponseCreateParamsStreaming extends ResponseCreateParamsBase {
2469
2410
  stream: true;
2470
2411
  }
2471
2412
  export interface ResponseListParams extends OpenAICursorPageParams {
2413
+ model?: string | null;
2472
2414
  /**
2473
- * The model to filter responses by.
2474
- */
2475
- model?: string;
2476
- /**
2477
- * The order to sort responses by when sorted by created_at ('asc' or 'desc').
2415
+ * Sort order for paginated responses.
2478
2416
  */
2479
- order?: 'asc' | 'desc';
2417
+ order?: 'asc' | 'desc' | null;
2480
2418
  }
2481
2419
  export declare namespace Responses {
2482
2420
  export { type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, 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, };