llama-stack-client 0.2.7 → 0.2.8-rc2

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 (199) hide show
  1. package/index.d.mts +3 -0
  2. package/index.d.ts +3 -0
  3. package/index.d.ts.map +1 -1
  4. package/index.js +3 -0
  5. package/index.js.map +1 -1
  6. package/index.mjs +3 -0
  7. package/index.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agents/agents.d.ts +13 -1
  10. package/resources/agents/agents.d.ts.map +1 -1
  11. package/resources/agents/agents.js +1 -1
  12. package/resources/agents/agents.js.map +1 -1
  13. package/resources/agents/agents.mjs +1 -1
  14. package/resources/agents/agents.mjs.map +1 -1
  15. package/resources/agents/session.d.ts +1 -1
  16. package/resources/agents/session.js +1 -1
  17. package/resources/agents/session.mjs +1 -1
  18. package/resources/benchmarks.d.ts +28 -1
  19. package/resources/benchmarks.d.ts.map +1 -1
  20. package/resources/benchmarks.js +9 -0
  21. package/resources/benchmarks.js.map +1 -1
  22. package/resources/benchmarks.mjs +9 -0
  23. package/resources/benchmarks.mjs.map +1 -1
  24. package/resources/chat/chat.d.ts +2 -2
  25. package/resources/chat/chat.d.ts.map +1 -1
  26. package/resources/chat/chat.js.map +1 -1
  27. package/resources/chat/chat.mjs.map +1 -1
  28. package/resources/chat/completions.d.ts +1015 -29
  29. package/resources/chat/completions.d.ts.map +1 -1
  30. package/resources/chat/completions.js +13 -0
  31. package/resources/chat/completions.js.map +1 -1
  32. package/resources/chat/completions.mjs +13 -0
  33. package/resources/chat/completions.mjs.map +1 -1
  34. package/resources/chat/index.d.ts +1 -1
  35. package/resources/chat/index.d.ts.map +1 -1
  36. package/resources/chat/index.js.map +1 -1
  37. package/resources/chat/index.mjs.map +1 -1
  38. package/resources/completions.d.ts +18 -18
  39. package/resources/datasets.d.ts +16 -7
  40. package/resources/datasets.d.ts.map +1 -1
  41. package/resources/datasets.js +9 -0
  42. package/resources/datasets.js.map +1 -1
  43. package/resources/datasets.mjs +9 -0
  44. package/resources/datasets.mjs.map +1 -1
  45. package/resources/index.d.ts +1 -0
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +1 -0
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/inference.d.ts +51 -12
  52. package/resources/inference.d.ts.map +1 -1
  53. package/resources/inference.js +6 -0
  54. package/resources/inference.js.map +1 -1
  55. package/resources/inference.mjs +6 -0
  56. package/resources/inference.mjs.map +1 -1
  57. package/resources/inspect.d.ts +6 -0
  58. package/resources/inspect.d.ts.map +1 -1
  59. package/resources/inspect.js +6 -0
  60. package/resources/inspect.js.map +1 -1
  61. package/resources/inspect.mjs +6 -0
  62. package/resources/inspect.mjs.map +1 -1
  63. package/resources/models.d.ts +28 -1
  64. package/resources/models.d.ts.map +1 -1
  65. package/resources/models.js +12 -0
  66. package/resources/models.js.map +1 -1
  67. package/resources/models.mjs +12 -0
  68. package/resources/models.mjs.map +1 -1
  69. package/resources/post-training/job.d.ts +21 -0
  70. package/resources/post-training/job.d.ts.map +1 -1
  71. package/resources/post-training/job.js +12 -0
  72. package/resources/post-training/job.js.map +1 -1
  73. package/resources/post-training/job.mjs +12 -0
  74. package/resources/post-training/job.mjs.map +1 -1
  75. package/resources/post-training/post-training.d.ts +54 -0
  76. package/resources/post-training/post-training.d.ts.map +1 -1
  77. package/resources/post-training/post-training.js +6 -0
  78. package/resources/post-training/post-training.js.map +1 -1
  79. package/resources/post-training/post-training.mjs +6 -0
  80. package/resources/post-training/post-training.mjs.map +1 -1
  81. package/resources/providers.d.ts +6 -0
  82. package/resources/providers.d.ts.map +1 -1
  83. package/resources/providers.js +6 -0
  84. package/resources/providers.js.map +1 -1
  85. package/resources/providers.mjs +6 -0
  86. package/resources/providers.mjs.map +1 -1
  87. package/resources/responses.d.ts +360 -0
  88. package/resources/responses.d.ts.map +1 -0
  89. package/resources/responses.js +29 -0
  90. package/resources/responses.js.map +1 -0
  91. package/resources/responses.mjs +25 -0
  92. package/resources/responses.mjs.map +1 -0
  93. package/resources/routes.d.ts +3 -0
  94. package/resources/routes.d.ts.map +1 -1
  95. package/resources/routes.js +3 -0
  96. package/resources/routes.js.map +1 -1
  97. package/resources/routes.mjs +3 -0
  98. package/resources/routes.mjs.map +1 -1
  99. package/resources/safety.d.ts +12 -0
  100. package/resources/safety.d.ts.map +1 -1
  101. package/resources/safety.js +3 -0
  102. package/resources/safety.js.map +1 -1
  103. package/resources/safety.mjs +3 -0
  104. package/resources/safety.mjs.map +1 -1
  105. package/resources/scoring-functions.d.ts +31 -6
  106. package/resources/scoring-functions.d.ts.map +1 -1
  107. package/resources/scoring-functions.js +9 -0
  108. package/resources/scoring-functions.js.map +1 -1
  109. package/resources/scoring-functions.mjs +9 -0
  110. package/resources/scoring-functions.mjs.map +1 -1
  111. package/resources/scoring.d.ts +12 -0
  112. package/resources/scoring.d.ts.map +1 -1
  113. package/resources/scoring.js +3 -0
  114. package/resources/scoring.js.map +1 -1
  115. package/resources/scoring.mjs +3 -0
  116. package/resources/scoring.mjs.map +1 -1
  117. package/resources/shared.d.ts +23 -0
  118. package/resources/shared.d.ts.map +1 -1
  119. package/resources/shields.d.ts +22 -1
  120. package/resources/shields.d.ts.map +1 -1
  121. package/resources/shields.js +9 -0
  122. package/resources/shields.js.map +1 -1
  123. package/resources/shields.mjs +9 -0
  124. package/resources/shields.mjs.map +1 -1
  125. package/resources/telemetry.d.ts +66 -0
  126. package/resources/telemetry.d.ts.map +1 -1
  127. package/resources/telemetry.js +21 -0
  128. package/resources/telemetry.js.map +1 -1
  129. package/resources/telemetry.mjs +21 -0
  130. package/resources/telemetry.mjs.map +1 -1
  131. package/resources/tool-runtime/rag-tool.d.ts +3 -0
  132. package/resources/tool-runtime/rag-tool.d.ts.map +1 -1
  133. package/resources/tool-runtime/tool-runtime.d.ts +19 -1
  134. package/resources/tool-runtime/tool-runtime.d.ts.map +1 -1
  135. package/resources/tool-runtime/tool-runtime.js +1 -1
  136. package/resources/tool-runtime/tool-runtime.js.map +1 -1
  137. package/resources/tool-runtime/tool-runtime.mjs +1 -1
  138. package/resources/tool-runtime/tool-runtime.mjs.map +1 -1
  139. package/resources/toolgroups.d.ts +22 -4
  140. package/resources/toolgroups.d.ts.map +1 -1
  141. package/resources/toolgroups.js +6 -3
  142. package/resources/toolgroups.js.map +1 -1
  143. package/resources/toolgroups.mjs +6 -3
  144. package/resources/toolgroups.mjs.map +1 -1
  145. package/resources/tools.d.ts +8 -2
  146. package/resources/tools.d.ts.map +1 -1
  147. package/resources/tools.js +3 -0
  148. package/resources/tools.js.map +1 -1
  149. package/resources/tools.mjs +3 -0
  150. package/resources/tools.mjs.map +1 -1
  151. package/resources/vector-dbs.d.ts +30 -3
  152. package/resources/vector-dbs.d.ts.map +1 -1
  153. package/resources/vector-dbs.js +12 -0
  154. package/resources/vector-dbs.js.map +1 -1
  155. package/resources/vector-dbs.mjs +12 -0
  156. package/resources/vector-dbs.mjs.map +1 -1
  157. package/resources/vector-io.d.ts +22 -1
  158. package/resources/vector-io.d.ts.map +1 -1
  159. package/resources/vector-io.js +6 -0
  160. package/resources/vector-io.js.map +1 -1
  161. package/resources/vector-io.mjs +6 -0
  162. package/resources/vector-io.mjs.map +1 -1
  163. package/src/index.ts +23 -0
  164. package/src/resources/agents/agents.ts +13 -1
  165. package/src/resources/agents/session.ts +1 -1
  166. package/src/resources/benchmarks.ts +29 -2
  167. package/src/resources/chat/chat.ts +6 -0
  168. package/src/resources/chat/completions.ts +1429 -35
  169. package/src/resources/chat/index.ts +3 -0
  170. package/src/resources/completions.ts +18 -18
  171. package/src/resources/datasets.ts +19 -10
  172. package/src/resources/index.ts +10 -0
  173. package/src/resources/inference.ts +51 -12
  174. package/src/resources/inspect.ts +6 -0
  175. package/src/resources/models.ts +29 -2
  176. package/src/resources/post-training/job.ts +21 -0
  177. package/src/resources/post-training/post-training.ts +54 -0
  178. package/src/resources/providers.ts +6 -0
  179. package/src/resources/responses.ts +624 -0
  180. package/src/resources/routes.ts +3 -0
  181. package/src/resources/safety.ts +12 -0
  182. package/src/resources/scoring-functions.ts +40 -15
  183. package/src/resources/scoring.ts +12 -0
  184. package/src/resources/shared.ts +25 -0
  185. package/src/resources/shields.ts +23 -2
  186. package/src/resources/telemetry.ts +66 -0
  187. package/src/resources/tool-runtime/rag-tool.ts +3 -0
  188. package/src/resources/tool-runtime/tool-runtime.ts +19 -1
  189. package/src/resources/toolgroups.ts +23 -5
  190. package/src/resources/tools.ts +9 -3
  191. package/src/resources/vector-dbs.ts +33 -6
  192. package/src/resources/vector-io.ts +22 -1
  193. package/src/version.ts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.d.ts.map +1 -1
  196. package/version.js +1 -1
  197. package/version.js.map +1 -1
  198. package/version.mjs +1 -1
  199. package/version.mjs.map +1 -1
