llama-stack-client 0.4.4 → 0.4.5

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 (291) hide show
  1. package/.github/workflows/ci.yml +4 -4
  2. package/.github/workflows/release-doctor.yml +1 -1
  3. package/.release-please-manifest.json +1 -1
  4. package/.stats.yml +4 -4
  5. package/CHANGELOG.md +41 -0
  6. package/LICENSE +1 -1
  7. package/README.md +41 -27
  8. package/api.md +32 -25
  9. package/dist/CHANGELOG.md +41 -0
  10. package/dist/LICENSE +1 -1
  11. package/dist/README.md +41 -27
  12. package/dist/core.d.ts.map +1 -1
  13. package/dist/core.js +5 -0
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.mjs +5 -0
  16. package/dist/core.mjs.map +1 -1
  17. package/dist/index.d.mts +12 -6
  18. package/dist/index.d.ts +12 -6
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/package.json +1 -1
  23. package/dist/resources/alpha/admin.d.ts +41 -0
  24. package/dist/resources/alpha/admin.d.ts.map +1 -0
  25. package/dist/resources/alpha/admin.js +46 -0
  26. package/dist/resources/alpha/admin.js.map +1 -0
  27. package/dist/resources/alpha/admin.mjs +42 -0
  28. package/dist/resources/alpha/admin.mjs.map +1 -0
  29. package/dist/resources/alpha/alpha.d.ts +8 -4
  30. package/dist/resources/alpha/alpha.d.ts.map +1 -1
  31. package/dist/resources/alpha/alpha.js +6 -2
  32. package/dist/resources/alpha/alpha.js.map +1 -1
  33. package/dist/resources/alpha/alpha.mjs +6 -2
  34. package/dist/resources/alpha/alpha.mjs.map +1 -1
  35. package/dist/resources/alpha/benchmarks.d.ts +37 -1
  36. package/dist/resources/alpha/benchmarks.d.ts.map +1 -1
  37. package/dist/resources/alpha/eval/eval.d.ts +28 -7
  38. package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
  39. package/dist/resources/alpha/eval/eval.js.map +1 -1
  40. package/dist/resources/alpha/eval/eval.mjs.map +1 -1
  41. package/dist/resources/alpha/index.d.ts +2 -1
  42. package/dist/resources/alpha/index.d.ts.map +1 -1
  43. package/dist/resources/alpha/index.js +3 -1
  44. package/dist/resources/alpha/index.js.map +1 -1
  45. package/dist/resources/alpha/index.mjs +1 -0
  46. package/dist/resources/alpha/index.mjs.map +1 -1
  47. package/dist/resources/alpha/inference.d.ts +58 -7
  48. package/dist/resources/alpha/inference.d.ts.map +1 -1
  49. package/dist/resources/alpha/post-training/index.d.ts +2 -2
  50. package/dist/resources/alpha/post-training/index.d.ts.map +1 -1
  51. package/dist/resources/alpha/post-training/index.js.map +1 -1
  52. package/dist/resources/alpha/post-training/index.mjs +1 -1
  53. package/dist/resources/alpha/post-training/index.mjs.map +1 -1
  54. package/dist/resources/alpha/post-training/job.d.ts +4 -16
  55. package/dist/resources/alpha/post-training/job.d.ts.map +1 -1
  56. package/dist/resources/alpha/post-training/job.js +5 -6
  57. package/dist/resources/alpha/post-training/job.js.map +1 -1
  58. package/dist/resources/alpha/post-training/job.mjs +5 -6
  59. package/dist/resources/alpha/post-training/job.mjs.map +1 -1
  60. package/dist/resources/alpha/post-training/post-training.d.ts +38 -11
  61. package/dist/resources/alpha/post-training/post-training.d.ts.map +1 -1
  62. package/dist/resources/alpha/post-training/post-training.js.map +1 -1
  63. package/dist/resources/alpha/post-training/post-training.mjs +1 -1
  64. package/dist/resources/alpha/post-training/post-training.mjs.map +1 -1
  65. package/dist/resources/beta/datasets.d.ts +102 -8
  66. package/dist/resources/beta/datasets.d.ts.map +1 -1
  67. package/dist/resources/chat/chat.d.ts +119 -17
  68. package/dist/resources/chat/chat.d.ts.map +1 -1
  69. package/dist/resources/chat/chat.js.map +1 -1
  70. package/dist/resources/chat/chat.mjs.map +1 -1
  71. package/dist/resources/chat/completions.d.ts +1130 -73
  72. package/dist/resources/chat/completions.d.ts.map +1 -1
  73. package/dist/resources/chat/completions.js +0 -2
  74. package/dist/resources/chat/completions.js.map +1 -1
  75. package/dist/resources/chat/completions.mjs +0 -2
  76. package/dist/resources/chat/completions.mjs.map +1 -1
  77. package/dist/resources/completions.d.ts +135 -26
  78. package/dist/resources/completions.d.ts.map +1 -1
  79. package/dist/resources/completions.js.map +1 -1
  80. package/dist/resources/completions.mjs.map +1 -1
  81. package/dist/resources/conversations/conversations.d.ts +56 -12
  82. package/dist/resources/conversations/conversations.d.ts.map +1 -1
  83. package/dist/resources/conversations/conversations.js +0 -8
  84. package/dist/resources/conversations/conversations.js.map +1 -1
  85. package/dist/resources/conversations/conversations.mjs +0 -8
  86. package/dist/resources/conversations/conversations.mjs.map +1 -1
  87. package/dist/resources/conversations/items.d.ts +364 -81
  88. package/dist/resources/conversations/items.d.ts.map +1 -1
  89. package/dist/resources/conversations/items.js +0 -6
  90. package/dist/resources/conversations/items.js.map +1 -1
  91. package/dist/resources/conversations/items.mjs +0 -6
  92. package/dist/resources/conversations/items.mjs.map +1 -1
  93. package/dist/resources/embeddings.d.ts +46 -8
  94. package/dist/resources/embeddings.d.ts.map +1 -1
  95. package/dist/resources/embeddings.js +0 -2
  96. package/dist/resources/embeddings.js.map +1 -1
  97. package/dist/resources/embeddings.mjs +0 -2
  98. package/dist/resources/embeddings.mjs.map +1 -1
  99. package/dist/resources/files.d.ts +58 -31
  100. package/dist/resources/files.d.ts.map +1 -1
  101. package/dist/resources/files.js +4 -16
  102. package/dist/resources/files.js.map +1 -1
  103. package/dist/resources/files.mjs +4 -16
  104. package/dist/resources/files.mjs.map +1 -1
  105. package/dist/resources/index.d.ts +3 -3
  106. package/dist/resources/index.d.ts.map +1 -1
  107. package/dist/resources/index.js.map +1 -1
  108. package/dist/resources/index.mjs.map +1 -1
  109. package/dist/resources/inspect.d.ts +3 -45
  110. package/dist/resources/inspect.d.ts.map +1 -1
  111. package/dist/resources/inspect.js +0 -4
  112. package/dist/resources/inspect.js.map +1 -1
  113. package/dist/resources/inspect.mjs +0 -4
  114. package/dist/resources/inspect.mjs.map +1 -1
  115. package/dist/resources/models/models.d.ts +21 -6
  116. package/dist/resources/models/models.d.ts.map +1 -1
  117. package/dist/resources/models/models.js +0 -6
  118. package/dist/resources/models/models.js.map +1 -1
  119. package/dist/resources/models/models.mjs +0 -6
  120. package/dist/resources/models/models.mjs.map +1 -1
  121. package/dist/resources/moderations.d.ts +38 -5
  122. package/dist/resources/moderations.d.ts.map +1 -1
  123. package/dist/resources/moderations.js +1 -3
  124. package/dist/resources/moderations.js.map +1 -1
  125. package/dist/resources/moderations.mjs +1 -3
  126. package/dist/resources/moderations.mjs.map +1 -1
  127. package/dist/resources/prompts/prompts.d.ts +24 -10
  128. package/dist/resources/prompts/prompts.d.ts.map +1 -1
  129. package/dist/resources/prompts/prompts.js +2 -10
  130. package/dist/resources/prompts/prompts.js.map +1 -1
  131. package/dist/resources/prompts/prompts.mjs +2 -10
  132. package/dist/resources/prompts/prompts.mjs.map +1 -1
  133. package/dist/resources/prompts/versions.d.ts +0 -2
  134. package/dist/resources/prompts/versions.d.ts.map +1 -1
  135. package/dist/resources/prompts/versions.js +0 -2
  136. package/dist/resources/prompts/versions.js.map +1 -1
  137. package/dist/resources/prompts/versions.mjs +0 -2
  138. package/dist/resources/prompts/versions.mjs.map +1 -1
  139. package/dist/resources/providers.d.ts +5 -12
  140. package/dist/resources/providers.d.ts.map +1 -1
  141. package/dist/resources/providers.js +0 -4
  142. package/dist/resources/providers.js.map +1 -1
  143. package/dist/resources/providers.mjs +0 -4
  144. package/dist/resources/providers.mjs.map +1 -1
  145. package/dist/resources/responses/input-items.d.ts +108 -9
  146. package/dist/resources/responses/input-items.d.ts.map +1 -1
  147. package/dist/resources/responses/responses.d.ts +881 -124
  148. package/dist/resources/responses/responses.d.ts.map +1 -1
  149. package/dist/resources/responses/responses.js.map +1 -1
  150. package/dist/resources/responses/responses.mjs.map +1 -1
  151. package/dist/resources/routes.d.ts +10 -9
  152. package/dist/resources/routes.d.ts.map +1 -1
  153. package/dist/resources/routes.js.map +1 -1
  154. package/dist/resources/routes.mjs.map +1 -1
  155. package/dist/resources/safety.d.ts +131 -9
  156. package/dist/resources/safety.d.ts.map +1 -1
  157. package/dist/resources/safety.js +1 -3
  158. package/dist/resources/safety.js.map +1 -1
  159. package/dist/resources/safety.mjs +1 -3
  160. package/dist/resources/safety.mjs.map +1 -1
  161. package/dist/resources/scoring-functions.d.ts +23 -1
  162. package/dist/resources/scoring-functions.d.ts.map +1 -1
  163. package/dist/resources/scoring.d.ts +24 -0
  164. package/dist/resources/scoring.d.ts.map +1 -1
  165. package/dist/resources/shared.d.ts +139 -7
  166. package/dist/resources/shared.d.ts.map +1 -1
  167. package/dist/resources/shields.d.ts +21 -0
  168. package/dist/resources/shields.d.ts.map +1 -1
  169. package/dist/resources/vector-io.d.ts +75 -58
  170. package/dist/resources/vector-io.d.ts.map +1 -1
  171. package/dist/resources/vector-io.js +1 -1
  172. package/dist/resources/vector-io.mjs +1 -1
  173. package/dist/resources/vector-stores/file-batches.d.ts +13 -7
  174. package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
  175. package/dist/resources/vector-stores/file-batches.js +3 -6
  176. package/dist/resources/vector-stores/file-batches.js.map +1 -1
  177. package/dist/resources/vector-stores/file-batches.mjs +3 -6
  178. package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
  179. package/dist/resources/vector-stores/files.d.ts +31 -9
  180. package/dist/resources/vector-stores/files.d.ts.map +1 -1
  181. package/dist/resources/vector-stores/files.js +4 -4
  182. package/dist/resources/vector-stores/files.js.map +1 -1
  183. package/dist/resources/vector-stores/files.mjs +4 -4
  184. package/dist/resources/vector-stores/files.mjs.map +1 -1
  185. package/dist/resources/vector-stores/vector-stores.d.ts +87 -13
  186. package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
  187. package/dist/resources/vector-stores/vector-stores.js +5 -10
  188. package/dist/resources/vector-stores/vector-stores.js.map +1 -1
  189. package/dist/resources/vector-stores/vector-stores.mjs +5 -10
  190. package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
  191. package/dist/src/core.ts +6 -0
  192. package/dist/src/index.ts +11 -16
  193. package/dist/src/resources/alpha/admin.ts +84 -0
  194. package/dist/src/resources/alpha/alpha.ts +16 -8
  195. package/dist/src/resources/alpha/benchmarks.ts +37 -1
  196. package/dist/src/resources/alpha/eval/eval.ts +28 -7
  197. package/dist/src/resources/alpha/index.ts +2 -0
  198. package/dist/src/resources/alpha/inference.ts +58 -7
  199. package/dist/src/resources/alpha/post-training/index.ts +2 -10
  200. package/dist/src/resources/alpha/post-training/job.ts +5 -26
  201. package/dist/src/resources/alpha/post-training/post-training.ts +38 -22
  202. package/dist/src/resources/beta/datasets.ts +103 -8
  203. package/dist/src/resources/chat/chat.ts +122 -20
  204. package/dist/src/resources/chat/completions.ts +1138 -79
  205. package/dist/src/resources/completions.ts +137 -28
  206. package/dist/src/resources/conversations/conversations.ts +67 -15
  207. package/dist/src/resources/conversations/items.ts +479 -110
  208. package/dist/src/resources/embeddings.ts +46 -8
  209. package/dist/src/resources/files.ts +58 -31
  210. package/dist/src/resources/index.ts +3 -3
  211. package/dist/src/resources/inspect.ts +3 -57
  212. package/dist/src/resources/models/models.ts +21 -6
  213. package/dist/src/resources/moderations.ts +38 -5
  214. package/dist/src/resources/prompts/prompts.ts +26 -12
  215. package/dist/src/resources/prompts/versions.ts +0 -2
  216. package/dist/src/resources/providers.ts +5 -16
  217. package/dist/src/resources/responses/input-items.ts +138 -15
  218. package/dist/src/resources/responses/responses.ts +1076 -196
  219. package/dist/src/resources/routes.ts +10 -14
  220. package/dist/src/resources/safety.ts +131 -8
  221. package/dist/src/resources/scoring-functions.ts +23 -1
  222. package/dist/src/resources/scoring.ts +24 -0
  223. package/dist/src/resources/shared.ts +148 -7
  224. package/dist/src/resources/shields.ts +21 -0
  225. package/dist/src/resources/vector-io.ts +95 -78
  226. package/dist/src/resources/vector-stores/file-batches.ts +13 -7
  227. package/dist/src/resources/vector-stores/files.ts +31 -11
  228. package/dist/src/resources/vector-stores/vector-stores.ts +89 -15
  229. package/dist/src/version.ts +1 -1
  230. package/dist/version.d.ts +1 -1
  231. package/dist/version.js +1 -1
  232. package/dist/version.mjs +1 -1
  233. package/package.json +1 -1
  234. package/src/core.ts +6 -0
  235. package/src/index.ts +11 -16
  236. package/src/resources/alpha/admin.ts +84 -0
  237. package/src/resources/alpha/alpha.ts +16 -8
  238. package/src/resources/alpha/benchmarks.ts +37 -1
  239. package/src/resources/alpha/eval/eval.ts +28 -7
  240. package/src/resources/alpha/index.ts +2 -0
  241. package/src/resources/alpha/inference.ts +58 -7
  242. package/src/resources/alpha/post-training/index.ts +2 -10
  243. package/src/resources/alpha/post-training/job.ts +5 -26
  244. package/src/resources/alpha/post-training/post-training.ts +38 -22
  245. package/src/resources/beta/datasets.ts +103 -8
  246. package/src/resources/chat/chat.ts +122 -20
  247. package/src/resources/chat/completions.ts +1138 -79
  248. package/src/resources/completions.ts +137 -28
  249. package/src/resources/conversations/conversations.ts +67 -15
  250. package/src/resources/conversations/items.ts +479 -110
  251. package/src/resources/embeddings.ts +46 -8
  252. package/src/resources/files.ts +58 -31
  253. package/src/resources/index.ts +3 -3
  254. package/src/resources/inspect.ts +3 -57
  255. package/src/resources/models/models.ts +21 -6
  256. package/src/resources/moderations.ts +38 -5
  257. package/src/resources/prompts/prompts.ts +26 -12
  258. package/src/resources/prompts/versions.ts +0 -2
  259. package/src/resources/providers.ts +5 -16
  260. package/src/resources/responses/input-items.ts +138 -15
  261. package/src/resources/responses/responses.ts +1076 -196
  262. package/src/resources/routes.ts +10 -14
  263. package/src/resources/safety.ts +131 -8
  264. package/src/resources/scoring-functions.ts +23 -1
  265. package/src/resources/scoring.ts +24 -0
  266. package/src/resources/shared.ts +148 -7
  267. package/src/resources/shields.ts +21 -0
  268. package/src/resources/vector-io.ts +95 -78
  269. package/src/resources/vector-stores/file-batches.ts +13 -7
  270. package/src/resources/vector-stores/files.ts +31 -11
  271. package/src/resources/vector-stores/vector-stores.ts +89 -15
  272. package/src/version.ts +1 -1
  273. package/tests/api-resources/alpha/admin.test.ts +111 -0
  274. package/tests/api-resources/alpha/eval/eval.test.ts +40 -20
  275. package/tests/api-resources/alpha/inference.test.ts +1 -1
  276. package/tests/api-resources/alpha/post-training/job.test.ts +21 -12
  277. package/tests/api-resources/alpha/post-training/post-training.test.ts +12 -2
  278. package/tests/api-resources/beta/datasets.test.ts +9 -3
  279. package/tests/api-resources/chat/completions.test.ts +20 -7
  280. package/tests/api-resources/completions.test.ts +5 -5
  281. package/tests/api-resources/conversations/items.test.ts +22 -3
  282. package/tests/api-resources/embeddings.test.ts +2 -2
  283. package/tests/api-resources/files.test.ts +6 -1
  284. package/tests/api-resources/responses/input-items.test.ts +7 -1
  285. package/tests/api-resources/responses/responses.test.ts +19 -5
  286. package/tests/api-resources/safety.test.ts +9 -5
  287. package/tests/api-resources/tool-runtime.test.ts +9 -2
  288. package/tests/api-resources/vector-io.test.ts +13 -4
  289. package/tests/api-resources/vector-stores/file-batches.test.ts +7 -1
  290. package/tests/api-resources/vector-stores/files.test.ts +7 -1
  291. package/tests/api-resources/vector-stores/vector-stores.test.ts +14 -2
