llama-stack-client 0.6.1 → 0.7.1

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 (332) hide show
  1. package/.github/workflows/ci.yml +16 -10
  2. package/.gitignore +1 -0
  3. package/.release-please-manifest.json +1 -1
  4. package/.stats.yml +4 -4
  5. package/CHANGELOG.md +80 -0
  6. package/CONTRIBUTING.md +2 -2
  7. package/README.md +22 -0
  8. package/api.md +1 -71
  9. package/dist/CHANGELOG.md +80 -0
  10. package/dist/README.md +22 -0
  11. package/dist/core.d.ts +1 -1
  12. package/dist/core.d.ts.map +1 -1
  13. package/dist/core.js +8 -17
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.mjs +8 -17
  16. package/dist/core.mjs.map +1 -1
  17. package/dist/index.d.mts +51 -12
  18. package/dist/index.d.ts +51 -12
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +50 -11
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +50 -11
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/internal/utils/query.d.ts +2 -0
  25. package/dist/internal/utils/query.d.ts.map +1 -0
  26. package/dist/{resources/alpha/post-training/post-training.js → internal/utils/query.js} +6 -24
  27. package/dist/internal/utils/query.js.map +1 -0
  28. package/dist/{resources/alpha/post-training.mjs → internal/utils/query.mjs} +5 -2
  29. package/dist/internal/utils/query.mjs.map +1 -0
  30. package/dist/package.json +1 -1
  31. package/dist/resources/alpha/alpha.d.ts +0 -4
  32. package/dist/resources/alpha/alpha.d.ts.map +1 -1
  33. package/dist/resources/alpha/alpha.js +0 -4
  34. package/dist/resources/alpha/alpha.js.map +1 -1
  35. package/dist/resources/alpha/alpha.mjs +0 -4
  36. package/dist/resources/alpha/alpha.mjs.map +1 -1
  37. package/dist/resources/alpha/eval/eval.d.ts +3 -0
  38. package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
  39. package/dist/resources/alpha/eval/eval.js +3 -0
  40. package/dist/resources/alpha/eval/eval.js.map +1 -1
  41. package/dist/resources/alpha/eval/eval.mjs +3 -0
  42. package/dist/resources/alpha/eval/eval.mjs.map +1 -1
  43. package/dist/resources/alpha/eval/jobs.d.ts +3 -0
  44. package/dist/resources/alpha/eval/jobs.d.ts.map +1 -1
  45. package/dist/resources/alpha/eval/jobs.js +3 -0
  46. package/dist/resources/alpha/eval/jobs.js.map +1 -1
  47. package/dist/resources/alpha/eval/jobs.mjs +3 -0
  48. package/dist/resources/alpha/eval/jobs.mjs.map +1 -1
  49. package/dist/resources/alpha/index.d.ts +0 -1
  50. package/dist/resources/alpha/index.d.ts.map +1 -1
  51. package/dist/resources/alpha/index.js +1 -3
  52. package/dist/resources/alpha/index.js.map +1 -1
  53. package/dist/resources/alpha/index.mjs +0 -1
  54. package/dist/resources/alpha/index.mjs.map +1 -1
  55. package/dist/resources/alpha/inference.d.ts +8 -0
  56. package/dist/resources/alpha/inference.d.ts.map +1 -1
  57. package/dist/resources/alpha/inference.js +8 -0
  58. package/dist/resources/alpha/inference.js.map +1 -1
  59. package/dist/resources/alpha/inference.mjs +8 -0
  60. package/dist/resources/alpha/inference.mjs.map +1 -1
  61. package/dist/resources/batches.d.ts +8 -0
  62. package/dist/resources/batches.d.ts.map +1 -1
  63. package/dist/resources/batches.js +8 -0
  64. package/dist/resources/batches.js.map +1 -1
  65. package/dist/resources/batches.mjs +8 -0
  66. package/dist/resources/batches.mjs.map +1 -1
  67. package/dist/resources/beta/datasets.d.ts +4 -8
  68. package/dist/resources/beta/datasets.d.ts.map +1 -1
  69. package/dist/resources/chat/chat.d.ts +34 -32
  70. package/dist/resources/chat/chat.d.ts.map +1 -1
  71. package/dist/resources/chat/chat.js.map +1 -1
  72. package/dist/resources/chat/chat.mjs.map +1 -1
  73. package/dist/resources/chat/completions.d.ts +321 -713
  74. package/dist/resources/chat/completions.d.ts.map +1 -1
  75. package/dist/resources/chat/completions.js +8 -0
  76. package/dist/resources/chat/completions.js.map +1 -1
  77. package/dist/resources/chat/completions.mjs +8 -0
  78. package/dist/resources/chat/completions.mjs.map +1 -1
  79. package/dist/resources/completions.d.ts +10 -4
  80. package/dist/resources/completions.d.ts.map +1 -1
  81. package/dist/resources/completions.js +8 -0
  82. package/dist/resources/completions.js.map +1 -1
  83. package/dist/resources/completions.mjs +8 -0
  84. package/dist/resources/completions.mjs.map +1 -1
  85. package/dist/resources/conversations/conversations.d.ts +95 -2
  86. package/dist/resources/conversations/conversations.d.ts.map +1 -1
  87. package/dist/resources/conversations/conversations.js +3 -0
  88. package/dist/resources/conversations/conversations.js.map +1 -1
  89. package/dist/resources/conversations/conversations.mjs +3 -0
  90. package/dist/resources/conversations/conversations.mjs.map +1 -1
  91. package/dist/resources/conversations/items.d.ts +371 -8
  92. package/dist/resources/conversations/items.d.ts.map +1 -1
  93. package/dist/resources/conversations/items.js +3 -0
  94. package/dist/resources/conversations/items.js.map +1 -1
  95. package/dist/resources/conversations/items.mjs +3 -0
  96. package/dist/resources/conversations/items.mjs.map +1 -1
  97. package/dist/resources/embeddings.d.ts +8 -0
  98. package/dist/resources/embeddings.d.ts.map +1 -1
  99. package/dist/resources/embeddings.js +8 -0
  100. package/dist/resources/embeddings.js.map +1 -1
  101. package/dist/resources/embeddings.mjs +8 -0
  102. package/dist/resources/embeddings.mjs.map +1 -1
  103. package/dist/resources/files.d.ts +11 -8
  104. package/dist/resources/files.d.ts.map +1 -1
  105. package/dist/resources/files.js +3 -0
  106. package/dist/resources/files.js.map +1 -1
  107. package/dist/resources/files.mjs +3 -0
  108. package/dist/resources/files.mjs.map +1 -1
  109. package/dist/resources/index.d.ts +1 -4
  110. package/dist/resources/index.d.ts.map +1 -1
  111. package/dist/resources/index.js +1 -7
  112. package/dist/resources/index.js.map +1 -1
  113. package/dist/resources/index.mjs +0 -3
  114. package/dist/resources/index.mjs.map +1 -1
  115. package/dist/resources/inspect.d.ts +3 -0
  116. package/dist/resources/inspect.d.ts.map +1 -1
  117. package/dist/resources/inspect.js +3 -0
  118. package/dist/resources/inspect.js.map +1 -1
  119. package/dist/resources/inspect.mjs +3 -0
  120. package/dist/resources/inspect.mjs.map +1 -1
  121. package/dist/resources/models/index.d.ts +1 -1
  122. package/dist/resources/models/index.d.ts.map +1 -1
  123. package/dist/resources/models/index.js.map +1 -1
  124. package/dist/resources/models/index.mjs.map +1 -1
  125. package/dist/resources/models/models.d.ts +7 -65
  126. package/dist/resources/models/models.d.ts.map +1 -1
  127. package/dist/resources/models/models.js +0 -19
  128. package/dist/resources/models/models.js.map +1 -1
  129. package/dist/resources/models/models.mjs +0 -19
  130. package/dist/resources/models/models.mjs.map +1 -1
  131. package/dist/resources/moderations.d.ts +3 -0
  132. package/dist/resources/moderations.d.ts.map +1 -1
  133. package/dist/resources/moderations.js +3 -0
  134. package/dist/resources/moderations.js.map +1 -1
  135. package/dist/resources/moderations.mjs +3 -0
  136. package/dist/resources/moderations.mjs.map +1 -1
  137. package/dist/resources/prompts/prompts.d.ts +3 -0
  138. package/dist/resources/prompts/prompts.d.ts.map +1 -1
  139. package/dist/resources/prompts/prompts.js +3 -0
  140. package/dist/resources/prompts/prompts.js.map +1 -1
  141. package/dist/resources/prompts/prompts.mjs +3 -0
  142. package/dist/resources/prompts/prompts.mjs.map +1 -1
  143. package/dist/resources/prompts/versions.d.ts +3 -0
  144. package/dist/resources/prompts/versions.d.ts.map +1 -1
  145. package/dist/resources/prompts/versions.js +3 -0
  146. package/dist/resources/prompts/versions.js.map +1 -1
  147. package/dist/resources/prompts/versions.mjs +3 -0
  148. package/dist/resources/prompts/versions.mjs.map +1 -1
  149. package/dist/resources/providers.d.ts +3 -0
  150. package/dist/resources/providers.d.ts.map +1 -1
  151. package/dist/resources/providers.js +3 -0
  152. package/dist/resources/providers.js.map +1 -1
  153. package/dist/resources/providers.mjs +3 -0
  154. package/dist/resources/providers.mjs.map +1 -1
  155. package/dist/resources/responses/input-items.d.ts +102 -3
  156. package/dist/resources/responses/input-items.d.ts.map +1 -1
  157. package/dist/resources/responses/responses.d.ts +582 -11
  158. package/dist/resources/responses/responses.d.ts.map +1 -1
  159. package/dist/resources/responses/responses.js.map +1 -1
  160. package/dist/resources/responses/responses.mjs.map +1 -1
  161. package/dist/resources/routes.d.ts +3 -0
  162. package/dist/resources/routes.d.ts.map +1 -1
  163. package/dist/resources/routes.js +3 -0
  164. package/dist/resources/routes.js.map +1 -1
  165. package/dist/resources/routes.mjs +3 -0
  166. package/dist/resources/routes.mjs.map +1 -1
  167. package/dist/resources/safety.d.ts +14 -11
  168. package/dist/resources/safety.d.ts.map +1 -1
  169. package/dist/resources/safety.js +3 -0
  170. package/dist/resources/safety.js.map +1 -1
  171. package/dist/resources/safety.mjs +3 -0
  172. package/dist/resources/safety.mjs.map +1 -1
  173. package/dist/resources/vector-io.d.ts +4 -4
  174. package/dist/resources/vector-stores/file-batches.d.ts +49 -1
  175. package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
  176. package/dist/resources/vector-stores/file-batches.js.map +1 -1
  177. package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
  178. package/dist/resources/vector-stores/files.d.ts +100 -4
  179. package/dist/resources/vector-stores/files.d.ts.map +1 -1
  180. package/dist/resources/vector-stores/files.js.map +1 -1
  181. package/dist/resources/vector-stores/files.mjs.map +1 -1
  182. package/dist/resources/vector-stores/vector-stores.d.ts +51 -3
  183. package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
  184. package/dist/resources/vector-stores/vector-stores.js.map +1 -1
  185. package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
  186. package/dist/src/core.ts +10 -21
  187. package/dist/src/index.ts +51 -48
  188. package/{src/resources/alpha/post-training.ts → dist/src/internal/utils/query.ts} +5 -1
  189. package/dist/src/resources/alpha/alpha.ts +0 -20
  190. package/dist/src/resources/alpha/eval/eval.ts +3 -0
  191. package/dist/src/resources/alpha/eval/jobs.ts +3 -0
  192. package/dist/src/resources/alpha/index.ts +0 -8
  193. package/dist/src/resources/alpha/inference.ts +8 -0
  194. package/dist/src/resources/batches.ts +8 -0
  195. package/dist/src/resources/beta/datasets.ts +4 -9
  196. package/dist/src/resources/chat/chat.ts +36 -33
  197. package/dist/src/resources/chat/completions.ts +307 -811
  198. package/dist/src/resources/completions.ts +10 -4
  199. package/dist/src/resources/conversations/conversations.ts +121 -1
  200. package/dist/src/resources/conversations/items.ts +477 -6
  201. package/dist/src/resources/embeddings.ts +8 -0
  202. package/dist/src/resources/files.ts +12 -9
  203. package/dist/src/resources/index.ts +0 -18
  204. package/dist/src/resources/inspect.ts +3 -0
  205. package/dist/src/resources/models/index.ts +0 -2
  206. package/dist/src/resources/models/models.ts +7 -82
  207. package/dist/src/resources/moderations.ts +3 -0
  208. package/dist/src/resources/prompts/prompts.ts +3 -0
  209. package/dist/src/resources/prompts/versions.ts +3 -0
  210. package/dist/src/resources/providers.ts +3 -0
  211. package/dist/src/resources/responses/input-items.ts +128 -2
  212. package/dist/src/resources/responses/responses.ts +706 -7
  213. package/dist/src/resources/routes.ts +3 -0
  214. package/dist/src/resources/safety.ts +15 -12
  215. package/dist/src/resources/vector-io.ts +4 -4
  216. package/dist/src/resources/vector-stores/file-batches.ts +57 -0
  217. package/dist/src/resources/vector-stores/files.ts +117 -3
  218. package/dist/src/resources/vector-stores/vector-stores.ts +59 -2
  219. package/dist/src/streaming.ts +24 -6
  220. package/dist/src/version.ts +1 -1
  221. package/dist/streaming.d.ts.map +1 -1
  222. package/dist/streaming.js +21 -6
  223. package/dist/streaming.js.map +1 -1
  224. package/dist/streaming.mjs +21 -6
  225. package/dist/streaming.mjs.map +1 -1
  226. package/dist/version.d.ts +1 -1
  227. package/dist/version.js +1 -1
  228. package/dist/version.mjs +1 -1
  229. package/package.json +1 -1
  230. package/scripts/mock +21 -10
  231. package/scripts/test +8 -8
  232. package/src/core.ts +10 -21
  233. package/src/index.ts +51 -48
  234. package/{dist/src/resources/alpha/post-training.ts → src/internal/utils/query.ts} +5 -1
  235. package/src/resources/alpha/alpha.ts +0 -20
  236. package/src/resources/alpha/eval/eval.ts +3 -0
  237. package/src/resources/alpha/eval/jobs.ts +3 -0
  238. package/src/resources/alpha/index.ts +0 -8
  239. package/src/resources/alpha/inference.ts +8 -0
  240. package/src/resources/batches.ts +8 -0
  241. package/src/resources/beta/datasets.ts +4 -9
  242. package/src/resources/chat/chat.ts +36 -33
  243. package/src/resources/chat/completions.ts +307 -811
  244. package/src/resources/completions.ts +10 -4
  245. package/src/resources/conversations/conversations.ts +121 -1
  246. package/src/resources/conversations/items.ts +477 -6
  247. package/src/resources/embeddings.ts +8 -0
  248. package/src/resources/files.ts +12 -9
  249. package/src/resources/index.ts +0 -18
  250. package/src/resources/inspect.ts +3 -0
  251. package/src/resources/models/index.ts +0 -2
  252. package/src/resources/models/models.ts +7 -82
  253. package/src/resources/moderations.ts +3 -0
  254. package/src/resources/prompts/prompts.ts +3 -0
  255. package/src/resources/prompts/versions.ts +3 -0
  256. package/src/resources/providers.ts +3 -0
  257. package/src/resources/responses/input-items.ts +128 -2
  258. package/src/resources/responses/responses.ts +706 -7
  259. package/src/resources/routes.ts +3 -0
  260. package/src/resources/safety.ts +15 -12
  261. package/src/resources/vector-io.ts +4 -4
  262. package/src/resources/vector-stores/file-batches.ts +57 -0
  263. package/src/resources/vector-stores/files.ts +117 -3
  264. package/src/resources/vector-stores/vector-stores.ts +59 -2
  265. package/src/streaming.ts +24 -6
  266. package/src/version.ts +1 -1
  267. package/tests/api-resources/beta/datasets.test.ts +4 -10
  268. package/tests/api-resources/chat/completions.test.ts +2 -0
  269. package/tests/api-resources/files.test.ts +2 -2
  270. package/tests/api-resources/models/models.test.ts +0 -39
  271. package/tests/api-resources/responses/responses.test.ts +10 -1
  272. package/tests/api-resources/vector-stores/file-batches.test.ts +1 -1
  273. package/tests/api-resources/vector-stores/files.test.ts +1 -1
  274. package/tests/api-resources/vector-stores/vector-stores.test.ts +1 -1
  275. package/tests/stringifyQuery.test.ts +2 -4
  276. package/dist/resources/alpha/post-training/index.d.ts +0 -3
  277. package/dist/resources/alpha/post-training/index.d.ts.map +0 -1
  278. package/dist/resources/alpha/post-training/index.js +0 -15
  279. package/dist/resources/alpha/post-training/index.js.map +0 -1
  280. package/dist/resources/alpha/post-training/index.mjs +0 -10
  281. package/dist/resources/alpha/post-training/index.mjs.map +0 -1
  282. package/dist/resources/alpha/post-training/job.d.ts +0 -104
  283. package/dist/resources/alpha/post-training/job.d.ts.map +0 -1
  284. package/dist/resources/alpha/post-training/job.js +0 -42
  285. package/dist/resources/alpha/post-training/job.js.map +0 -1
  286. package/dist/resources/alpha/post-training/job.mjs +0 -38
  287. package/dist/resources/alpha/post-training/job.mjs.map +0 -1
  288. package/dist/resources/alpha/post-training/post-training.d.ts +0 -269
  289. package/dist/resources/alpha/post-training/post-training.d.ts.map +0 -1
  290. package/dist/resources/alpha/post-training/post-training.js.map +0 -1
  291. package/dist/resources/alpha/post-training/post-training.mjs +0 -30
  292. package/dist/resources/alpha/post-training/post-training.mjs.map +0 -1
  293. package/dist/resources/alpha/post-training.d.ts +0 -2
  294. package/dist/resources/alpha/post-training.d.ts.map +0 -1
  295. package/dist/resources/alpha/post-training.js +0 -25
  296. package/dist/resources/alpha/post-training.js.map +0 -1
  297. package/dist/resources/alpha/post-training.mjs.map +0 -1
  298. package/dist/resources/tool-runtime.d.ts +0 -152
  299. package/dist/resources/tool-runtime.d.ts.map +0 -1
  300. package/dist/resources/tool-runtime.js +0 -30
  301. package/dist/resources/tool-runtime.js.map +0 -1
  302. package/dist/resources/tool-runtime.mjs +0 -26
  303. package/dist/resources/tool-runtime.mjs.map +0 -1
  304. package/dist/resources/toolgroups.d.ts +0 -91
  305. package/dist/resources/toolgroups.d.ts.map +0 -1
  306. package/dist/resources/toolgroups.js +0 -54
  307. package/dist/resources/toolgroups.js.map +0 -1
  308. package/dist/resources/toolgroups.mjs +0 -50
  309. package/dist/resources/toolgroups.mjs.map +0 -1
  310. package/dist/resources/tools.d.ts +0 -26
  311. package/dist/resources/tools.d.ts.map +0 -1
  312. package/dist/resources/tools.js +0 -30
  313. package/dist/resources/tools.js.map +0 -1
  314. package/dist/resources/tools.mjs +0 -26
  315. package/dist/resources/tools.mjs.map +0 -1
  316. package/dist/src/resources/alpha/post-training/index.ts +0 -17
  317. package/dist/src/resources/alpha/post-training/job.ts +0 -161
  318. package/dist/src/resources/alpha/post-training/post-training.ts +0 -385
  319. package/dist/src/resources/tool-runtime.ts +0 -217
  320. package/dist/src/resources/toolgroups.ts +0 -135
  321. package/dist/src/resources/tools.ts +0 -52
  322. package/src/resources/alpha/post-training/index.ts +0 -17
  323. package/src/resources/alpha/post-training/job.ts +0 -161
  324. package/src/resources/alpha/post-training/post-training.ts +0 -385
  325. package/src/resources/tool-runtime.ts +0 -217
  326. package/src/resources/toolgroups.ts +0 -135
  327. package/src/resources/tools.ts +0 -52
  328. package/tests/api-resources/alpha/post-training/job.test.ts +0 -86
  329. package/tests/api-resources/alpha/post-training/post-training.test.ts +0 -134
  330. package/tests/api-resources/tool-runtime.test.ts +0 -68
  331. package/tests/api-resources/toolgroups.test.ts +0 -91
  332. package/tests/api-resources/tools.test.ts +0 -57