@@ -4,7 +4,10 @@ export { Chat, type ChatCompletionChunk } from './chat';
4
4
  export {
5
5
  Completions,
6
6
  type CompletionCreateResponse,
7
+ type CompletionRetrieveResponse,
8
+ type CompletionListResponse,
7
9
  type CompletionCreateParams,
8
10
  type CompletionCreateParamsNonStreaming,
9
11
  type CompletionCreateParamsStreaming,
12
+ type CompletionListParams,
10
13
  } from './completions';
@@ -155,86 +155,86 @@ export interface CompletionCreateParamsBase {
155
155
  model: string;
156
156
 
157
157
  /**
158
- * The prompt to generate a completion for
158
+ * The prompt to generate a completion for.
159
159
  */
160
160
  prompt: string | Array<string> | Array<number> | Array<Array<number>>;
161
161
 
162
162
  /**
163
- * (Optional) The number of completions to generate
163
+ * (Optional) The number of completions to generate.
164
164
  */
165
165
  best_of?: number;
166
166
 
167
167
  /**
168
- * (Optional) Whether to echo the prompt
168
+ * (Optional) Whether to echo the prompt.
169
169
  */
170
170
  echo?: boolean;
171
171
 
172
172
  /**
173
- * (Optional) The penalty for repeated tokens
173
+ * (Optional) The penalty for repeated tokens.
174
174
  */
175
175
  frequency_penalty?: number;
176
176
 
177
177
  guided_choice?: Array<string>;
178
178
 
179
179
  /**
180
- * (Optional) The logit bias to use
180
+ * (Optional) The logit bias to use.
181
181
  */
182
182
  logit_bias?: Record<string, number>;
183
183
 
184
184
  /**
185
- * (Optional) The log probabilities to use
185
+ * (Optional) The log probabilities to use.
186
186
  */
187
187
  logprobs?: boolean;
188
188
 
189
189
  /**
190
- * (Optional) The maximum number of tokens to generate
190
+ * (Optional) The maximum number of tokens to generate.
191
191
  */
192
192
  max_tokens?: number;
193
193
 
194
194
  /**
195
- * (Optional) The number of completions to generate
195
+ * (Optional) The number of completions to generate.
196
196
  */
197
197
  n?: number;
198
198
 
199
199
  /**
200
- * (Optional) The penalty for repeated tokens
200
+ * (Optional) The penalty for repeated tokens.
201
201
  */
202
202
  presence_penalty?: number;
203
203
 
204
204
  prompt_logprobs?: number;
205
205
 
206
206
  /**
207
- * (Optional) The seed to use
207
+ * (Optional) The seed to use.
208
208
  */
209
209
  seed?: number;
210
210
 
211
211
  /**
212
- * (Optional) The stop tokens to use
212
+ * (Optional) The stop tokens to use.
213
213
  */
214
214
  stop?: string | Array<string>;
215
215
 
216
216
  /**
217
- * (Optional) Whether to stream the response
217
+ * (Optional) Whether to stream the response.
218
218
  */
219
219
  stream?: boolean;
220
220
 
221
221
  /**
222
- * (Optional) The stream options to use
222
+ * (Optional) The stream options to use.
223
223
  */
224
224
  stream_options?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
225
225
 
226
226
  /**
227
- * (Optional) The temperature to use
227
+ * (Optional) The temperature to use.
228
228
  */
229
229
  temperature?: number;
230
230
 
231
231
  /**
232
- * (Optional) The top p to use
232
+ * (Optional) The top p to use.
233
233
  */
234
234
  top_p?: number;
235
235
 
236
236
  /**
237
- * (Optional) The user to use
237
+ * (Optional) The user to use.
238
238
  */
239
239
  user?: string;
240
240
  }
