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
@@ -13,7 +13,7 @@ import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination'
13
13
 
14
14
  export class Files extends APIResource {
15
15
  /**
16
- * Attach a file to a vector store.
16
+ * Attach a file to a vector store (OpenAI-compatible).
17
17
  */
18
18
  create(
19
19
  vectorStoreId: string,
@@ -24,7 +24,7 @@ export class Files extends APIResource {
24
24
  }
25
25
 
26
26
  /**
27
- * Retrieves a vector store file.
27
+ * Retrieve a vector store file (OpenAI-compatible).
28
28
  */
29
29
  retrieve(
30
30
  vectorStoreId: string,
@@ -35,7 +35,7 @@ export class Files extends APIResource {
35
35
  }
36
36
 
37
37
  /**
38
- * Updates a vector store file.
38
+ * Update a vector store file (OpenAI-compatible).
39
39
  */
40
40
  update(
41
41
  vectorStoreId: string,
@@ -47,7 +47,7 @@ export class Files extends APIResource {
47
47
  }
48
48
 
49
49
  /**
50
- * List files in a vector store.
50
+ * List files in a vector store (OpenAI-compatible).
51
51
  */
52
52
  list(
53
53
  vectorStoreId: string,
@@ -74,7 +74,7 @@ export class Files extends APIResource {
74
74
  }
75
75
 
76
76
  /**
77
- * Delete a vector store file.
77
+ * Delete a vector store file (OpenAI-compatible).
78
78
  */
79
79
  delete(
80
80
  vectorStoreId: string,
@@ -85,7 +85,7 @@ export class Files extends APIResource {
85
85
  }
86
86
 
87
87
  /**
88
- * Retrieves the contents of a vector store file.
88
+ * Retrieve vector store file contents (OpenAI-compatible).
89
89
  */
90
90
  content(
91
91
  vectorStoreId: string,
@@ -253,10 +253,6 @@ export namespace FileContentResponse {
253
253
  * the context during inference.
254
254
  */
255
255
  export interface ChunkMetadata {
256
- chunk_embedding_dimension?: number | null;
257
-
258
- chunk_embedding_model?: string | null;
259
-
260
256
  chunk_id?: string | null;
261
257
 
262
258
  chunk_tokenizer?: string | null;
@@ -279,12 +275,18 @@ export namespace FileContentResponse {
279
275
  }
280
276
 
281
277
  export interface FileCreateParams {
278
+ /**
279
+ * The ID of the file to attach.
280
+ */
282
281
  file_id: string;
283
282
 
283
+ /**
284
+ * Attributes to associate with the file.
285
+ */
284
286
  attributes?: { [key: string]: unknown } | null;
285
287
 
286
288
  /**
287
- * Automatic chunking strategy for vector store files.
289
+ * Strategy for chunking the file content.
288
290
  */
289
291
  chunking_strategy?:
290
292
  | FileCreateParams.VectorStoreChunkingStrategyAuto
@@ -325,20 +327,38 @@ export namespace FileCreateParams {
325
327
  }
326
328
 
327
329
  export interface FileUpdateParams {
330
+ /**
331
+ * The new attributes for the file.
332
+ */
328
333
  attributes: { [key: string]: unknown };
329
334
  }
330
335
 
331
336
  export interface FileListParams extends OpenAICursorPageParams {
337
+ /**
338
+ * Pagination cursor (before).
339
+ */
332
340
  before?: string | null;
333
341
 
342
+ /**
343
+ * Filter by file status.
344
+ */
334
345
  filter?: 'completed' | 'in_progress' | 'cancelled' | 'failed' | null;
335
346
 
347
+ /**
348
+ * Sort order by created_at: asc or desc.
349
+ */
336
350
  order?: string | null;
337
351
  }
338
352
 
339
353
  export interface FileContentParams {
354
+ /**
355
+ * Include embedding vectors.
356
+ */
340
357
  include_embeddings?: boolean | null;
341
358
 
359
+ /**
360
+ * Include chunk metadata.
361
+ */
342
362
  include_metadata?: boolean | null;
343
363
  }
344
364
 
@@ -36,23 +36,21 @@ export class VectorStores extends APIResource {
36
36
  fileBatches: FileBatchesAPI.FileBatches = new FileBatchesAPI.FileBatches(this._client);
37
37
 
38
38
  /**
39
- * Creates a vector store.
40
- *
41
- * Generate an OpenAI-compatible vector store with the given parameters.
39
+ * Create a vector store (OpenAI-compatible).
42
40
  */
43
41
  create(body: VectorStoreCreateParams, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
44
42
  return this._client.post('/v1/vector_stores', { body, ...options });
45
43
  }
46
44
 
47
45
  /**
48
- * Retrieves a vector store.
46
+ * Retrieve a vector store (OpenAI-compatible).
49
47
  */
50
48
  retrieve(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
51
49
  return this._client.get(`/v1/vector_stores/${vectorStoreId}`, options);
52
50
  }
53
51
 
54
52
  /**
55
- * Updates a vector store.
53
+ * Update a vector store (OpenAI-compatible).
56
54
  */
57
55
  update(
58
56
  vectorStoreId: string,
@@ -63,7 +61,7 @@ export class VectorStores extends APIResource {
63
61
  }
64
62
 
65
63
  /**
66
- * Returns a list of vector stores.
64
+ * List vector stores (OpenAI-compatible).
67
65
  */
68
66
  list(
69
67
  query?: VectorStoreListParams,
@@ -81,17 +79,14 @@ export class VectorStores extends APIResource {
81
79
  }
82
80
 
83
81
  /**
84
- * Delete a vector store.
82
+ * Delete a vector store (OpenAI-compatible).
85
83
  */
86
84
  delete(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStoreDeleteResponse> {
87
85
  return this._client.delete(`/v1/vector_stores/${vectorStoreId}`, options);
88
86
  }
89
87
 
90
88
  /**
91
- * Search for chunks in a vector store.
92
- *
93
- * Searches a vector store for relevant chunks based on a query and optional file
94
- * attribute filters.
89
+ * Search a vector store (OpenAI-compatible).
95
90
  */
96
91
  search(
97
92
  vectorStoreId: string,
@@ -242,10 +237,6 @@ export namespace VectorStoreSearchResponse {
242
237
  * the context during inference.
243
238
  */
244
239
  export interface ChunkMetadata {
245
- chunk_embedding_dimension?: number | null;
246
-
247
- chunk_embedding_model?: string | null;
248
-
249
240
  chunk_id?: string | null;
250
241
 
251
242
  chunk_tokenizer?: string | null;
@@ -321,44 +312,127 @@ export namespace VectorStoreCreateParams {
321
312
  }
322
313
 
323
314
  export interface VectorStoreUpdateParams {
315
+ /**
316
+ * Expiration policy for the vector store.
317
+ */
324
318
  expires_after?: { [key: string]: unknown } | null;
325
319
 
320
+ /**
321
+ * Metadata to associate with the vector store.
322
+ */
326
323
  metadata?: { [key: string]: unknown } | null;
327
324
 
325
+ /**
326
+ * The new name for the vector store.
327
+ */
328
328
  name?: string | null;
329
329
  }
330
330
 
331
331
  export interface VectorStoreListParams extends OpenAICursorPageParams {
332
+ /**
333
+ * Pagination cursor (before).
334
+ */
332
335
  before?: string | null;
333
336
 
337
+ /**
338
+ * Sort order by created_at: asc or desc.
339
+ */
334
340
  order?: string | null;
335
341
  }
336
342
 
337
343
  export interface VectorStoreSearchParams {
344
+ /**
345
+ * The search query string or list of query strings.
346
+ */
338
347
  query: string | Array<string>;
339
348
 
349
+ /**
350
+ * Filters to apply to the search.
351
+ */
340
352
  filters?: { [key: string]: unknown } | null;
341
353
 
354
+ /**
355
+ * Maximum number of results to return.
356
+ */
342
357
  max_num_results?: number | null;
343
358
 
344
359
  /**
345
360
  * Options for ranking and filtering search results.
361
+ *
362
+ * This class configures how search results are ranked and filtered. You can use
363
+ * algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
364
+ * VectorStoresConfig are used when parameters are not provided.
365
+ *
366
+ * Examples: # Weighted ranker with custom alpha
367
+ * SearchRankingOptions(ranker="weighted", alpha=0.7)
368
+ *
369
+ * # RRF ranker with custom impact factor
370
+ * SearchRankingOptions(ranker="rrf", impact_factor=50.0)
371
+ *
372
+ * # Use config defaults (just specify ranker type)
373
+ * SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
374
+ *
375
+ * # Score threshold filtering
376
+ * SearchRankingOptions(ranker="weighted", score_threshold=0.5)
346
377
  */
347
378
  ranking_options?: VectorStoreSearchParams.RankingOptions | null;
348
379
 
380
+ /**
381
+ * Whether to rewrite the query for better results.
382
+ */
349
383
  rewrite_query?: boolean | null;
350
384
 
385
+ /**
386
+ * The search mode to use (e.g., 'vector', 'keyword').
387
+ */
351
388
  search_mode?: string | null;
352
389
  }
353
390
 
354
391
  export namespace VectorStoreSearchParams {
355
392
  /**
356
393
  * Options for ranking and filtering search results.
394
+ *
395
+ * This class configures how search results are ranked and filtered. You can use
396
+ * algorithm-based rerankers (weighted, RRF) or neural rerankers. Defaults from
397
+ * VectorStoresConfig are used when parameters are not provided.
398
+ *
399
+ * Examples: # Weighted ranker with custom alpha
400
+ * SearchRankingOptions(ranker="weighted", alpha=0.7)
401
+ *
402
+ * # RRF ranker with custom impact factor
403
+ * SearchRankingOptions(ranker="rrf", impact_factor=50.0)
404
+ *
405
+ * # Use config defaults (just specify ranker type)
406
+ * SearchRankingOptions(ranker="weighted") # Uses alpha from VectorStoresConfig
407
+ *
408
+ * # Score threshold filtering
409
+ * SearchRankingOptions(ranker="weighted", score_threshold=0.5)
357
410
  */
358
411
  export interface RankingOptions {
412
+ /**
413
+ * Weight factor for weighted ranker
414
+ */
415
+ alpha?: number | null;
416
+
417
+ /**
418
+ * Impact factor for RRF algorithm
419
+ */
420
+ impact_factor?: number | null;
421
+
422
+ /**
423
+ * Model identifier for neural reranker
424
+ */
425
+ model?: string | null;
426
+
359
427
  ranker?: string | null;
360
428
 
361
429
  score_threshold?: number | null;
430
+
431
+ /**
432
+ * Weights for combining vector, keyword, and neural scores. Keys: 'vector',
433
+ * 'keyword', 'neural'
434
+ */
435
+ weights?: { [key: string]: number } | null;
362
436
  }
363
437
  }
364
438
 
package/src/version.ts CHANGED
@@ -4,4 +4,4 @@
4
4
  // This source code is licensed under the terms described in the LICENSE file in
5
5
  // the root directory of this source tree.
6
6
 
7
- export const VERSION = '0.4.4'; // x-release-please-version
7
+ export const VERSION = '0.4.5'; // x-release-please-version
@@ -0,0 +1,111 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ //
7
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
+
9
+ import LlamaStackClient from 'llama-stack-client';
10
+ import { Response } from 'node-fetch';
11
+
12
+ const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' });
13
+
14
+ describe('resource admin', () => {
15
+ test('health', async () => {
16
+ const responsePromise = client.alpha.admin.health();
17
+ const rawResponse = await responsePromise.asResponse();
18
+ expect(rawResponse).toBeInstanceOf(Response);
19
+ const response = await responsePromise;
20
+ expect(response).not.toBeInstanceOf(Response);
21
+ const dataAndResponse = await responsePromise.withResponse();
22
+ expect(dataAndResponse.data).toBe(response);
23
+ expect(dataAndResponse.response).toBe(rawResponse);
24
+ });
25
+
26
+ test('health: request options instead of params are passed correctly', async () => {
27
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
28
+ await expect(client.alpha.admin.health({ path: '/_stainless_unknown_path' })).rejects.toThrow(
29
+ LlamaStackClient.NotFoundError,
30
+ );
31
+ });
32
+
33
+ test('inspectProvider', async () => {
34
+ const responsePromise = client.alpha.admin.inspectProvider('provider_id');
35
+ const rawResponse = await responsePromise.asResponse();
36
+ expect(rawResponse).toBeInstanceOf(Response);
37
+ const response = await responsePromise;
38
+ expect(response).not.toBeInstanceOf(Response);
39
+ const dataAndResponse = await responsePromise.withResponse();
40
+ expect(dataAndResponse.data).toBe(response);
41
+ expect(dataAndResponse.response).toBe(rawResponse);
42
+ });
43
+
44
+ test('inspectProvider: request options instead of params are passed correctly', async () => {
45
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
46
+ await expect(
47
+ client.alpha.admin.inspectProvider('provider_id', { path: '/_stainless_unknown_path' }),
48
+ ).rejects.toThrow(LlamaStackClient.NotFoundError);
49
+ });
50
+
51
+ test('listProviders', async () => {
52
+ const responsePromise = client.alpha.admin.listProviders();
53
+ const rawResponse = await responsePromise.asResponse();
54
+ expect(rawResponse).toBeInstanceOf(Response);
55
+ const response = await responsePromise;
56
+ expect(response).not.toBeInstanceOf(Response);
57
+ const dataAndResponse = await responsePromise.withResponse();
58
+ expect(dataAndResponse.data).toBe(response);
59
+ expect(dataAndResponse.response).toBe(rawResponse);
60
+ });
61
+
62
+ test('listProviders: request options instead of params are passed correctly', async () => {
63
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
64
+ await expect(client.alpha.admin.listProviders({ path: '/_stainless_unknown_path' })).rejects.toThrow(
65
+ LlamaStackClient.NotFoundError,
66
+ );
67
+ });
68
+
69
+ test('listRoutes', async () => {
70
+ const responsePromise = client.alpha.admin.listRoutes();
71
+ const rawResponse = await responsePromise.asResponse();
72
+ expect(rawResponse).toBeInstanceOf(Response);
73
+ const response = await responsePromise;
74
+ expect(response).not.toBeInstanceOf(Response);
75
+ const dataAndResponse = await responsePromise.withResponse();
76
+ expect(dataAndResponse.data).toBe(response);
77
+ expect(dataAndResponse.response).toBe(rawResponse);
78
+ });
79
+
80
+ test('listRoutes: request options instead of params are passed correctly', async () => {
81
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
82
+ await expect(client.alpha.admin.listRoutes({ path: '/_stainless_unknown_path' })).rejects.toThrow(
83
+ LlamaStackClient.NotFoundError,
84
+ );
85
+ });
86
+
87
+ test('listRoutes: request options and params are passed correctly', async () => {
88
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
89
+ await expect(
90
+ client.alpha.admin.listRoutes({ api_filter: 'v1' }, { path: '/_stainless_unknown_path' }),
91
+ ).rejects.toThrow(LlamaStackClient.NotFoundError);
92
+ });
93
+
94
+ test('version', async () => {
95
+ const responsePromise = client.alpha.admin.version();
96
+ const rawResponse = await responsePromise.asResponse();
97
+ expect(rawResponse).toBeInstanceOf(Response);
98
+ const response = await responsePromise;
99
+ expect(response).not.toBeInstanceOf(Response);
100
+ const dataAndResponse = await responsePromise.withResponse();
101
+ expect(dataAndResponse.data).toBe(response);
102
+ expect(dataAndResponse.response).toBe(rawResponse);
103
+ });
104
+
105
+ test('version: request options instead of params are passed correctly', async () => {
106
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
107
+ await expect(client.alpha.admin.version({ path: '/_stainless_unknown_path' })).rejects.toThrow(
108
+ LlamaStackClient.NotFoundError,
109
+ );
110
+ });
111
+ });
@@ -14,7 +14,12 @@ const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL']
14
14
  describe('resource eval', () => {
15
15
  test('evaluateRows: only required params', async () => {
16
16
  const responsePromise = client.alpha.eval.evaluateRows('benchmark_id', {
17
- benchmark_config: { eval_candidate: { model: 'model', sampling_params: {} } },
17
+ benchmark_config: {
18
+ eval_candidate: {
19
+ model: 'x',
20
+ sampling_params: {},
21
+ },
22
+ },
18
23
  input_rows: [{ foo: 'bar' }],
19
24
  scoring_functions: ['string'],
20
25
  });
@@ -31,17 +36,17 @@ describe('resource eval', () => {
31
36
  const response = await client.alpha.eval.evaluateRows('benchmark_id', {
32
37
  benchmark_config: {
33
38
  eval_candidate: {
34
- model: 'model',
39
+ model: 'x',
35
40
  sampling_params: {
36
- max_tokens: 0,
37
- repetition_penalty: 0,
41
+ max_tokens: 1,
42
+ repetition_penalty: -2,
38
43
  stop: ['string'],
39
44
  strategy: { type: 'greedy' },
40
45
  },
41
46
  system_message: { content: 'string', role: 'system' },
42
47
  type: 'model',
43
48
  },
44
- num_examples: 0,
49
+ num_examples: 1,
45
50
  scoring_params: {
46
51
  foo: {
47
52
  judge_model: 'judge_model',
@@ -59,7 +64,12 @@ describe('resource eval', () => {
59
64
 
60
65
  test('evaluateRowsAlpha: only required params', async () => {
61
66
  const responsePromise = client.alpha.eval.evaluateRowsAlpha('benchmark_id', {
62
- benchmark_config: { eval_candidate: { model: 'model', sampling_params: {} } },
67
+ benchmark_config: {
68
+ eval_candidate: {
69
+ model: 'x',
70
+ sampling_params: {},
71
+ },
72
+ },
63
73
  input_rows: [{ foo: 'bar' }],
64
74
  scoring_functions: ['string'],
65
75
  });
@@ -76,17 +86,17 @@ describe('resource eval', () => {
76
86
  const response = await client.alpha.eval.evaluateRowsAlpha('benchmark_id', {
77
87
  benchmark_config: {
78
88
  eval_candidate: {
79
- model: 'model',
89
+ model: 'x',
80
90
  sampling_params: {
81
- max_tokens: 0,
82
- repetition_penalty: 0,
91
+ max_tokens: 1,
92
+ repetition_penalty: -2,
83
93
  stop: ['string'],
84
94
  strategy: { type: 'greedy' },
85
95
  },
86
96
  system_message: { content: 'string', role: 'system' },
87
97
  type: 'model',
88
98
  },
89
- num_examples: 0,
99
+ num_examples: 1,
90
100
  scoring_params: {
91
101
  foo: {
92
102
  judge_model: 'judge_model',
@@ -104,7 +114,12 @@ describe('resource eval', () => {
104
114
 
105
115
  test('runEval: only required params', async () => {
106
116
  const responsePromise = client.alpha.eval.runEval('benchmark_id', {
107
- benchmark_config: { eval_candidate: { model: 'model', sampling_params: {} } },
117
+ benchmark_config: {
118
+ eval_candidate: {
119
+ model: 'x',
120
+ sampling_params: {},
121
+ },
122
+ },
108
123
  });
109
124
  const rawResponse = await responsePromise.asResponse();
110
125
  expect(rawResponse).toBeInstanceOf(Response);
@@ -119,17 +134,17 @@ describe('resource eval', () => {
119
134
  const response = await client.alpha.eval.runEval('benchmark_id', {
120
135
  benchmark_config: {
121
136
  eval_candidate: {
122
- model: 'model',
137
+ model: 'x',
123
138
  sampling_params: {
124
- max_tokens: 0,
125
- repetition_penalty: 0,
139
+ max_tokens: 1,
140
+ repetition_penalty: -2,
126
141
  stop: ['string'],
127
142
  strategy: { type: 'greedy' },
128
143
  },
129
144
  system_message: { content: 'string', role: 'system' },
130
145
  type: 'model',
131
146
  },
132
- num_examples: 0,
147
+ num_examples: 1,
133
148
  scoring_params: {
134
149
  foo: {
135
150
  judge_model: 'judge_model',
@@ -145,7 +160,12 @@ describe('resource eval', () => {
145
160
 
146
161
  test('runEvalAlpha: only required params', async () => {
147
162
  const responsePromise = client.alpha.eval.runEvalAlpha('benchmark_id', {
148
- benchmark_config: { eval_candidate: { model: 'model', sampling_params: {} } },
163
+ benchmark_config: {
164
+ eval_candidate: {
165
+ model: 'x',
166
+ sampling_params: {},
167
+ },
168
+ },
149
169
  });
150
170
  const rawResponse = await responsePromise.asResponse();
151
171
  expect(rawResponse).toBeInstanceOf(Response);
@@ -160,17 +180,17 @@ describe('resource eval', () => {
160
180
  const response = await client.alpha.eval.runEvalAlpha('benchmark_id', {
161
181
  benchmark_config: {
162
182
  eval_candidate: {
163
- model: 'model',
183
+ model: 'x',
164
184
  sampling_params: {
165
- max_tokens: 0,
166
- repetition_penalty: 0,
185
+ max_tokens: 1,
186
+ repetition_penalty: -2,
167
187
  stop: ['string'],
168
188
  strategy: { type: 'greedy' },
169
189
  },
170
190
  system_message: { content: 'string', role: 'system' },
171
191
  type: 'model',
172
192
  },
173
- num_examples: 0,
193
+ num_examples: 1,
174
194
  scoring_params: {
175
195
  foo: {
176
196
  judge_model: 'judge_model',
@@ -32,7 +32,7 @@ describe('resource inference', () => {
32
32
  items: ['string'],
33
33
  model: 'model',
34
34
  query: 'string',
35
- max_num_results: 0,
35
+ max_num_results: 1,
36
36
  });
37
37
  });
38
38
  });
@@ -30,8 +30,8 @@ describe('resource job', () => {
30
30
  );
31
31
  });
32
32
 
33
- test('artifacts: only required params', async () => {
34
- const responsePromise = client.alpha.postTraining.job.artifacts({ job_uuid: 'job_uuid' });
33
+ test('artifacts', async () => {
34
+ const responsePromise = client.alpha.postTraining.job.artifacts();
35
35
  const rawResponse = await responsePromise.asResponse();
36
36
  expect(rawResponse).toBeInstanceOf(Response);
37
37
  const response = await responsePromise;
@@ -41,12 +41,15 @@ describe('resource job', () => {
41
41
  expect(dataAndResponse.response).toBe(rawResponse);
42
42
  });
43
43
 
44
- test('artifacts: required and optional params', async () => {
45
- const response = await client.alpha.postTraining.job.artifacts({ job_uuid: 'job_uuid' });
44
+ test('artifacts: request options instead of params are passed correctly', async () => {
45
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
46
+ await expect(
47
+ client.alpha.postTraining.job.artifacts({ path: '/_stainless_unknown_path' }),
48
+ ).rejects.toThrow(LlamaStackClient.NotFoundError);
46
49
  });
47
50
 
48
- test('cancel: only required params', async () => {
49
- const responsePromise = client.alpha.postTraining.job.cancel({ job_uuid: 'job_uuid' });
51
+ test('cancel', async () => {
52
+ const responsePromise = client.alpha.postTraining.job.cancel();
50
53
  const rawResponse = await responsePromise.asResponse();
51
54
  expect(rawResponse).toBeInstanceOf(Response);
52
55
  const response = await responsePromise;
@@ -56,12 +59,15 @@ describe('resource job', () => {
56
59
  expect(dataAndResponse.response).toBe(rawResponse);
57
60
  });
58
61
 
59
- test('cancel: required and optional params', async () => {
60
- const response = await client.alpha.postTraining.job.cancel({ job_uuid: 'job_uuid' });
62
+ test('cancel: request options instead of params are passed correctly', async () => {
63
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
64
+ await expect(client.alpha.postTraining.job.cancel({ path: '/_stainless_unknown_path' })).rejects.toThrow(
65
+ LlamaStackClient.NotFoundError,
66
+ );
61
67
  });
62
68
 
63
- test('status: only required params', async () => {
64
- const responsePromise = client.alpha.postTraining.job.status({ job_uuid: 'job_uuid' });
69
+ test('status', async () => {
70
+ const responsePromise = client.alpha.postTraining.job.status();
65
71
  const rawResponse = await responsePromise.asResponse();
66
72
  expect(rawResponse).toBeInstanceOf(Response);
67
73
  const response = await responsePromise;
@@ -71,7 +77,10 @@ describe('resource job', () => {
71
77
  expect(dataAndResponse.response).toBe(rawResponse);
72
78
  });
73
79
 
74
- test('status: required and optional params', async () => {
75
- const response = await client.alpha.postTraining.job.status({ job_uuid: 'job_uuid' });
80
+ test('status: request options instead of params are passed correctly', async () => {
81
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
82
+ await expect(client.alpha.postTraining.job.status({ path: '/_stainless_unknown_path' })).rejects.toThrow(
83
+ LlamaStackClient.NotFoundError,
84
+ );
76
85
  });
77
86
  });
@@ -58,7 +58,12 @@ describe('resource postTraining', () => {
58
58
  gradient_accumulation_steps: 0,
59
59
  max_steps_per_epoch: 0,
60
60
  max_validation_steps: 0,
61
- optimizer_config: { lr: 0, num_warmup_steps: 0, optimizer_type: 'adam', weight_decay: 0 },
61
+ optimizer_config: {
62
+ lr: 0,
63
+ num_warmup_steps: 0,
64
+ optimizer_type: 'adam',
65
+ weight_decay: 0,
66
+ },
62
67
  },
63
68
  });
64
69
  });
@@ -105,7 +110,12 @@ describe('resource postTraining', () => {
105
110
  gradient_accumulation_steps: 0,
106
111
  max_steps_per_epoch: 0,
107
112
  max_validation_steps: 0,
108
- optimizer_config: { lr: 0, num_warmup_steps: 0, optimizer_type: 'adam', weight_decay: 0 },
113
+ optimizer_config: {
114
+ lr: 0,
115
+ num_warmup_steps: 0,
116
+ optimizer_type: 'adam',
117
+ weight_decay: 0,
118
+ },
109
119
  },
110
120
  algorithm_config: {
111
121
  alpha: 0,