@@ -101,6 +101,9 @@ export class Datasets extends APIResource {
101
101
  * Response from listing datasets.
102
102
  */
103
103
  export interface ListDatasetsResponse {
104
+ /**
105
+ * List of datasets
106
+ */
104
107
  data: DatasetListResponse;
105
108
  }
106
109
 
@@ -119,12 +122,12 @@ export interface DatasetRetrieveResponse {
119
122
  provider_id: string;
120
123
 
121
124
  /**
122
- * Purpose of the dataset. Each purpose has a required input data schema.
125
+ * Purpose of the dataset indicating its intended use
123
126
  */
124
127
  purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
125
128
 
126
129
  /**
127
- * A dataset that can be obtained from a URI.
130
+ * Data source configuration for the dataset
128
131
  */
129
132
  source: DatasetRetrieveResponse.UriDataSource | DatasetRetrieveResponse.RowsDataSource;
130
133
 
@@ -138,6 +141,9 @@ export interface DatasetRetrieveResponse {
138
141
  */
139
142
  provider_resource_id?: string | null;
140
143
 
144
+ /**
145
+ * Type of resource, always 'dataset' for datasets
146
+ */
141
147
  type?: 'dataset';
142
148
  }
143
149
 
@@ -146,8 +152,16 @@ export namespace DatasetRetrieveResponse {
146
152
  * A dataset that can be obtained from a URI.
147
153
  */
148
154
  export interface UriDataSource {
155
+ /**
156
+ * The dataset can be obtained from a URI. E.g.
157
+ * "https://mywebsite.com/mydata.jsonl", "lsfs://mydata.jsonl",
158
+ * "data:csv;base64,{base64_content}"
159
+ */
149
160
  uri: string;
150
161
 
162
+ /**
163
+ * The type of data source.
164
+ */
151
165
  type?: 'uri';
152
166
  }
153
167
 
@@ -155,12 +169,22 @@ export namespace DatasetRetrieveResponse {
155
169
  * A dataset stored in rows.
156
170
  */
157
171
  export interface RowsDataSource {
172
+ /**
173
+ * The dataset is stored in rows. E.g. [{"messages": [{"role": "user", "content":
174
+ * "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}]
175
+ */
158
176
  rows: Array<{ [key: string]: unknown }>;
159
177
 
178
+ /**
179
+ * The type of data source.
180
+ */
160
181
  type?: 'rows';
161
182
  }
162
183
  }
163
184
 
185
+ /**
186
+ * List of datasets
187
+ */
164
188
  export type DatasetListResponse = Array<DatasetListResponse.DatasetListResponseItem>;
165
189
 
166
190
  export namespace DatasetListResponse {
@@ -179,12 +203,12 @@ export namespace DatasetListResponse {
179
203
  provider_id: string;
180
204
 
181
205
  /**
182
- * Purpose of the dataset. Each purpose has a required input data schema.
206
+ * Purpose of the dataset indicating its intended use
183
207
  */
184
208
  purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
185
209
 
186
210
  /**
187
- * A dataset that can be obtained from a URI.
211
+ * Data source configuration for the dataset
188
212
  */
189
213
  source: DatasetListResponseItem.UriDataSource | DatasetListResponseItem.RowsDataSource;
190
214
 
@@ -198,6 +222,9 @@ export namespace DatasetListResponse {
198
222
  */
199
223
  provider_resource_id?: string | null;
200
224
 
225
+ /**
226
+ * Type of resource, always 'dataset' for datasets
227
+ */
201
228
  type?: 'dataset';
202
229
  }
203
230
 
@@ -206,8 +233,16 @@ export namespace DatasetListResponse {
206
233
  * A dataset that can be obtained from a URI.
207
234
  */
208
235
  export interface UriDataSource {
236
+ /**
237
+ * The dataset can be obtained from a URI. E.g.
238
+ * "https://mywebsite.com/mydata.jsonl", "lsfs://mydata.jsonl",
239
+ * "data:csv;base64,{base64_content}"
240
+ */
209
241
  uri: string;
210
242
 
243
+ /**
244
+ * The type of data source.
245
+ */
211
246
  type?: 'uri';
212
247
  }
213
248
 
@@ -215,8 +250,15 @@ export namespace DatasetListResponse {
215
250
  * A dataset stored in rows.
216
251
  */
217
252
  export interface RowsDataSource {
253
+ /**
254
+ * The dataset is stored in rows. E.g. [{"messages": [{"role": "user", "content":
255
+ * "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}]
256
+ */
218
257
  rows: Array<{ [key: string]: unknown }>;
219
258
 
259
+ /**
260
+ * The type of data source.
261
+ */
220
262
  type?: 'rows';
221
263
  }
222
264
  }
@@ -248,12 +290,12 @@ export interface DatasetRegisterResponse {
248
290
  provider_id: string;
249
291
 
250
292
  /**
251
- * Purpose of the dataset. Each purpose has a required input data schema.
293
+ * Purpose of the dataset indicating its intended use
252
294
  */
253
295
  purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
254
296
 
255
297
  /**
256
- * A dataset that can be obtained from a URI.
298
+ * Data source configuration for the dataset
257
299
  */
258
300
  source: DatasetRegisterResponse.UriDataSource | DatasetRegisterResponse.RowsDataSource;
259
301
 
@@ -267,6 +309,9 @@ export interface DatasetRegisterResponse {
267
309
  */
268
310
  provider_resource_id?: string | null;
269
311
 
312
+ /**
313
+ * Type of resource, always 'dataset' for datasets
314
+ */
270
315
  type?: 'dataset';
271
316
  }
272
317
 
@@ -275,8 +320,16 @@ export namespace DatasetRegisterResponse {
275
320
  * A dataset that can be obtained from a URI.
276
321
  */
277
322
  export interface UriDataSource {
323
+ /**
324
+ * The dataset can be obtained from a URI. E.g.
325
+ * "https://mywebsite.com/mydata.jsonl", "lsfs://mydata.jsonl",
326
+ * "data:csv;base64,{base64_content}"
327
+ */
278
328
  uri: string;
279
329
 
330
+ /**
331
+ * The type of data source.
332
+ */
280
333
  type?: 'uri';
281
334
  }
282
335
 
@@ -284,35 +337,62 @@ export namespace DatasetRegisterResponse {
284
337
  * A dataset stored in rows.
285
338
  */
286
339
  export interface RowsDataSource {
340
+ /**
341
+ * The dataset is stored in rows. E.g. [{"messages": [{"role": "user", "content":
342
+ * "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}]
343
+ */
287
344
  rows: Array<{ [key: string]: unknown }>;
288
345
 
346
+ /**
347
+ * The type of data source.
348
+ */
289
349
  type?: 'rows';
290
350
  }
291
351
  }
292
352
 
293
353
  export interface DatasetAppendrowsParams {
354
+ /**
355
+ * The ID of the dataset to append the rows to.
356
+ */
357
+ body_dataset_id: string;
358
+
359
+ /**
360
+ * The rows to append to the dataset.
361
+ */
294
362
  rows: Array<{ [key: string]: unknown }>;
295
363
  }
296
364
 
297
365
  export interface DatasetIterrowsParams {
366
+ /**
367
+ * The number of rows to get.
368
+ */
298
369
  limit?: number | null;
299
370
 
371
+ /**
372
+ * Index into dataset for the first row to get. Get all rows if None.
373
+ */
300
374
  start_index?: number | null;
301
375
  }
302
376
 
303
377
  export interface DatasetRegisterParams {
304
378
  /**
305
- * Purpose of the dataset. Each purpose has a required input data schema.
379
+ * The purpose of the dataset.
306
380
  */
307
381
  purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
308
382
 
309
383
  /**
310
- * A dataset that can be obtained from a URI.
384
+ * The data source of the dataset.
311
385
  */
312
386
  source: DatasetRegisterParams.UriDataSource | DatasetRegisterParams.RowsDataSource;
313
387
 
388
+ /**
389
+ * The ID of the dataset. If not provided, an ID will be generated.
390
+ */
314
391
  dataset_id?: string | null;
315
392
 
393
+ /**
394
+ * The metadata for the dataset.
395
+ */
316
396
  metadata?: { [key: string]: unknown } | null;
317
397
  }
318
398
 
@@ -321,8 +401,16 @@ export namespace DatasetRegisterParams {
321
401
  * A dataset that can be obtained from a URI.
322
402
  */
323
403
  export interface UriDataSource {
404
+ /**
405
+ * The dataset can be obtained from a URI. E.g.
406
+ * "https://mywebsite.com/mydata.jsonl", "lsfs://mydata.jsonl",
407
+ * "data:csv;base64,{base64_content}"
408
+ */
324
409
  uri: string;
325
410
 
411
+ /**
412
+ * The type of data source.
413
+ */
326
414
  type?: 'uri';
327
415
  }
328
416
 
@@ -330,8 +418,15 @@ export namespace DatasetRegisterParams {
330
418
  * A dataset stored in rows.
331
419
  */
332
420
  export interface RowsDataSource {
421
+ /**
422
+ * The dataset is stored in rows. E.g. [{"messages": [{"role": "user", "content":
423
+ * "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}]
424
+ */
333
425
  rows: Array<{ [key: string]: unknown }>;
334
426
 
427
+ /**
428
+ * The type of data source.
429
+ */
335
430
  type?: 'rows';
336
431
  }
337
432
  }
@@ -27,14 +27,29 @@ export class Chat extends APIResource {
27
27
  * Chunk from a streaming response to an OpenAI-compatible chat completion request.
28
28
  */
29
29
  export interface ChatCompletionChunk {
30
+ /**
31
+ * The ID of the chat completion.
32
+ */
30
33
  id: string;
31
34
 
35
+ /**
36
+ * List of choices.
37
+ */
32
38
  choices: Array<ChatCompletionChunk.Choice>;
33
39
 
40
+ /**
41
+ * The Unix timestamp in seconds when the chat completion was created.
42
+ */
34
43
  created: number;
35
44
 
45
+ /**
46
+ * The model that was used to generate the chat completion.
47
+ */
36
48
  model: string;
37
49
 
50
+ /**
51
+ * The object type.
52
+ */
38
53
  object?: 'chat.completion.chunk';
39
54
 
40
55
  /**
@@ -49,14 +64,20 @@ export namespace ChatCompletionChunk {
49
64
  */
50
65
  export interface Choice {
51
66
  /**
52
- * A delta from an OpenAI-compatible chat completion streaming response.
67
+ * The delta from the chunk.
53
68
  */
54
69
  delta: Choice.Delta;
55
70
 
56
- finish_reason: string;
57
-
71
+ /**
72
+ * The index of the choice.
73
+ */
58
74
  index: number;
59
75
 
76
+ /**
77
+ * The reason the model stopped generating.
78
+ */
79
+ finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call' | null;
80
+
60
81
  /**
61
82
  * The log probabilities for the tokens in the message from an OpenAI-compatible
62
83
  * chat completion response.
@@ -66,17 +87,32 @@ export namespace ChatCompletionChunk {
66
87
 
67
88
  export namespace Choice {
68
89
  /**
69
- * A delta from an OpenAI-compatible chat completion streaming response.
90
+ * The delta from the chunk.
70
91
  */
71
92
  export interface Delta {
93
+ /**
94
+ * The content of the delta.
95
+ */
72
96
  content?: string | null;
73
97
 
98
+ /**
99
+ * The reasoning content from the model (for o1/o3 models).
100
+ */
74
101
  reasoning_content?: string | null;
75
102
 
103
+ /**
104
+ * The refusal of the delta.
105
+ */
76
106
  refusal?: string | null;
77
107
 
108
+ /**
109
+ * The role of the delta.
110
+ */
78
111
  role?: string | null;
79
112
 
113
+ /**
114
+ * The tool calls of the delta.
115
+ */
80
116
  tool_calls?: Array<Delta.ToolCall> | null;
81
117
  }
82
118
 
@@ -85,6 +121,9 @@ export namespace ChatCompletionChunk {
85
121
  * Tool call specification for OpenAI-compatible chat completion responses.
86
122
  */
87
123
  export interface ToolCall {
124
+ /**
125
+ * Unique identifier for the tool call.
126
+ */
88
127
  id?: string | null;
89
128
 
90
129
  /**
@@ -92,8 +131,14 @@ export namespace ChatCompletionChunk {
92
131
  */
93
132
  function?: ToolCall.Function | null;
94
133
 
134
+ /**
135
+ * Index of the tool call in the list.
136
+ */
95
137
  index?: number | null;
96
138
 
139
+ /**
140
+ * Must be 'function' to identify this as a function call.
141
+ */
97
142
  type?: 'function';
98
143
  }
99
144
 
@@ -102,8 +147,14 @@ export namespace ChatCompletionChunk {
102
147
  * Function call details for OpenAI-compatible tool calls.
103
148
  */
104
149
  export interface Function {
150
+ /**
151
+ * Arguments to pass to the function as a JSON string.
152
+ */
105
153
  arguments?: string | null;
106
154
 
155
+ /**
156
+ * Name of the function to call.
157
+ */
107
158
  name?: string | null;
108
159
  }
109
160
  }
@@ -114,8 +165,14 @@ export namespace ChatCompletionChunk {
114
165
  * chat completion response.
115
166
  */
116
167
  export interface Logprobs {
168
+ /**
169
+ * The log probabilities for the tokens in the message.
170
+ */
117
171
  content?: Array<Logprobs.Content> | null;
118
172
 
173
+ /**
174
+ * The log probabilities for the refusal tokens.
175
+ */
119
176
  refusal?: Array<Logprobs.Refusal> | null;
120
177
  }
121
178
 
@@ -123,33 +180,48 @@ export namespace ChatCompletionChunk {
123
180
  /**
124
181
  * The log probability for a token from an OpenAI-compatible chat completion
125
182
  * response.
126
- *
127
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
128
- * probability of the token :top_logprobs: The top log probabilities for the token
129
183
  */
130
184
  export interface Content {
185
+ /**
186
+ * The token.
187
+ */
131
188
  token: string;
132
189
 
190
+ /**
191
+ * The log probability of the token.
192
+ */
133
193
  logprob: number;
134
194
 
135
- top_logprobs: Array<Content.TopLogprob>;
136
-
195
+ /**
196
+ * The bytes for the token.
197
+ */
137
198
  bytes?: Array<number> | null;
199
+
200
+ /**
201
+ * The top log probabilities for the token.
202
+ */
203
+ top_logprobs?: Array<Content.TopLogprob> | null;
138
204
  }
139
205
 
140
206
  export namespace Content {
141
207
  /**
142
208
  * The top log probability for a token from an OpenAI-compatible chat completion
143
209
  * response.
144
- *
145
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
146
- * probability of the token
147
210
  */
148
211
  export interface TopLogprob {
212
+ /**
213
+ * The token.
214
+ */
149
215
  token: string;
150
216
 
217
+ /**
218
+ * The log probability of the token.
219
+ */
151
220
  logprob: number;
152
221
 
222
+ /**
223
+ * The bytes for the token.
224
+ */
153
225
  bytes?: Array<number> | null;
154
226
  }
155
227
  }
@@ -157,33 +229,48 @@ export namespace ChatCompletionChunk {
157
229
  /**
158
230
  * The log probability for a token from an OpenAI-compatible chat completion
159
231
  * response.
160
- *
161
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
162
- * probability of the token :top_logprobs: The top log probabilities for the token
163
232
  */
164
233
  export interface Refusal {
234
+ /**
235
+ * The token.
236
+ */
165
237
  token: string;
166
238
 
239
+ /**
240
+ * The log probability of the token.
241
+ */
167
242
  logprob: number;
168
243
 
169
- top_logprobs: Array<Refusal.TopLogprob>;
170
-
244
+ /**
245
+ * The bytes for the token.
246
+ */
171
247
  bytes?: Array<number> | null;
248
+
249
+ /**
250
+ * The top log probabilities for the token.
251
+ */
252
+ top_logprobs?: Array<Refusal.TopLogprob> | null;
172
253
  }
173
254
 
174
255
  export namespace Refusal {
175
256
  /**
176
257
  * The top log probability for a token from an OpenAI-compatible chat completion
177
258
  * response.
178
- *
179
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
180
- * probability of the token
181
259
  */
182
260
  export interface TopLogprob {
261
+ /**
262
+ * The token.
263
+ */
183
264
  token: string;
184
265
 
266
+ /**
267
+ * The log probability of the token.
268
+ */
185
269
  logprob: number;
186
270
 
271
+ /**
272
+ * The bytes for the token.
273
+ */
187
274
  bytes?: Array<number> | null;
188
275
  }
189
276
  }
@@ -194,10 +281,19 @@ export namespace ChatCompletionChunk {
194
281
  * Usage information for OpenAI chat completion.
195
282
  */
196
283
  export interface Usage {
284
+ /**
285
+ * Number of tokens in the completion.
286
+ */
197
287
  completion_tokens: number;
198
288
 
289
+ /**
290
+ * Number of tokens in the prompt.
291
+ */
199
292
  prompt_tokens: number;
200
293
 
294
+ /**
295
+ * Total tokens used (prompt + completion).
296
+ */
201
297
  total_tokens: number;
202
298
 
203
299
  /**
@@ -216,6 +312,9 @@ export namespace ChatCompletionChunk {
216
312
  * Token details for output tokens in OpenAI chat completion usage.
217
313
  */
218
314
  export interface CompletionTokensDetails {
315
+ /**
316
+ * Number of tokens used for reasoning (o1/o3 models).
317
+ */
219
318
  reasoning_tokens?: number | null;
220
319
  }
221
320
 
@@ -223,6 +322,9 @@ export namespace ChatCompletionChunk {
223
322
  * Token details for prompt tokens in OpenAI chat completion usage.
224
323
  */
225
324
  export interface PromptTokensDetails {
325
+ /**
326
+ * Number of tokens retrieved from cache.
327
+ */
226
328
  cached_tokens?: number | null;
227
329
  }
228
330
  }