@@ -14,6 +14,14 @@ import * as CompletionsAPI from './completions';
14
14
  import * as ChatAPI from './chat';
15
15
  import { Stream } from '../../streaming';
16
16
 
17
+ /**
18
+ * Llama Stack Inference API for generating completions, chat completions, and embeddings.
19
+ *
20
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
21
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
22
+ * - Embedding models: these models generate embeddings to be used for semantic search.
23
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
24
+ */
17
25
  export class Completions extends APIResource {
18
26
  /**
19
27
  * Generate an OpenAI-compatible chat completion for the given messages using the
@@ -93,7 +101,17 @@ export interface CompletionCreateResponse {
93
101
  object?: 'chat.completion';
94
102
 
95
103
  /**
96
- * Usage information for OpenAI chat completion.
104
+ * The service tier that was used for this response.
105
+ */
106
+ service_tier?: string | null;
107
+
108
+ /**
109
+ * System fingerprint for this completion.
110
+ */
111
+ system_fingerprint?: string | null;
112
+
113
+ /**
114
+ * Token usage information for the completion.
97
115
  */
98
116
  usage?: CompletionCreateResponse.Usage | null;
99
117
  }
@@ -116,334 +134,148 @@ export namespace CompletionCreateResponse {
116
134
  /**
117
135
  * The message from the model.
118
136
  */
119
- message:
120
- | Choice.OpenAIUserMessageParamOutput
121
- | Choice.OpenAISystemMessageParam
122
- | Choice.OpenAIAssistantMessageParamOutput
123
- | Choice.OpenAIToolMessageParam
124
- | Choice.OpenAIDeveloperMessageParam;
137
+ message: Choice.Message;
125
138
 
126
139
  /**
127
- * The log probabilities for the tokens in the message from an OpenAI-compatible
128
- * chat completion response.
140
+ * The log probabilities for the tokens in the message.
129
141
  */
130
142
  logprobs?: Choice.Logprobs | null;
131
143
  }
