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