@@ -246,14 +246,14 @@ export namespace CompletionCreateParams {
246
246
 
247
247
  export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
248
248
  /**
249
- * (Optional) Whether to stream the response
249
+ * (Optional) Whether to stream the response.
250
250
  */
251
251
  stream?: false;
252
252
  }
253
253
 
254
254
  export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
255
255
  /**
256
- * (Optional) Whether to stream the response
256
+ * (Optional) Whether to stream the response.
257
257
  */
258
258
  stream: true;
259
259
  }
@@ -5,10 +5,16 @@ import { isRequestOptions } from '../core';
5
5
  import * as Core from '../core';
6
6
 
7
7
  export class Datasets extends APIResource {
8
+ /**
9
+ * Get a dataset by its ID.
10
+ */
8
11
  retrieve(datasetId: string, options?: Core.RequestOptions): Core.APIPromise<DatasetRetrieveResponse> {
9
12
  return this._client.get(`/v1/datasets/${datasetId}`, options);
10
13
  }
11
14
 
15
+ /**
16
+ * List all datasets.
17
+ */
12
18
  list(options?: Core.RequestOptions): Core.APIPromise<DatasetListResponse> {
13
19
  return (
14
20
  this._client.get('/v1/datasets', options) as Core.APIPromise<{ data: DatasetListResponse }>
@@ -23,8 +29,8 @@ export class Datasets extends APIResource {
23
29
  *
24
30
  * The response includes:
25
31
  *
26
- * - data: List of items for the current page
27
- * - has_more: Whether there are more items available after this set
32
+ * - data: List of items for the current page.
33
+ * - has_more: Whether there are more items available after this set.
28
34
  */
29
35
  iterrows(
30
36
  datasetId: string,
@@ -53,6 +59,9 @@ export class Datasets extends APIResource {
53
59
  return this._client.post('/v1/datasets', { body, ...options });
54
60
  }
55
61
 
62
+ /**
63
+ * Unregister a dataset by its ID.
64
+ */
56
65
  unregister(datasetId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
57
66
  return this._client.delete(`/v1/datasets/${datasetId}`, {
58
67
  ...options,
@@ -72,8 +81,6 @@ export interface DatasetRetrieveResponse {
72
81
 
73
82
  provider_id: string;
74
83
 
75
- provider_resource_id: string;
76
-
77
84
  /**
78
85
  * Purpose of the dataset. Each purpose has a required input data schema.
79
86
  */
@@ -85,6 +92,8 @@ export interface DatasetRetrieveResponse {
85
92
  source: DatasetRetrieveResponse.UriDataSource | DatasetRetrieveResponse.RowsDataSource;
86
93
 
87
94
  type: 'dataset';
95
+
96
+ provider_resource_id?: string;
88
97
  }
89
98
 
90
99
  export namespace DatasetRetrieveResponse {
@@ -127,8 +136,6 @@ export namespace DatasetListResponse {
127
136
 
128
137
  provider_id: string;
129
138
 
130
- provider_resource_id: string;
131
-
132
139
  /**
133
140
  * Purpose of the dataset. Each purpose has a required input data schema.
134
141
  */
@@ -140,6 +147,8 @@ export namespace DatasetListResponse {
140
147
  source: DatasetListResponseItem.UriDataSource | DatasetListResponseItem.RowsDataSource;
141
148
 
142
149
  type: 'dataset';
150
+
151
+ provider_resource_id?: string;
143
152
  }
144
153
 
145
154
  export namespace DatasetListResponseItem {
@@ -195,8 +204,6 @@ export interface DatasetRegisterResponse {
195
204
 
196
205
  provider_id: string;
197
206
 
198
- provider_resource_id: string;
199
-
200
207
  /**
201
208
  * Purpose of the dataset. Each purpose has a required input data schema.
202
209
  */
@@ -208,6 +215,8 @@ export interface DatasetRegisterResponse {
208
215
  source: DatasetRegisterResponse.UriDataSource | DatasetRegisterResponse.RowsDataSource;
209
216
 
210
217
  type: 'dataset';
218
+
219
+ provider_resource_id?: string;
211
220
  }
212
221
 
213
222
  export namespace DatasetRegisterResponse {
@@ -254,7 +263,7 @@ export interface DatasetIterrowsParams {
254
263
 
255
264
  export interface DatasetRegisterParams {
256
265
  /**
257
- * The purpose of the dataset. One of - "post-training/messages": The dataset
266
+ * The purpose of the dataset. One of: - "post-training/messages": The dataset
258
267
  * contains a messages column with list of messages for post-training. {
259
268
  * "messages": [ {"role": "user", "content": "Hello, world!"}, {"role":
260
269
  * "assistant", "content": "Hello, world!"}, ] } - "eval/question-answer": The
@@ -286,7 +295,7 @@ export interface DatasetRegisterParams {
286
295
  dataset_id?: string;
287
296
 
288
297
  /**
289
- * The metadata for the dataset. - E.g. {"description": "My dataset"}
298
+ * The metadata for the dataset. - E.g. {"description": "My dataset"}.
290
299
  */
291
300
  metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
292
301
  }
@@ -81,6 +81,16 @@ export {
81
81
  type PostTrainingSupervisedFineTuneParams,
82
82
  } from './post-training/post-training';
83
83
  export { Providers, type ListProvidersResponse, type ProviderListResponse } from './providers';
84
+ export {
85
+ Responses,
86
+ type ResponseObject,
87
+ type ResponseObjectStream,
88
+ type ResponseListResponse,
89
+ type ResponseCreateParams,
90
+ type ResponseCreateParamsNonStreaming,
91
+ type ResponseCreateParamsStreaming,
92
+ type ResponseListParams,
93
+ } from './responses';
84
94
  export { Routes, type ListRoutesResponse, type RouteListResponse } from './routes';
85
95
  export { Safety, type RunShieldResponse, type SafetyRunShieldParams } from './safety';
86
96
  export {
@@ -8,6 +8,9 @@ import * as Shared from './shared';
8
8
  import { Stream } from '../streaming';
9
9
 
10
10
  export class Inference extends APIResource {
11
+ /**
12
+ * Generate chat completions for a batch of messages using the specified model.
13
+ */
11
14
  batchChatCompletion(
12
15
  body: InferenceBatchChatCompletionParams,
13
16
  options?: Core.RequestOptions,
@@ -15,6 +18,9 @@ export class Inference extends APIResource {
15
18
  return this._client.post('/v1/inference/batch-chat-completion', { body, ...options });
16
19
  }
17
20
 
21
+ /**
22
+ * Generate completions for a batch of content using the specified model.
23
+ */
18
24
  batchCompletion(
19
25
  body: InferenceBatchCompletionParams,
20
26
  options?: Core.RequestOptions,
@@ -192,31 +198,49 @@ export interface InferenceBatchChatCompletionResponse {
192
198
  }
193
199
 
194
200
  export interface InferenceBatchChatCompletionParams {
201
+ /**
202
+ * The messages to generate completions for.
203
+ */
195
204
  messages_batch: Array<Array<Shared.Message>>;
196
205
 
206
+ /**
207
+ * The identifier of the model to use. The model must be registered with Llama
208
+ * Stack and available via the /models endpoint.
209
+ */
197
210
  model_id: string;
198
211
 
212
+ /**
213
+ * (Optional) If specified, log probabilities for each token position will be
214
+ * returned.
215
+ */
199
216
  logprobs?: InferenceBatchChatCompletionParams.Logprobs;
200
217
 
201
218
  /**
202
- * Configuration for JSON schema-guided response generation.
219
+ * (Optional) Grammar specification for guided (structured) decoding.
203
220
  */
204
221
  response_format?: Shared.ResponseFormat;
205
222
 
206
223
  /**
207
- * Sampling parameters.
224
+ * (Optional) Parameters to control the sampling strategy.
208
225
  */
209
226
  sampling_params?: Shared.SamplingParams;
210
227
 
211
228
  /**
212
- * Configuration for tool use.
229
+ * (Optional) Configuration for tool use.
213
230
  */
214
231
  tool_config?: InferenceBatchChatCompletionParams.ToolConfig;
215
232
 
233
+ /**
234
+ * (Optional) List of tool definitions available to the model.
235
+ */
216
236
  tools?: Array<InferenceBatchChatCompletionParams.Tool>;
217
237
  }
218
238
 
219
239
  export namespace InferenceBatchChatCompletionParams {
240
+ /**
241
+ * (Optional) If specified, log probabilities for each token position will be
242
+ * returned.
243
+ */
220
244
  export interface Logprobs {
221
245
  /**
222
246
  * How many tokens (for each position) to return log probabilities for.
@@ -225,7 +249,7 @@ export namespace InferenceBatchChatCompletionParams {
225
249
  }
226
250
 
227
251
  /**
228
- * Configuration for tool use.
252
+ * (Optional) Configuration for tool use.
229
253
  */
230
254
  export interface ToolConfig {
231
255
  /**
@@ -265,24 +289,39 @@ export namespace InferenceBatchChatCompletionParams {
265
289
  }
266
290
 
267
291
  export interface InferenceBatchCompletionParams {
292
+ /**
293
+ * The content to generate completions for.
294
+ */
268
295
  content_batch: Array<Shared.InterleavedContent>;
269
296
 
297
+ /**
298
+ * The identifier of the model to use. The model must be registered with Llama
299
+ * Stack and available via the /models endpoint.
300
+ */
270
301
  model_id: string;
271
302
 
303
+ /**
304
+ * (Optional) If specified, log probabilities for each token position will be
305
+ * returned.
306
+ */
272
307
  logprobs?: InferenceBatchCompletionParams.Logprobs;
273
308
 
274
309
  /**
275
- * Configuration for JSON schema-guided response generation.
310
+ * (Optional) Grammar specification for guided (structured) decoding.
276
311
  */
277
312
  response_format?: Shared.ResponseFormat;
278
313
 
279
314
  /**
280
- * Sampling parameters.
315
+ * (Optional) Parameters to control the sampling strategy.
281
316
  */
282
317
  sampling_params?: Shared.SamplingParams;
283
318
  }
284
319
 
285
320
  export namespace InferenceBatchCompletionParams {
321
+ /**
322
+ * (Optional) If specified, log probabilities for each token position will be
323
+ * returned.
324
+ */
286
325
  export interface Logprobs {
287
326
  /**
288
327
  * How many tokens (for each position) to return log probabilities for.
@@ -297,7 +336,7 @@ export type InferenceChatCompletionParams =
297
336
 
298
337
  export interface InferenceChatCompletionParamsBase {
299
338
  /**
300
- * List of messages in the conversation
339
+ * List of messages in the conversation.
301
340
  */
302
341
  messages: Array<Shared.Message>;
303
342
 
@@ -322,7 +361,7 @@ export interface InferenceChatCompletionParamsBase {
322
361
  response_format?: Shared.ResponseFormat;
323
362
 
324
363
  /**
325
- * Parameters to control the sampling strategy
364
+ * Parameters to control the sampling strategy.
326
365
  */
327
366
  sampling_params?: Shared.SamplingParams;
328
367
 
@@ -355,7 +394,7 @@ export interface InferenceChatCompletionParamsBase {
355
394
  tool_prompt_format?: 'json' | 'function_tag' | 'python_list';
356
395
 
357
396
  /**
358
- * (Optional) List of tool definitions available to the model
397
+ * (Optional) List of tool definitions available to the model.
359
398
  */
360
399
  tools?: Array<InferenceChatCompletionParams.Tool>;
361
400
  }
@@ -438,7 +477,7 @@ export type InferenceCompletionParams =
438
477
 
439
478
  export interface InferenceCompletionParamsBase {
440
479
  /**
441
- * The content to generate a completion for
480
+ * The content to generate a completion for.
442
481
  */
443
482
  content: Shared.InterleavedContent;
444
483
 
@@ -455,12 +494,12 @@ export interface InferenceCompletionParamsBase {
455
494
  logprobs?: InferenceCompletionParams.Logprobs;
456
495
 
457
496
  /**
458
- * (Optional) Grammar specification for guided (structured) decoding
497
+ * (Optional) Grammar specification for guided (structured) decoding.
459
498
  */
460
499
  response_format?: Shared.ResponseFormat;
461
500
 
462
501
  /**
463
- * (Optional) Parameters to control the sampling strategy
502
+ * (Optional) Parameters to control the sampling strategy.
464
503
  */
465
504
  sampling_params?: Shared.SamplingParams;
466
505
 
@@ -4,10 +4,16 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class Inspect extends APIResource {
7
+ /**
8
+ * Get the health of the service.
9
+ */
7
10
  health(options?: Core.RequestOptions): Core.APIPromise<HealthInfo> {
8
11
  return this._client.get('/v1/health', options);
9
12
  }
10
13
 
14
+ /**
15
+ * Get the version of the service.
16
+ */
11
17
  version(options?: Core.RequestOptions): Core.APIPromise<VersionInfo> {
12
18
  return this._client.get('/v1/version', options);
13
19
  }
@@ -4,20 +4,32 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class Models extends APIResource {
7
+ /**
8
+ * Get a model by its identifier.
9
+ */
7
10
  retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<Model> {
8
11
  return this._client.get(`/v1/models/${modelId}`, options);
9
12
  }
10
13
 
14
+ /**
15
+ * List all models.
16
+ */
11
17
  list(options?: Core.RequestOptions): Core.APIPromise<ModelListResponse> {
12
18
  return (
13
19
  this._client.get('/v1/models', options) as Core.APIPromise<{ data: ModelListResponse }>
14
20
  )._thenUnwrap((obj) => obj.data);
15
21
  }
16
22
 
23
+ /**
24
+ * Register a model.
25
+ */
17
26
  register(body: ModelRegisterParams, options?: Core.RequestOptions): Core.APIPromise<Model> {
18
27
  return this._client.post('/v1/models', { body, ...options });
19
28
  }
20
29
 
30
+ /**
31
+ * Unregister a model.
32
+ */
21
33
  unregister(modelId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
22
34
  return this._client.delete(`/v1/models/${modelId}`, {
23
35
  ...options,
@@ -39,22 +51,37 @@ export interface Model {
39
51
 
40
52
  provider_id: string;
41
53
 
42
- provider_resource_id: string;
43
-
44
54
  type: 'model';
55
+
56
+ provider_resource_id?: string;
45
57
  }
46
58
 
47
59
  export type ModelListResponse = Array<Model>;
48
60
 
49
61
  export interface ModelRegisterParams {
62
+ /**
63
+ * The identifier of the model to register.
64
+ */
50
65
  model_id: string;
51
66
 
67
+ /**
68
+ * Any additional metadata for this model.
69
+ */
52
70
  metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
53
71
 
72
+ /**
73
+ * The type of model to register.
74
+ */
54
75
  model_type?: 'llm' | 'embedding';
55
76
 
77
+ /**
78
+ * The identifier of the provider.
79
+ */
56
80
  provider_id?: string;
57
81
 
82
+ /**
83
+ * The identifier of the model in the provider.
84
+ */
58
85
  provider_model_id?: string;
59
86
  }
60
87
 
@@ -6,6 +6,9 @@ import { ListPostTrainingJobsResponse } from './post-training';
6
6
  import * as PostTrainingAPI from './post-training';
7
7
 
8
8
  export class Job extends APIResource {
9
+ /**
10
+ * Get all training jobs.
11
+ */
9
12
  list(
10
13
  options?: Core.RequestOptions,
11
14
  ): Core.APIPromise<Array<PostTrainingAPI.ListPostTrainingJobsResponse.Data>> {
@@ -16,10 +19,16 @@ export class Job extends APIResource {
16
19
  )._thenUnwrap((obj) => obj.data);
17
20
  }
18
21
 
22
+ /**
23
+ * Get the artifacts of a training job.
24
+ */
19
25
  artifacts(query: JobArtifactsParams, options?: Core.RequestOptions): Core.APIPromise<JobArtifactsResponse> {
20
26
  return this._client.get('/v1/post-training/job/artifacts', { query, ...options });
21
27
  }
22
28
 
29
+ /**
30
+ * Cancel a training job.
31
+ */
23
32
  cancel(body: JobCancelParams, options?: Core.RequestOptions): Core.APIPromise<void> {
24
33
  return this._client.post('/v1/post-training/job/cancel', {
25
34
  body,
@@ -28,6 +37,9 @@ export class Job extends APIResource {
28
37
  });
29
38
  }
30
39
 
40
+ /**
41
+ * Get the status of a training job.
42
+ */
31
43
  status(query: JobStatusParams, options?: Core.RequestOptions): Core.APIPromise<JobStatusResponse> {
32
44
  return this._client.get('/v1/post-training/job/status', { query, ...options });
33
45
  }
@@ -70,14 +82,23 @@ export interface JobStatusResponse {
70
82
  }
71
83
 
72
84
  export interface JobArtifactsParams {
85
+ /**
86
+ * The UUID of the job to get the artifacts of.
87
+ */
73
88
  job_uuid: string;
74
89
  }
75
90
 
76
91
  export interface JobCancelParams {
92
+ /**
93
+ * The UUID of the job to cancel.
94
+ */
77
95
  job_uuid: string;
78
96
  }
79
97
 
80
98
  export interface JobStatusParams {
99
+ /**
100
+ * The UUID of the job to get the status of.
101
+ */
81
102
  job_uuid: string;
82
103
  }
83
104
 
@@ -16,6 +16,9 @@ import {
16
16
  export class PostTraining extends APIResource {
17
17
  job: JobAPI.Job = new JobAPI.Job(this._client);
18
18
 
19
+ /**
20
+ * Run preference optimization of a model.
21
+ */
19
22
  preferenceOptimize(
20
23
  body: PostTrainingPreferenceOptimizeParams,
21
24
  options?: Core.RequestOptions,
@@ -23,6 +26,9 @@ export class PostTraining extends APIResource {
23
26
  return this._client.post('/v1/post-training/preference-optimize', { body, ...options });
24
27
  }
25
28
 
29
+ /**
30
+ * Run supervised fine-tuning of a model.
31
+ */
26
32
  supervisedFineTune(
27
33
  body: PostTrainingSupervisedFineTuneParams,
28
34
  options?: Core.RequestOptions,
@@ -76,20 +82,41 @@ export interface PostTrainingJob {
76
82
  }
77
83
 
78
84
  export interface PostTrainingPreferenceOptimizeParams {
85
+ /**
86
+ * The algorithm configuration.
87
+ */
79
88
  algorithm_config: PostTrainingPreferenceOptimizeParams.AlgorithmConfig;
80
89
 
90
+ /**
91
+ * The model to fine-tune.
92
+ */
81
93
  finetuned_model: string;
82
94
 
95
+ /**
96
+ * The hyperparam search configuration.
97
+ */
83
98
  hyperparam_search_config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
84
99
 
100
+ /**
101
+ * The UUID of the job to create.
102
+ */
85
103
  job_uuid: string;
86
104
 
105
+ /**
106
+ * The logger configuration.
107
+ */
87
108
  logger_config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
88
109
 
110
+ /**
111
+ * The training configuration.
112
+ */
89
113
  training_config: PostTrainingPreferenceOptimizeParams.TrainingConfig;
90
114
  }
91
115
 
92
116
  export namespace PostTrainingPreferenceOptimizeParams {
117
+ /**
118
+ * The algorithm configuration.
119
+ */
93
120
  export interface AlgorithmConfig {
94
121
  epsilon: number;
95
122
 
@@ -100,6 +127,9 @@ export namespace PostTrainingPreferenceOptimizeParams {
100
127
  reward_scale: number;
101
128
  }
102
129
 
130
+ /**
131
+ * The training configuration.
132
+ */
103
133
  export interface TrainingConfig {
104
134
  gradient_accumulation_steps: number;
105
135
 
@@ -158,22 +188,46 @@ export namespace PostTrainingPreferenceOptimizeParams {
158
188
  }
159
189
 
160
190
  export interface PostTrainingSupervisedFineTuneParams {
191
+ /**
192
+ * The hyperparam search configuration.
193
+ */
161
194
  hyperparam_search_config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
162
195
 
196
+ /**
197
+ * The UUID of the job to create.
198
+ */
163
199
  job_uuid: string;
164
200
 
201
+ /**
202
+ * The logger configuration.
203
+ */
165
204
  logger_config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
166
205
 
206
+ /**
207
+ * The training configuration.
208
+ */
167
209
  training_config: PostTrainingSupervisedFineTuneParams.TrainingConfig;
168
210
 
211
+ /**
212
+ * The algorithm configuration.
213
+ */
169
214
  algorithm_config?: AlgorithmConfig;
170
215
 
216
+ /**
217
+ * The directory to save checkpoint(s) to.
218
+ */
171
219
  checkpoint_dir?: string;
172
220
 
221
+ /**
222
+ * The model to fine-tune.
223
+ */
173
224
  model?: string;
174
225
  }
175
226
 
176
227
  export namespace PostTrainingSupervisedFineTuneParams {
228
+ /**
229
+ * The training configuration.
230
+ */
177
231
  export interface TrainingConfig {
178
232
  gradient_accumulation_steps: number;
179
233