132
144
 
133
145
  export namespace Choice {
134
146
  /**
135
- * A message from the user in an OpenAI-compatible chat completion request.
136
- */
137
- export interface OpenAIUserMessageParamOutput {
138
- /**
139
- * The content of the message, which can include text and other media.
140
- */
141
- content:
142
- | string
143
- | Array<
144
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
145
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
146
- | OpenAIUserMessageParamOutput.OpenAIFile
147
- >;
148
-
149
- /**
150
- * The name of the user message participant.
151
- */
152
- name?: string | null;
153
-
154
- /**
155
- * Must be 'user' to identify this as a user message.
156
- */
157
- role?: 'user';
158
- }
159
-
160
- export namespace OpenAIUserMessageParamOutput {
161
- /**
162
- * Text content part for OpenAI-compatible chat completion messages.
163
- */
164
- export interface OpenAIChatCompletionContentPartTextParam {
165
- /**
166
- * The text content of the message.
167
- */
168
- text: string;
169
-
170
- /**
171
- * Must be 'text' to identify this as text content.
172
- */
173
- type?: 'text';
174
- }
175
-
176
- /**
177
- * Image content part for OpenAI-compatible chat completion messages.
178
- */
179
- export interface OpenAIChatCompletionContentPartImageParam {
180
- /**
181
- * Image URL specification and processing details.
182
- */
183
- image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
184
-
185
- /**
186
- * Must be 'image_url' to identify this as image content.
187
- */
188
- type?: 'image_url';
189
- }
190
-
191
- export namespace OpenAIChatCompletionContentPartImageParam {
192
- /**
193
- * Image URL specification and processing details.
194
- */
195
- export interface ImageURL {
196
- /**
197
- * URL of the image to include in the message.
198
- */
199
- url: string;
200
-
201
- /**
202
- * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
203
- */
204
- detail?: 'low' | 'high' | 'auto' | null;
205
- }
206
- }
207
-
208
- export interface OpenAIFile {
209
- /**
210
- * File specification.
211
- */
212
- file: OpenAIFile.File;
213
-
214
- /**
215
- * Must be 'file' to identify this as file content.
216
- */
217
- type?: 'file';
218
- }
219
-
220
- export namespace OpenAIFile {
221
- /**
222
- * File specification.
223
- */
224
- export interface File {
225
- /**
226
- * Base64-encoded file data.
227
- */
228
- file_data?: string | null;
229
-
230
- /**
231
- * ID of an uploaded file.
232
- */
233
- file_id?: string | null;
234
-
235
- /**
236
- * Name of the file.
237
- */
238
- filename?: string | null;
239
- }
240
- }
241
- }
242
-
243
- /**
244
- * A system message providing instructions or context to the model.
147
+ * The message from the model.
245
148
  */
246
- export interface OpenAISystemMessageParam {
149
+ export interface Message {
247
150
  /**
248
- * The content of the 'system prompt'. If multiple system messages are provided,
249
- * they are concatenated.
151
+ * Annotations for the message, when applicable.
250
152
  */
251
- content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
153
+ annotations?: Array<{ [key: string]: unknown }>;
252
154
 
253
155
  /**
254
- * The name of the system message participant.
255
- */
256
- name?: string | null;
257
-
258
- /**
259
- * Must be 'system' to identify this as a system message.
156
+ * Audio response data when using audio output modality.
260
157
  */
261
- role?: 'system';
262
- }
158
+ audio?: { [key: string]: unknown } | null;
263
159
 
264
- export namespace OpenAISystemMessageParam {
265
160
  /**
266
- * Text content part for OpenAI-compatible chat completion messages.
161
+ * The content of the message.
267
162
  */
268
- export interface ListOpenAIChatCompletionContentPartTextParam {
269
- /**
270
- * The text content of the message.
271
- */
272
- text: string;
273
-
274
- /**
275
- * Must be 'text' to identify this as text content.
276
- */
277
- type?: 'text';
278
- }
279
- }
163
+ content?: string | null;
280
164
 
281
- /**
282
- * A message containing the model's (assistant) response in an OpenAI-compatible
283
- * chat completion request.
284
- */
285
- export interface OpenAIAssistantMessageParamOutput {
286
165
  /**
287
- * The content of the model's response.
166
+ * Deprecated: the name and arguments of a function that should be called.
288
167
  */
289
- content?:
290
- | string
291
- | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
292
- | null;
168
+ function_call?: Message.FunctionCall;
293
169
 
294
170
  /**
295
- * The name of the assistant message participant.
171
+ * The refusal message generated by the model.
296
172
  */
297
- name?: string | null;
173
+ refusal?: string | null;
298
174
 
299
175
  /**
300
- * Must be 'assistant' to identify this as the model's response.
176
+ * The role of the message author, always 'assistant' in responses.
301
177
  */
302
178
  role?: 'assistant';
303
179
 
304
180
  /**
305
- * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
181
+ * The tool calls generated by the model.
306
182
  */
307
- tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
183
+ tool_calls?: Array<Message.Function | Message.Custom>;
308
184
  }
309
185
 
310
- export namespace OpenAIAssistantMessageParamOutput {
186
+ export namespace Message {
311
187
  /**
312
- * Text content part for OpenAI-compatible chat completion messages.
188
+ * Deprecated: the name and arguments of a function that should be called.
313
189
  */
314
- export interface ListOpenAIChatCompletionContentPartTextParam {
190
+ export interface FunctionCall {
315
191
  /**
316
- * The text content of the message.
192
+ * Arguments to pass to the function as a JSON string.
317
193
  */
318
- text: string;
194
+ arguments: string;
319
195
 
320
196
  /**
321
- * Must be 'text' to identify this as text content.
197
+ * Name of the function to call.
322
198
  */
323
- type?: 'text';
199
+ name: string;
324
200
  }
325
201
 
326
202
  /**
327
203
  * Tool call specification for OpenAI-compatible chat completion responses.
328
204
  */
329
- export interface ToolCall {
205
+ export interface Function {
330
206
  /**
331
207
  * Unique identifier for the tool call.
332
208
  */
333
- id?: string | null;
209
+ id: string;
334
210
 
335
211
  /**
336
- * Function call details for OpenAI-compatible tool calls.
212
+ * Function call details.
337
213
  */
338
- function?: ToolCall.Function | null;
339
-
340
- /**
341
- * Index of the tool call in the list.
342
- */
343
- index?: number | null;
214
+ function: Function.Function;
344
215
 
345
216
  /**
346
217
  * Must be 'function' to identify this as a function call.
347
218
  */
348
- type?: 'function';
219
+ type: 'function';
349
220
  }
350
221
 
351
- export namespace ToolCall {
222
+ export namespace Function {
352
223
  /**
353
- * Function call details for OpenAI-compatible tool calls.
224
+ * Function call details.
354
225
  */
355
226
  export interface Function {
356
227
  /**
357
228
  * Arguments to pass to the function as a JSON string.
358
229
  */
359
- arguments?: string | null;
230
+ arguments: string;
360
231
 
361
232
  /**
362
233
  * Name of the function to call.
363
234
  */
364
- name?: string | null;
235
+ name: string;
365
236
  }
366
237
  }
367
- }
368
-
369
- /**
370
- * A message representing the result of a tool invocation in an OpenAI-compatible
371
- * chat completion request.
372
- */
373
- export interface OpenAIToolMessageParam {
374
- /**
375
- * The response content from the tool.
376
- */
377
- content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
378
-
379
- /**
380
- * Unique identifier for the tool call this response is for.
381
- */
382
- tool_call_id: string;
383
238
 
384
239
  /**
385
- * Must be 'tool' to identify this as a tool response.
240
+ * A call to a custom tool created by the model.
386
241
  */
387
- role?: 'tool';
388
- }
389
-
390
- export namespace OpenAIToolMessageParam {
391
- /**
392
- * Text content part for OpenAI-compatible chat completion messages.
393
- */
394
- export interface ListOpenAIChatCompletionContentPartTextParam {
242
+ export interface Custom {
395
243
  /**
396
- * The text content of the message.
244
+ * The ID of the tool call.
397
245
  */
398
- text: string;
246
+ id: string;
399
247
 
400
248
  /**
401
- * Must be 'text' to identify this as text content.
249
+ * The custom tool that the model called.
402
250
  */
403
- type?: 'text';
404
- }
405
- }
251
+ custom: Custom.Custom;
406
252
 
407
- /**
408
- * A message from the developer in an OpenAI-compatible chat completion request.
409
- */
410
- export interface OpenAIDeveloperMessageParam {
411
- /**
412
- * The content of the developer message.
413
- */
414
- content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
415
-
416
- /**
417
- * The name of the developer message participant.
418
- */
419
- name?: string | null;
420
-
421
- /**
422
- * Must be 'developer' to identify this as a developer message.
423
- */
424
- role?: 'developer';
425
- }
426
-
427
- export namespace OpenAIDeveloperMessageParam {
428
- /**
429
- * Text content part for OpenAI-compatible chat completion messages.
430
- */
431
- export interface ListOpenAIChatCompletionContentPartTextParam {
432
253
  /**
433
- * The text content of the message.
254
+ * The type of the tool. Always 'custom'.
434
255
  */
435
- text: string;
256
+ type: 'custom';
257
+ }
436
258
 
259
+ export namespace Custom {
437
260
  /**
438
- * Must be 'text' to identify this as text content.
261
+ * The custom tool that the model called.
439
262
  */
440
- type?: 'text';
263
+ export interface Custom {
264
+ /**
265
+ * The input for the custom tool call generated by the model.
266
+ */
267
+ input: string;
268
+
269
+ /**
270
+ * The name of the custom tool to call.
271
+ */
272
+ name: string;
273
+ }
441
274
  }
442
275
  }
443
276
 
444
277
  /**
445
- * The log probabilities for the tokens in the message from an OpenAI-compatible
446
- * chat completion response.
278
+ * The log probabilities for the tokens in the message.
447
279
  */
448
280
  export interface Logprobs {
449
281
  /**
@@ -559,58 +391,61 @@ export namespace CompletionCreateResponse {
559
391
  }
560
392
 
561
393
  /**
562
- * Usage information for OpenAI chat completion.
394
+ * Token usage information for the completion.
563
395
  */
564
396
  export interface Usage {
565
397
  /**
566
398
  * Number of tokens in the completion.
567
399
  */
568
- completion_tokens: number;
400
+ completion_tokens?: number;
569
401
 
570
402
  /**
571
- * Number of tokens in the prompt.
403
+ * Detailed breakdown of output token usage.
572
404
  */
573
- prompt_tokens: number;
405
+ completion_tokens_details?: Usage.CompletionTokensDetails;
574
406
 
575
407
  /**
576
- * Total tokens used (prompt + completion).
408
+ * Number of tokens in the prompt.
577
409
  */
578
- total_tokens: number;
410
+ prompt_tokens?: number;
579
411
 
580
412
  /**
581
- * Token details for output tokens in OpenAI chat completion usage.
413
+ * Detailed breakdown of input token usage.
582
414
  */
583
- completion_tokens_details?: Usage.CompletionTokensDetails | null;
415
+ prompt_tokens_details?: Usage.PromptTokensDetails;
584
416
 
585
417
  /**
586
- * Token details for prompt tokens in OpenAI chat completion usage.
418
+ * Total tokens used (prompt + completion).
587
419
  */
588
- prompt_tokens_details?: Usage.PromptTokensDetails | null;
420
+ total_tokens?: number;
589
421
  }
590
422
 
591
423
  export namespace Usage {
592
424
  /**
593
- * Token details for output tokens in OpenAI chat completion usage.
425
+ * Detailed breakdown of output token usage.
594
426
  */
595
427
  export interface CompletionTokensDetails {
596
428
  /**
597
429
  * Number of tokens used for reasoning (o1/o3 models).
598
430
  */
599
- reasoning_tokens?: number | null;
431
+ reasoning_tokens?: number;
600
432
  }
601
433
 
602
434
  /**
603
- * Token details for prompt tokens in OpenAI chat completion usage.
435
+ * Detailed breakdown of input token usage.
604
436
  */
605
437
  export interface PromptTokensDetails {
606
438
  /**
607
439
  * Number of tokens retrieved from cache.
608
440
  */
609
- cached_tokens?: number | null;
441
+ cached_tokens?: number;
610
442
  }
611
443
  }
612
444
  }
613
445
 
446
+ /**
447
+ * Chat completion response extended with the original input messages.
448
+ */
614
449
  export interface CompletionRetrieveResponse {
615
450
  /**
616
451
  * The ID of the chat completion.
@@ -649,9 +484,19 @@ export interface CompletionRetrieveResponse {
649
484
  object?: 'chat.completion';
650
485
 
651
486
  /**
652
- * Usage information for OpenAI chat completion.
487
+ * The service tier that was used for this response.
653
488
  */
654
- usage?: CompletionRetrieveResponse.Usage | null;
489
+ service_tier?: string | null;
490
+
491
+ /**
492
+ * System fingerprint for this completion.
493
+ */
494
+ system_fingerprint?: string;
495
+
496
+ /**
497
+ * Token usage information for the completion.
498
+ */
499
+ usage?: CompletionRetrieveResponse.Usage;
655
500
  }
656
501
 
657
502
  export namespace CompletionRetrieveResponse {
@@ -672,334 +517,148 @@ export namespace CompletionRetrieveResponse {
672
517
  /**
673
518
  * The message from the model.
674
519
  */
675
- message:
676
- | Choice.OpenAIUserMessageParamOutput
677
- | Choice.OpenAISystemMessageParam
678
- | Choice.OpenAIAssistantMessageParamOutput
679
- | Choice.OpenAIToolMessageParam
680
- | Choice.OpenAIDeveloperMessageParam;
520
+ message: Choice.Message;
681
521
 
682
522
  /**
683
- * The log probabilities for the tokens in the message from an OpenAI-compatible
684
- * chat completion response.
523
+ * The log probabilities for the tokens in the message.
685
524
  */
686
525
  logprobs?: Choice.Logprobs | null;
687
526
  }
688
527
 
689
528
  export namespace Choice {
690
529
  /**
691
- * A message from the user in an OpenAI-compatible chat completion request.
692
- */
693
- export interface OpenAIUserMessageParamOutput {
694
- /**
695
- * The content of the message, which can include text and other media.
696
- */
697
- content:
698
- | string
699
- | Array<
700
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
701
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
702
- | OpenAIUserMessageParamOutput.OpenAIFile
703
- >;
704
-
705
- /**
706
- * The name of the user message participant.
707
- */
708
- name?: string | null;
709
-
710
- /**
711
- * Must be 'user' to identify this as a user message.
712
- */
713
- role?: 'user';
714
- }
715
-
716
- export namespace OpenAIUserMessageParamOutput {
717
- /**
718
- * Text content part for OpenAI-compatible chat completion messages.
719
- */
720
- export interface OpenAIChatCompletionContentPartTextParam {
721
- /**
722
- * The text content of the message.
723
- */
724
- text: string;
725
-
726
- /**
727
- * Must be 'text' to identify this as text content.
728
- */
729
- type?: 'text';
730
- }
731
-
732
- /**
733
- * Image content part for OpenAI-compatible chat completion messages.
734
- */
735
- export interface OpenAIChatCompletionContentPartImageParam {
736
- /**
737
- * Image URL specification and processing details.
738
- */
739
- image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
740
-
741
- /**
742
- * Must be 'image_url' to identify this as image content.
743
- */
744
- type?: 'image_url';
745
- }
746
-
747
- export namespace OpenAIChatCompletionContentPartImageParam {
748
- /**
749
- * Image URL specification and processing details.
750
- */
751
- export interface ImageURL {
752
- /**
753
- * URL of the image to include in the message.
754
- */
755
- url: string;
756
-
757
- /**
758
- * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
759
- */
760
- detail?: 'low' | 'high' | 'auto' | null;
761
- }
762
- }
763
-
764
- export interface OpenAIFile {
765
- /**
766
- * File specification.
767
- */
768
- file: OpenAIFile.File;
769
-
770
- /**
771
- * Must be 'file' to identify this as file content.
772
- */
773
- type?: 'file';
774
- }
775
-
776
- export namespace OpenAIFile {
777
- /**
778
- * File specification.
779
- */
780
- export interface File {
781
- /**
782
- * Base64-encoded file data.
783
- */
784
- file_data?: string | null;
785
-
786
- /**
787
- * ID of an uploaded file.
788
- */
789
- file_id?: string | null;
790
-
791
- /**
792
- * Name of the file.
793
- */
794
- filename?: string | null;
795
- }
796
- }
797
- }
798
-
799
- /**
800
- * A system message providing instructions or context to the model.
530
+ * The message from the model.
801
531
  */
802
- export interface OpenAISystemMessageParam {
803
- /**
804
- * The content of the 'system prompt'. If multiple system messages are provided,
805
- * they are concatenated.
806
- */
807
- content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
808
-
532
+ export interface Message {
809
533
  /**
810
- * The name of the system message participant.
534
+ * Annotations for the message, when applicable.
811
535
  */
812
- name?: string | null;
536
+ annotations?: Array<{ [key: string]: unknown }>;
813
537
 
814
538
  /**
815
- * Must be 'system' to identify this as a system message.
539
+ * Audio response data when using audio output modality.
816
540
  */
817
- role?: 'system';
818
- }
541
+ audio?: { [key: string]: unknown } | null;
819
542
 
820
- export namespace OpenAISystemMessageParam {
821
543
  /**
822
- * Text content part for OpenAI-compatible chat completion messages.
544
+ * The content of the message.
823
545
  */
824
- export interface ListOpenAIChatCompletionContentPartTextParam {
825
- /**
826
- * The text content of the message.
827
- */
828
- text: string;
829
-
830
- /**
831
- * Must be 'text' to identify this as text content.
832
- */
833
- type?: 'text';
834
- }
835
- }
546
+ content?: string | null;
836
547
 
837
- /**
838
- * A message containing the model's (assistant) response in an OpenAI-compatible
839
- * chat completion request.
840
- */
841
- export interface OpenAIAssistantMessageParamOutput {
842
548
  /**
843
- * The content of the model's response.
549
+ * Deprecated: the name and arguments of a function that should be called.
844
550
  */
845
- content?:
846
- | string
847
- | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
848
- | null;
551
+ function_call?: Message.FunctionCall;
849
552
 
850
553
  /**
851
- * The name of the assistant message participant.
554
+ * The refusal message generated by the model.
852
555
  */
853
- name?: string | null;
556
+ refusal?: string | null;
854
557
 
855
558
  /**
856
- * Must be 'assistant' to identify this as the model's response.
559
+ * The role of the message author, always 'assistant' in responses.
857
560
  */
858
561
  role?: 'assistant';
859
562
 
860
563
  /**
861
- * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
564
+ * The tool calls generated by the model.
862
565
  */
863
- tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
566
+ tool_calls?: Array<Message.Function | Message.Custom>;
864
567
  }
865
568
 
866
- export namespace OpenAIAssistantMessageParamOutput {
569
+ export namespace Message {
867
570
  /**
868
- * Text content part for OpenAI-compatible chat completion messages.
571
+ * Deprecated: the name and arguments of a function that should be called.
869
572
  */
870
- export interface ListOpenAIChatCompletionContentPartTextParam {
573
+ export interface FunctionCall {
871
574
  /**
872
- * The text content of the message.
575
+ * Arguments to pass to the function as a JSON string.
873
576
  */
874
- text: string;
577
+ arguments: string;
875
578
 
876
579
  /**
877
- * Must be 'text' to identify this as text content.
580
+ * Name of the function to call.
878
581
  */
879
- type?: 'text';
582
+ name: string;
880
583
  }
881
584
 
882
585
  /**
883
586
  * Tool call specification for OpenAI-compatible chat completion responses.
884
587
  */
885
- export interface ToolCall {
588
+ export interface Function {
886
589
  /**
887
590
  * Unique identifier for the tool call.
888
591
  */
889
- id?: string | null;
890
-
891
- /**
892
- * Function call details for OpenAI-compatible tool calls.
893
- */
894
- function?: ToolCall.Function | null;
592
+ id: string;
895
593
 
896
594
  /**
897
- * Index of the tool call in the list.
595
+ * Function call details.
898
596
  */
899
- index?: number | null;
597
+ function: Function.Function;
900
598
 
901
599
  /**
902
600
  * Must be 'function' to identify this as a function call.
903
601
  */
904
- type?: 'function';
602
+ type: 'function';
905
603
  }
906
604
 
907
- export namespace ToolCall {
605
+ export namespace Function {
908
606
  /**
909
- * Function call details for OpenAI-compatible tool calls.
607
+ * Function call details.
910
608
  */
911
609
  export interface Function {
912
610
  /**
913
611
  * Arguments to pass to the function as a JSON string.
914
612
  */
915
- arguments?: string | null;
613
+ arguments: string;
916
614
 
917
615
  /**
918
616
  * Name of the function to call.
919
617
  */
920
- name?: string | null;
618
+ name: string;
921
619
  }
922
620
  }
923
- }
924
-
925
- /**
926
- * A message representing the result of a tool invocation in an OpenAI-compatible
927
- * chat completion request.
928
- */
929
- export interface OpenAIToolMessageParam {
930
- /**
931
- * The response content from the tool.
932
- */
933
- content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
934
-
935
- /**
936
- * Unique identifier for the tool call this response is for.
937
- */
938
- tool_call_id: string;
939
-
940
- /**
941
- * Must be 'tool' to identify this as a tool response.
942
- */
943
- role?: 'tool';
944
- }
945
621
 
946
- export namespace OpenAIToolMessageParam {
947
622
  /**
948
- * Text content part for OpenAI-compatible chat completion messages.
623
+ * A call to a custom tool created by the model.
949
624
  */
950
- export interface ListOpenAIChatCompletionContentPartTextParam {
625
+ export interface Custom {
951
626
  /**
952
- * The text content of the message.
627
+ * The ID of the tool call.
953
628
  */
954
- text: string;
629
+ id: string;
955
630
 
956
631
  /**
957
- * Must be 'text' to identify this as text content.
632
+ * The custom tool that the model called.
958
633
  */
959
- type?: 'text';
960
- }
961
- }
962
-
963
- /**
964
- * A message from the developer in an OpenAI-compatible chat completion request.
965
- */
966
- export interface OpenAIDeveloperMessageParam {
967
- /**
968
- * The content of the developer message.
969
- */
970
- content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
971
-
972
- /**
973
- * The name of the developer message participant.
974
- */
975
- name?: string | null;
976
-
977
- /**
978
- * Must be 'developer' to identify this as a developer message.
979
- */
980
- role?: 'developer';
981
- }
634
+ custom: Custom.Custom;
982
635
 
983
- export namespace OpenAIDeveloperMessageParam {
984
- /**
985
- * Text content part for OpenAI-compatible chat completion messages.
986
- */
987
- export interface ListOpenAIChatCompletionContentPartTextParam {
988
636
  /**
989
- * The text content of the message.
637
+ * The type of the tool. Always 'custom'.
990
638
  */
991
- text: string;
639
+ type: 'custom';
640
+ }
992
641
 
642
+ export namespace Custom {
993
643
  /**
994
- * Must be 'text' to identify this as text content.
644
+ * The custom tool that the model called.
995
645
  */
996
- type?: 'text';
646
+ export interface Custom {
647
+ /**
648
+ * The input for the custom tool call generated by the model.
649
+ */
650
+ input: string;
651
+
652
+ /**
653
+ * The name of the custom tool to call.
654
+ */
655
+ name: string;
656
+ }
997
657
  }
998
658
  }
999
659
 
1000
660
  /**
1001
- * The log probabilities for the tokens in the message from an OpenAI-compatible
1002
- * chat completion response.
661
+ * The log probabilities for the tokens in the message.
1003
662
  */
1004
663
  export interface Logprobs {
1005
664
  /**
@@ -1188,6 +847,9 @@ export namespace CompletionRetrieveResponse {
1188
847
  }
1189
848
  }
1190
849
 
850
+ /**
851
+ * File content part for OpenAI-compatible chat completion messages.
852
+ */
1191
853
  export interface OpenAIFile {
1192
854
  /**
1193
855
  * File specification.
@@ -1288,6 +950,8 @@ export namespace CompletionRetrieveResponse {
1288
950
  * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
1289
951
  */
1290
952
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
953
+
954
+ [k: string]: unknown;
1291
955
  }
1292
956
 
1293
957
  export namespace OpenAIAssistantMessageParamOutput {
@@ -1313,38 +977,33 @@ export namespace CompletionRetrieveResponse {
1313
977
  /**
1314
978
  * Unique identifier for the tool call.
1315
979
  */
1316
- id?: string | null;
980
+ id: string;
1317
981
 
1318
982
  /**
1319
- * Function call details for OpenAI-compatible tool calls.
983
+ * Function call details.
1320
984
  */
1321
- function?: ToolCall.Function | null;
1322
-
1323
- /**
1324
- * Index of the tool call in the list.
1325
- */
1326
- index?: number | null;
985
+ function: ToolCall.Function;
1327
986
 
1328
987
  /**
1329
988
  * Must be 'function' to identify this as a function call.
1330
989
  */
1331
- type?: 'function';
990
+ type: 'function';
1332
991
  }
1333
992
 
1334
993
  export namespace ToolCall {
1335
994
  /**
1336
- * Function call details for OpenAI-compatible tool calls.
995
+ * Function call details.
1337
996
  */
1338
997
  export interface Function {
1339
998
  /**
1340
999
  * Arguments to pass to the function as a JSON string.
1341
1000
  */
1342
- arguments?: string | null;
1001
+ arguments: string;
1343
1002
 
1344
1003
  /**
1345
1004
  * Name of the function to call.
1346
1005
  */
1347
- name?: string | null;
1006
+ name: string;
1348
1007
  }
1349
1008
  }
1350
1009
  }
@@ -1425,54 +1084,54 @@ export namespace CompletionRetrieveResponse {
1425
1084
  }
1426
1085
 
1427
1086
  /**
1428
- * Usage information for OpenAI chat completion.
1087
+ * Token usage information for the completion.
1429
1088
  */
1430
1089
  export interface Usage {
1431
1090
  /**
1432
1091
  * Number of tokens in the completion.
1433
1092
  */
1434
- completion_tokens: number;
1093
+ completion_tokens?: number;
1435
1094
 
1436
1095
  /**
1437
- * Number of tokens in the prompt.
1096
+ * Detailed breakdown of output token usage.
1438
1097
  */
1439
- prompt_tokens: number;
1098
+ completion_tokens_details?: Usage.CompletionTokensDetails;
1440
1099
 
1441
1100
  /**
1442
- * Total tokens used (prompt + completion).
1101
+ * Number of tokens in the prompt.
1443
1102
  */
1444
- total_tokens: number;
1103
+ prompt_tokens?: number;
1445
1104
 
1446
1105
  /**
1447
- * Token details for output tokens in OpenAI chat completion usage.
1106
+ * Detailed breakdown of input token usage.
1448
1107
  */
1449
- completion_tokens_details?: Usage.CompletionTokensDetails | null;
1108
+ prompt_tokens_details?: Usage.PromptTokensDetails;
1450
1109
 
1451
1110
  /**
1452
- * Token details for prompt tokens in OpenAI chat completion usage.
1111
+ * Total tokens used (prompt + completion).
1453
1112
  */
1454
- prompt_tokens_details?: Usage.PromptTokensDetails | null;
1113
+ total_tokens?: number;
1455
1114
  }
1456
1115
 
1457
1116
  export namespace Usage {
1458
1117
  /**
1459
- * Token details for output tokens in OpenAI chat completion usage.
1118
+ * Detailed breakdown of output token usage.
1460
1119
  */
1461
1120
  export interface CompletionTokensDetails {
1462
1121
  /**
1463
1122
  * Number of tokens used for reasoning (o1/o3 models).
1464
1123
  */
1465
- reasoning_tokens?: number | null;
1124
+ reasoning_tokens?: number;
1466
1125
  }
1467
1126
 
1468
1127
  /**
1469
- * Token details for prompt tokens in OpenAI chat completion usage.
1128
+ * Detailed breakdown of input token usage.
1470
1129
  */
1471
1130
  export interface PromptTokensDetails {
1472
1131
  /**
1473
1132
  * Number of tokens retrieved from cache.
1474
1133
  */
1475
- cached_tokens?: number | null;
1134
+ cached_tokens?: number;
1476
1135
  }
1477
1136
  }
1478
1137
  }
@@ -1508,6 +1167,9 @@ export interface CompletionListResponse {
1508
1167
  }
1509
1168
 
1510
1169
  export namespace CompletionListResponse {
1170
+ /**
1171
+ * Chat completion response extended with the original input messages.
1172
+ */
1511
1173
  export interface Data {
1512
1174
  /**
1513
1175
  * The ID of the chat completion.
@@ -1546,9 +1208,19 @@ export namespace CompletionListResponse {
1546
1208
  object?: 'chat.completion';
1547
1209
 
1548
1210
  /**
1549
- * Usage information for OpenAI chat completion.
1211
+ * The service tier that was used for this response.
1212
+ */
1213
+ service_tier?: string | null;
1214
+
1215
+ /**
1216
+ * System fingerprint for this completion.
1550
1217
  */
1551
- usage?: Data.Usage | null;
1218
+ system_fingerprint?: string;
1219
+
1220
+ /**
1221
+ * Token usage information for the completion.
1222
+ */
1223
+ usage?: Data.Usage;
1552
1224
  }
1553
1225
 
1554
1226
  export namespace Data {
@@ -1569,334 +1241,148 @@ export namespace CompletionListResponse {
1569
1241
  /**
1570
1242
  * The message from the model.
1571
1243
  */
1572
- message:
1573
- | Choice.OpenAIUserMessageParamOutput
1574
- | Choice.OpenAISystemMessageParam
1575
- | Choice.OpenAIAssistantMessageParamOutput
1576
- | Choice.OpenAIToolMessageParam
1577
- | Choice.OpenAIDeveloperMessageParam;
1244
+ message: Choice.Message;
1578
1245
 
1579
1246
  /**
1580
- * The log probabilities for the tokens in the message from an OpenAI-compatible
1581
- * chat completion response.
1247
+ * The log probabilities for the tokens in the message.
1582
1248
  */
1583
1249
  logprobs?: Choice.Logprobs | null;
1584
1250
  }
1585
1251
 
1586
1252
  export namespace Choice {
1587
1253
  /**
1588
- * A message from the user in an OpenAI-compatible chat completion request.
1589
- */
1590
- export interface OpenAIUserMessageParamOutput {
1591
- /**
1592
- * The content of the message, which can include text and other media.
1593
- */
1594
- content:
1595
- | string
1596
- | Array<
1597
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam
1598
- | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam
1599
- | OpenAIUserMessageParamOutput.OpenAIFile
1600
- >;
1601
-
1602
- /**
1603
- * The name of the user message participant.
1604
- */
1605
- name?: string | null;
1606
-
1607
- /**
1608
- * Must be 'user' to identify this as a user message.
1609
- */
1610
- role?: 'user';
1611
- }
1612
-
1613
- export namespace OpenAIUserMessageParamOutput {
1614
- /**
1615
- * Text content part for OpenAI-compatible chat completion messages.
1616
- */
1617
- export interface OpenAIChatCompletionContentPartTextParam {
1618
- /**
1619
- * The text content of the message.
1620
- */
1621
- text: string;
1622
-
1623
- /**
1624
- * Must be 'text' to identify this as text content.
1625
- */
1626
- type?: 'text';
1627
- }
1628
-
1629
- /**
1630
- * Image content part for OpenAI-compatible chat completion messages.
1631
- */
1632
- export interface OpenAIChatCompletionContentPartImageParam {
1633
- /**
1634
- * Image URL specification and processing details.
1635
- */
1636
- image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
1637
-
1638
- /**
1639
- * Must be 'image_url' to identify this as image content.
1640
- */
1641
- type?: 'image_url';
1642
- }
1643
-
1644
- export namespace OpenAIChatCompletionContentPartImageParam {
1645
- /**
1646
- * Image URL specification and processing details.
1647
- */
1648
- export interface ImageURL {
1649
- /**
1650
- * URL of the image to include in the message.
1651
- */
1652
- url: string;
1653
-
1654
- /**
1655
- * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
1656
- */
1657
- detail?: 'low' | 'high' | 'auto' | null;
1658
- }
1659
- }
1660
-
1661
- export interface OpenAIFile {
1662
- /**
1663
- * File specification.
1664
- */
1665
- file: OpenAIFile.File;
1666
-
1667
- /**
1668
- * Must be 'file' to identify this as file content.
1669
- */
1670
- type?: 'file';
1671
- }
1672
-
1673
- export namespace OpenAIFile {
1674
- /**
1675
- * File specification.
1676
- */
1677
- export interface File {
1678
- /**
1679
- * Base64-encoded file data.
1680
- */
1681
- file_data?: string | null;
1682
-
1683
- /**
1684
- * ID of an uploaded file.
1685
- */
1686
- file_id?: string | null;
1687
-
1688
- /**
1689
- * Name of the file.
1690
- */
1691
- filename?: string | null;
1692
- }
1693
- }
1694
- }
1695
-
1696
- /**
1697
- * A system message providing instructions or context to the model.
1254
+ * The message from the model.
1698
1255
  */
1699
- export interface OpenAISystemMessageParam {
1700
- /**
1701
- * The content of the 'system prompt'. If multiple system messages are provided,
1702
- * they are concatenated.
1703
- */
1704
- content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1705
-
1256
+ export interface Message {
1706
1257
  /**
1707
- * The name of the system message participant.
1258
+ * Annotations for the message, when applicable.
1708
1259
  */
1709
- name?: string | null;
1260
+ annotations?: Array<{ [key: string]: unknown }>;
1710
1261
 
1711
1262
  /**
1712
- * Must be 'system' to identify this as a system message.
1263
+ * Audio response data when using audio output modality.
1713
1264
  */
1714
- role?: 'system';
1715
- }
1265
+ audio?: { [key: string]: unknown } | null;
1716
1266
 
1717
- export namespace OpenAISystemMessageParam {
1718
1267
  /**
1719
- * Text content part for OpenAI-compatible chat completion messages.
1268
+ * The content of the message.
1720
1269
  */
1721
- export interface ListOpenAIChatCompletionContentPartTextParam {
1722
- /**
1723
- * The text content of the message.
1724
- */
1725
- text: string;
1270
+ content?: string | null;
1726
1271
 
1727
- /**
1728
- * Must be 'text' to identify this as text content.
1729
- */
1730
- type?: 'text';
1731
- }
1732
- }
1733
-
1734
- /**
1735
- * A message containing the model's (assistant) response in an OpenAI-compatible
1736
- * chat completion request.
1737
- */
1738
- export interface OpenAIAssistantMessageParamOutput {
1739
1272
  /**
1740
- * The content of the model's response.
1273
+ * Deprecated: the name and arguments of a function that should be called.
1741
1274
  */
1742
- content?:
1743
- | string
1744
- | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
1745
- | null;
1275
+ function_call?: Message.FunctionCall;
1746
1276
 
1747
1277
  /**
1748
- * The name of the assistant message participant.
1278
+ * The refusal message generated by the model.
1749
1279
  */
1750
- name?: string | null;
1280
+ refusal?: string | null;
1751
1281
 
1752
1282
  /**
1753
- * Must be 'assistant' to identify this as the model's response.
1283
+ * The role of the message author, always 'assistant' in responses.
1754
1284
  */
1755
1285
  role?: 'assistant';
1756
1286
 
1757
1287
  /**
1758
- * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
1288
+ * The tool calls generated by the model.
1759
1289
  */
1760
- tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
1290
+ tool_calls?: Array<Message.Function | Message.Custom>;
1761
1291
  }
1762
1292
 
1763
- export namespace OpenAIAssistantMessageParamOutput {
1293
+ export namespace Message {
1764
1294
  /**
1765
- * Text content part for OpenAI-compatible chat completion messages.
1295
+ * Deprecated: the name and arguments of a function that should be called.
1766
1296
  */
1767
- export interface ListOpenAIChatCompletionContentPartTextParam {
1297
+ export interface FunctionCall {
1768
1298
  /**
1769
- * The text content of the message.
1299
+ * Arguments to pass to the function as a JSON string.
1770
1300
  */
1771
- text: string;
1301
+ arguments: string;
1772
1302
 
1773
1303
  /**
1774
- * Must be 'text' to identify this as text content.
1304
+ * Name of the function to call.
1775
1305
  */
1776
- type?: 'text';
1306
+ name: string;
1777
1307
  }
1778
1308
 
1779
1309
  /**
1780
1310
  * Tool call specification for OpenAI-compatible chat completion responses.
1781
1311
  */
1782
- export interface ToolCall {
1312
+ export interface Function {
1783
1313
  /**
1784
1314
  * Unique identifier for the tool call.
1785
1315
  */
1786
- id?: string | null;
1787
-
1788
- /**
1789
- * Function call details for OpenAI-compatible tool calls.
1790
- */
1791
- function?: ToolCall.Function | null;
1316
+ id: string;
1792
1317
 
1793
1318
  /**
1794
- * Index of the tool call in the list.
1319
+ * Function call details.
1795
1320
  */
1796
- index?: number | null;
1321
+ function: Function.Function;
1797
1322
 
1798
1323
  /**
1799
1324
  * Must be 'function' to identify this as a function call.
1800
1325
  */
1801
- type?: 'function';
1326
+ type: 'function';
1802
1327
  }
1803
1328
 
1804
- export namespace ToolCall {
1329
+ export namespace Function {
1805
1330
  /**
1806
- * Function call details for OpenAI-compatible tool calls.
1331
+ * Function call details.
1807
1332
  */
1808
1333
  export interface Function {
1809
1334
  /**
1810
1335
  * Arguments to pass to the function as a JSON string.
1811
1336
  */
1812
- arguments?: string | null;
1337
+ arguments: string;
1813
1338
 
1814
1339
  /**
1815
1340
  * Name of the function to call.
1816
1341
  */
1817
- name?: string | null;
1342
+ name: string;
1818
1343
  }
1819
1344
  }
1820
- }
1821
-
1822
- /**
1823
- * A message representing the result of a tool invocation in an OpenAI-compatible
1824
- * chat completion request.
1825
- */
1826
- export interface OpenAIToolMessageParam {
1827
- /**
1828
- * The response content from the tool.
1829
- */
1830
- content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1831
-
1832
- /**
1833
- * Unique identifier for the tool call this response is for.
1834
- */
1835
- tool_call_id: string;
1836
-
1837
- /**
1838
- * Must be 'tool' to identify this as a tool response.
1839
- */
1840
- role?: 'tool';
1841
- }
1842
1345
 
1843
- export namespace OpenAIToolMessageParam {
1844
1346
  /**
1845
- * Text content part for OpenAI-compatible chat completion messages.
1347
+ * A call to a custom tool created by the model.
1846
1348
  */
1847
- export interface ListOpenAIChatCompletionContentPartTextParam {
1349
+ export interface Custom {
1848
1350
  /**
1849
- * The text content of the message.
1351
+ * The ID of the tool call.
1850
1352
  */
1851
- text: string;
1353
+ id: string;
1852
1354
 
1853
1355
  /**
1854
- * Must be 'text' to identify this as text content.
1356
+ * The custom tool that the model called.
1855
1357
  */
1856
- type?: 'text';
1857
- }
1858
- }
1859
-
1860
- /**
1861
- * A message from the developer in an OpenAI-compatible chat completion request.
1862
- */
1863
- export interface OpenAIDeveloperMessageParam {
1864
- /**
1865
- * The content of the developer message.
1866
- */
1867
- content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1868
-
1869
- /**
1870
- * The name of the developer message participant.
1871
- */
1872
- name?: string | null;
1873
-
1874
- /**
1875
- * Must be 'developer' to identify this as a developer message.
1876
- */
1877
- role?: 'developer';
1878
- }
1358
+ custom: Custom.Custom;
1879
1359
 
1880
- export namespace OpenAIDeveloperMessageParam {
1881
- /**
1882
- * Text content part for OpenAI-compatible chat completion messages.
1883
- */
1884
- export interface ListOpenAIChatCompletionContentPartTextParam {
1885
1360
  /**
1886
- * The text content of the message.
1361
+ * The type of the tool. Always 'custom'.
1887
1362
  */
1888
- text: string;
1363
+ type: 'custom';
1364
+ }
1889
1365
 
1366
+ export namespace Custom {
1890
1367
  /**
1891
- * Must be 'text' to identify this as text content.
1368
+ * The custom tool that the model called.
1892
1369
  */
1893
- type?: 'text';
1370
+ export interface Custom {
1371
+ /**
1372
+ * The input for the custom tool call generated by the model.
1373
+ */
1374
+ input: string;
1375
+
1376
+ /**
1377
+ * The name of the custom tool to call.
1378
+ */
1379
+ name: string;
1380
+ }
1894
1381
  }
1895
1382
  }
1896
1383
 
1897
1384
  /**
1898
- * The log probabilities for the tokens in the message from an OpenAI-compatible
1899
- * chat completion response.
1385
+ * The log probabilities for the tokens in the message.
1900
1386
  */
1901
1387
  export interface Logprobs {
1902
1388
  /**
@@ -2085,6 +1571,9 @@ export namespace CompletionListResponse {
2085
1571
  }
2086
1572
  }
2087
1573
 
1574
+ /**
1575
+ * File content part for OpenAI-compatible chat completion messages.
1576
+ */
2088
1577
  export interface OpenAIFile {
2089
1578
  /**
2090
1579
  * File specification.
@@ -2185,6 +1674,8 @@ export namespace CompletionListResponse {
2185
1674
  * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
2186
1675
  */
2187
1676
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
1677
+
1678
+ [k: string]: unknown;
2188
1679
  }
2189
1680
 
2190
1681
  export namespace OpenAIAssistantMessageParamOutput {
@@ -2210,38 +1701,33 @@ export namespace CompletionListResponse {
2210
1701
  /**
2211
1702
  * Unique identifier for the tool call.
2212
1703
  */
2213
- id?: string | null;
2214
-
2215
- /**
2216
- * Function call details for OpenAI-compatible tool calls.
2217
- */
2218
- function?: ToolCall.Function | null;
1704
+ id: string;
2219
1705
 
2220
1706
  /**
2221
- * Index of the tool call in the list.
1707
+ * Function call details.
2222
1708
  */
2223
- index?: number | null;
1709
+ function: ToolCall.Function;
2224
1710
 
2225
1711
  /**
2226
1712
  * Must be 'function' to identify this as a function call.
2227
1713
  */
2228
- type?: 'function';
1714
+ type: 'function';
2229
1715
  }
2230
1716
 
2231
1717
  export namespace ToolCall {
2232
1718
  /**
2233
- * Function call details for OpenAI-compatible tool calls.
1719
+ * Function call details.
2234
1720
  */
2235
1721
  export interface Function {
2236
1722
  /**
2237
1723
  * Arguments to pass to the function as a JSON string.
2238
1724
  */
2239
- arguments?: string | null;
1725
+ arguments: string;
2240
1726
 
2241
1727
  /**
2242
1728
  * Name of the function to call.
2243
1729
  */
2244
- name?: string | null;
1730
+ name: string;
2245
1731
  }
2246
1732
  }
2247
1733
  }
@@ -2322,54 +1808,54 @@ export namespace CompletionListResponse {
2322
1808
  }
2323
1809
 
2324
1810
  /**
2325
- * Usage information for OpenAI chat completion.
1811
+ * Token usage information for the completion.
2326
1812
  */
2327
1813
  export interface Usage {
2328
1814
  /**
2329
1815
  * Number of tokens in the completion.
2330
1816
  */
2331
- completion_tokens: number;
1817
+ completion_tokens?: number;
2332
1818
 
2333
1819
  /**
2334
- * Number of tokens in the prompt.
1820
+ * Detailed breakdown of output token usage.
2335
1821
  */
2336
- prompt_tokens: number;
1822
+ completion_tokens_details?: Usage.CompletionTokensDetails;
2337
1823
 
2338
1824
  /**
2339
- * Total tokens used (prompt + completion).
1825
+ * Number of tokens in the prompt.
2340
1826
  */
2341
- total_tokens: number;
1827
+ prompt_tokens?: number;
2342
1828
 
2343
1829
  /**
2344
- * Token details for output tokens in OpenAI chat completion usage.
1830
+ * Detailed breakdown of input token usage.
2345
1831
  */
2346
- completion_tokens_details?: Usage.CompletionTokensDetails | null;
1832
+ prompt_tokens_details?: Usage.PromptTokensDetails;
2347
1833
 
2348
1834
  /**
2349
- * Token details for prompt tokens in OpenAI chat completion usage.
1835
+ * Total tokens used (prompt + completion).
2350
1836
  */
2351
- prompt_tokens_details?: Usage.PromptTokensDetails | null;
1837
+ total_tokens?: number;
2352
1838
  }
2353
1839
 
2354
1840
  export namespace Usage {
2355
1841
  /**
2356
- * Token details for output tokens in OpenAI chat completion usage.
1842
+ * Detailed breakdown of output token usage.
2357
1843
  */
2358
1844
  export interface CompletionTokensDetails {
2359
1845
  /**
2360
1846
  * Number of tokens used for reasoning (o1/o3 models).
2361
1847
  */
2362
- reasoning_tokens?: number | null;
1848
+ reasoning_tokens?: number;
2363
1849
  }
2364
1850
 
2365
1851
  /**
2366
- * Token details for prompt tokens in OpenAI chat completion usage.
1852
+ * Detailed breakdown of input token usage.
2367
1853
  */
2368
1854
  export interface PromptTokensDetails {
2369
1855
  /**
2370
1856
  * Number of tokens retrieved from cache.
2371
1857
  */
2372
- cached_tokens?: number | null;
1858
+ cached_tokens?: number;
2373
1859
  }
2374
1860
  }
2375
1861
  }
@@ -2444,6 +1930,11 @@ export interface CompletionCreateParamsBase {
2444
1930
  */
2445
1931
  presence_penalty?: number | null;
2446
1932
 
1933
+ /**
1934
+ * A key to use when reading from or writing to the prompt cache.
1935
+ */
1936
+ prompt_cache_key?: string | null;
1937
+
2447
1938
  /**
2448
1939
  * The effort level for reasoning models.
2449
1940
  */
@@ -2468,6 +1959,11 @@ export interface CompletionCreateParamsBase {
2468
1959
  */
2469
1960
  seed?: number | null;
2470
1961
 
1962
+ /**
1963
+ * The service tier for the request.
1964
+ */
1965
+ service_tier?: 'auto' | 'default' | 'flex' | 'priority' | null;
1966
+
2471
1967
  /**
2472
1968
  * The stop tokens to use.
2473
1969
  */
@@ -2499,7 +1995,7 @@ export interface CompletionCreateParamsBase {
2499
1995
  tools?: Array<{ [key: string]: unknown }> | null;
2500
1996
 
2501
1997
  /**
2502
- * The top log probabilities to use.
1998
+ * The number of most likely tokens to return at each position.
2503
1999
  */
2504
2000
  top_logprobs?: number | null;
2505
2001
 
@@ -2591,6 +2087,9 @@ export namespace CompletionCreateParams {
2591
2087
  }
2592
2088
  }
2593
2089
 
2090
+ /**
2091
+ * File content part for OpenAI-compatible chat completion messages.
2092
+ */
2594
2093
  export interface OpenAIFile {
2595
2094
  /**
2596
2095
  * File specification.
@@ -2691,6 +2190,8 @@ export namespace CompletionCreateParams {
2691
2190
  * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
2692
2191
  */
2693
2192
  tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
2193
+
2194
+ [k: string]: unknown;
2694
2195
  }
2695
2196
 
2696
2197
  export namespace OpenAIAssistantMessageParamInput {
@@ -2716,38 +2217,33 @@ export namespace CompletionCreateParams {
2716
2217
  /**
2717
2218
  * Unique identifier for the tool call.
2718
2219
  */
2719
- id?: string | null;
2720
-
2721
- /**
2722
- * Function call details for OpenAI-compatible tool calls.
2723
- */
2724
- function?: ToolCall.Function | null;
2220
+ id: string;
2725
2221
 
2726
2222
  /**
2727
- * Index of the tool call in the list.
2223
+ * Function call details.
2728
2224
  */
2729
- index?: number | null;
2225
+ function: ToolCall.Function;
2730
2226
 
2731
2227
  /**
2732
2228
  * Must be 'function' to identify this as a function call.
2733
2229
  */
2734
- type?: 'function';
2230
+ type: 'function';
2735
2231
  }
2736
2232
 
2737
2233
  export namespace ToolCall {
2738
2234
  /**
2739
- * Function call details for OpenAI-compatible tool calls.
2235
+ * Function call details.
2740
2236
  */
2741
2237
  export interface Function {
2742
2238
  /**
2743
2239
  * Arguments to pass to the function as a JSON string.
2744
2240
  */
2745
- arguments?: string | null;
2241
+ arguments: string;
2746
2242
 
2747
2243
  /**
2748
2244
  * Name of the function to call.
2749
2245
  */
2750
- name?: string | null;
2246
+ name: string;
2751
2247
  }
2752
2248
  }
2753
2249
  }
@@ -2916,7 +2412,7 @@ export interface CompletionListParams {
2916
2412
  model?: string | null;
2917
2413
 
2918
2414
  /**
2919
- * Sort order for paginated responses.
2415
+ * The order to sort the chat completions by: "asc" or "desc". Defaults to "desc".
2920
2416
  */
2921
2417
  order?: 'asc' | 'desc' | null;
2922
2418
  }