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
 
@@ -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
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.4";
1
+ export declare const VERSION = "0.4.5";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -6,5 +6,5 @@
6
6
  // the root directory of this source tree.
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.VERSION = void 0;
9
- exports.VERSION = '0.4.4'; // x-release-please-version
9
+ exports.VERSION = '0.4.5'; // x-release-please-version
10
10
  //# sourceMappingURL=version.js.map
package/dist/version.mjs CHANGED
@@ -3,5 +3,5 @@
3
3
  //
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
- export const VERSION = '0.4.4'; // x-release-please-version
6
+ export const VERSION = '0.4.5'; // x-release-please-version
7
7
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llama-stack-client",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "The official TypeScript library for the Llama Stack Client API",
5
5
  "author": "Llama Stack Client <llamastack@meta.com>",
6
6
  "types": "dist/index.d.ts",
package/src/core.ts CHANGED
@@ -90,6 +90,12 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
90
90
  const mediaType = contentType?.split(';')[0]?.trim();
91
91
  const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
92
92
  if (isJSON) {
93
+ const contentLength = response.headers.get('content-length');
94
+ if (contentLength === '0') {
95
+ // if there is no content we can't do anything
96
+ return undefined as T;
97
+ }
98
+
93
99
  const json = await response.json();
94
100
 
95
101
  debug('response', response.status, response.url, response.headers, json);
package/src/index.ts CHANGED
@@ -48,10 +48,10 @@ import {
48
48
  FilesOpenAICursorPage,
49
49
  ListFilesResponse,
50
50
  } from './resources/files';
51
- import { HealthInfo, Inspect, ProviderInfo, RouteInfo, VersionInfo } from './resources/inspect';
51
+ import { Inspect } from './resources/inspect';
52
52
  import { CreateResponse, ModerationCreateParams, Moderations } from './resources/moderations';
53
- import { ListProvidersResponse, ProviderListResponse, Providers } from './resources/providers';
54
- import { ListRoutesResponse, RouteListParams, RouteListResponse, Routes } from './resources/routes';
53
+ import { ProviderListResponse, Providers } from './resources/providers';
54
+ import { RouteListParams, RouteListResponse, Routes } from './resources/routes';
55
55
  import { RunShieldResponse, Safety, SafetyRunShieldParams } from './resources/safety';
56
56
  import {
57
57
  Scoring,
@@ -431,13 +431,7 @@ export declare namespace LlamaStackClient {
431
431
  type ConversationUpdateParams as ConversationUpdateParams,
432
432
  };
433
433
 
434
- export {
435
- Inspect as Inspect,
436
- type HealthInfo as HealthInfo,
437
- type ProviderInfo as ProviderInfo,
438
- type RouteInfo as RouteInfo,
439
- type VersionInfo as VersionInfo,
440
- };
434
+ export { Inspect as Inspect };
441
435
 
442
436
  export {
443
437
  Embeddings as Embeddings,
@@ -485,15 +479,10 @@ export declare namespace LlamaStackClient {
485
479
  type ModelRegisterParams as ModelRegisterParams,
486
480
  };
487
481
 
488
- export {
489
- Providers as Providers,
490
- type ListProvidersResponse as ListProvidersResponse,
491
- type ProviderListResponse as ProviderListResponse,
492
- };
482
+ export { Providers as Providers, type ProviderListResponse as ProviderListResponse };
493
483
 
494
484
  export {
495
485
  Routes as Routes,
496
- type ListRoutesResponse as ListRoutesResponse,
497
486
  type RouteListResponse as RouteListResponse,
498
487
  type RouteListParams as RouteListParams,
499
488
  };
@@ -561,13 +550,19 @@ export declare namespace LlamaStackClient {
561
550
 
562
551
  export { Beta as Beta };
563
552
 
553
+ export type HealthInfo = API.HealthInfo;
564
554
  export type InterleavedContent = API.InterleavedContent;
565
555
  export type InterleavedContentItem = API.InterleavedContentItem;
556
+ export type ListProvidersResponse = API.ListProvidersResponse;
557
+ export type ListRoutesResponse = API.ListRoutesResponse;
566
558
  export type ParamType = API.ParamType;
559
+ export type ProviderInfo = API.ProviderInfo;
560
+ export type RouteInfo = API.RouteInfo;
567
561
  export type SafetyViolation = API.SafetyViolation;
568
562
  export type SamplingParams = API.SamplingParams;
569
563
  export type ScoringResult = API.ScoringResult;
570
564
  export type SystemMessage = API.SystemMessage;
565
+ export type VersionInfo = API.VersionInfo;
571
566
  }
572
567
 
573
568
  export { getResponseOutputText } from './lib/response-helpers';
@@ -0,0 +1,84 @@
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 { APIResource } from '../../resource';
10
+ import { isRequestOptions } from '../../core';
11
+ import * as Core from '../../core';
12
+ import * as ProvidersAPI from '../providers';
13
+ import * as RoutesAPI from '../routes';
14
+ import * as Shared from '../shared';
15
+
16
+ export class Admin extends APIResource {
17
+ /**
18
+ * Get the current health status of the service.
19
+ */
20
+ health(options?: Core.RequestOptions): Core.APIPromise<Shared.HealthInfo> {
21
+ return this._client.get('/v1alpha/admin/health', options);
22
+ }
23
+
24
+ /**
25
+ * Get detailed information about a specific provider.
26
+ */
27
+ inspectProvider(providerId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.ProviderInfo> {
28
+ return this._client.get(`/v1alpha/admin/providers/${providerId}`, options);
29
+ }
30
+
31
+ /**
32
+ * List all available providers with their configuration and health status.
33
+ */
34
+ listProviders(options?: Core.RequestOptions): Core.APIPromise<ProvidersAPI.ProviderListResponse> {
35
+ return (
36
+ this._client.get('/v1alpha/admin/providers', options) as Core.APIPromise<{
37
+ data: ProvidersAPI.ProviderListResponse;
38
+ }>
39
+ )._thenUnwrap((obj) => obj.data);
40
+ }
41
+
42
+ /**
43
+ * List all available API routes with their methods and implementing providers.
44
+ */
45
+ listRoutes(
46
+ query?: AdminListRoutesParams,
47
+ options?: Core.RequestOptions,
48
+ ): Core.APIPromise<RoutesAPI.RouteListResponse>;
49
+ listRoutes(options?: Core.RequestOptions): Core.APIPromise<RoutesAPI.RouteListResponse>;
50
+ listRoutes(
51
+ query: AdminListRoutesParams | Core.RequestOptions = {},
52
+ options?: Core.RequestOptions,
53
+ ): Core.APIPromise<RoutesAPI.RouteListResponse> {
54
+ if (isRequestOptions(query)) {
55
+ return this.listRoutes({}, query);
56
+ }
57
+ return (
58
+ this._client.get('/v1alpha/admin/inspect/routes', { query, ...options }) as Core.APIPromise<{
59
+ data: RoutesAPI.RouteListResponse;
60
+ }>
61
+ )._thenUnwrap((obj) => obj.data);
62
+ }
63
+
64
+ /**
65
+ * Get the version of the service.
66
+ */
67
+ version(options?: Core.RequestOptions): Core.APIPromise<Shared.VersionInfo> {
68
+ return this._client.get('/v1alpha/admin/version', options);
69
+ }
70
+ }
71
+
72
+ export interface AdminListRoutesParams {
73
+ /**
74
+ * Filter to control which routes are returned. Can be an API level ('v1',
75
+ * 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or
76
+ * 'deprecated' to show deprecated routes across all levels. If not specified,
77
+ * returns all non-deprecated routes.
78
+ */
79
+ api_filter?: 'v1' | 'v1alpha' | 'v1beta' | 'deprecated' | null;
80
+ }
81
+
82
+ export declare namespace Admin {
83
+ export { type AdminListRoutesParams as AdminListRoutesParams };
84
+ }
@@ -7,6 +7,8 @@
7
7
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
8
 
9
9
  import { APIResource } from '../../resource';
10
+ import * as AdminAPI from './admin';
11
+ import { Admin, AdminListRoutesParams } from './admin';
10
12
  import * as BenchmarksAPI from './benchmarks';
11
13
  import {
12
14
  Benchmark,
@@ -31,6 +33,7 @@ import {
31
33
  import * as PostTrainingAPI from './post-training/post-training';
32
34
  import {
33
35
  AlgorithmConfig,
36
+ ListPostTrainingJobsResponse,
34
37
  PostTraining,
35
38
  PostTrainingJob,
36
39
  PostTrainingPreferenceOptimizeParams,
@@ -38,27 +41,24 @@ import {
38
41
  } from './post-training/post-training';
39
42
 
40
43
  export class Alpha extends APIResource {
41
- inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client);
42
44
  postTraining: PostTrainingAPI.PostTraining = new PostTrainingAPI.PostTraining(this._client);
43
45
  benchmarks: BenchmarksAPI.Benchmarks = new BenchmarksAPI.Benchmarks(this._client);
44
46
  eval: EvalAPI.Eval = new EvalAPI.Eval(this._client);
47
+ admin: AdminAPI.Admin = new AdminAPI.Admin(this._client);
48
+ inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client);
45
49
  }
46
50
 
47
- Alpha.Inference = Inference;
48
51
  Alpha.PostTraining = PostTraining;
49
52
  Alpha.Benchmarks = Benchmarks;
50
53
  Alpha.Eval = Eval;
54
+ Alpha.Admin = Admin;
55
+ Alpha.Inference = Inference;
51
56
 
52
57
  export declare namespace Alpha {
53
- export {
54
- Inference as Inference,
55
- type InferenceRerankResponse as InferenceRerankResponse,
56
- type InferenceRerankParams as InferenceRerankParams,
57
- };
58
-
59
58
  export {
60
59
  PostTraining as PostTraining,
61
60
  type AlgorithmConfig as AlgorithmConfig,
61
+ type ListPostTrainingJobsResponse as ListPostTrainingJobsResponse,
62
62
  type PostTrainingJob as PostTrainingJob,
63
63
  type PostTrainingPreferenceOptimizeParams as PostTrainingPreferenceOptimizeParams,
64
64
  type PostTrainingSupervisedFineTuneParams as PostTrainingSupervisedFineTuneParams,
@@ -82,4 +82,12 @@ export declare namespace Alpha {
82
82
  type EvalRunEvalParams as EvalRunEvalParams,
83
83
  type EvalRunEvalAlphaParams as EvalRunEvalAlphaParams,
84
84
  };
85
+
86
+ export { Admin as Admin, type AdminListRoutesParams as AdminListRoutesParams };
87
+
88
+ export {
89
+ Inference as Inference,
90
+ type InferenceRerankResponse as InferenceRerankResponse,
91
+ type InferenceRerankParams as InferenceRerankParams,
92
+ };
85
93
  }
@@ -59,6 +59,9 @@ export class Benchmarks extends APIResource {
59
59
  * A benchmark resource for evaluating model performance.
60
60
  */
61
61
  export interface Benchmark {
62
+ /**
63
+ * Identifier of the dataset to use for the benchmark evaluation.
64
+ */
62
65
  dataset_id: string;
63
66
 
64
67
  /**
@@ -71,10 +74,13 @@ export interface Benchmark {
71
74
  */
72
75
  provider_id: string;
73
76
 
77
+ /**
78
+ * List of scoring function identifiers to apply during evaluation.
79
+ */
74
80
  scoring_functions: Array<string>;
75
81
 
76
82
  /**
77
- * Metadata for this evaluation task
83
+ * Metadata for this evaluation task.
78
84
  */
79
85
  metadata?: { [key: string]: unknown };
80
86
 
@@ -83,26 +89,56 @@ export interface Benchmark {
83
89
  */
84
90
  provider_resource_id?: string | null;
85
91
 
92
+ /**
93
+ * The resource type, always benchmark.
94
+ */
86
95
  type?: 'benchmark';
87
96
  }
88
97
 
98
+ /**
99
+ * Response containing a list of benchmark objects.
100
+ */
89
101
  export interface ListBenchmarksResponse {
102
+ /**
103
+ * List of benchmark objects.
104
+ */
90
105
  data: BenchmarkListResponse;
91
106
  }
92
107
 
108
+ /**
109
+ * List of benchmark objects.
110
+ */
93
111
  export type BenchmarkListResponse = Array<Benchmark>;
94
112
 
95
113
  export interface BenchmarkRegisterParams {
114
+ /**
115
+ * The ID of the benchmark to register.
116
+ */
96
117
  benchmark_id: string;
97
118
 
119
+ /**
120
+ * The ID of the dataset to use for the benchmark.
121
+ */
98
122
  dataset_id: string;
99
123
 
124
+ /**
125
+ * The scoring functions to use for the benchmark.
126
+ */
100
127
  scoring_functions: Array<string>;
101
128
 
129
+ /**
130
+ * The metadata to use for the benchmark.
131
+ */
102
132
  metadata?: { [key: string]: unknown } | null;
103
133
 
134
+ /**
135
+ * The ID of the provider benchmark to use for the benchmark.
136
+ */
104
137
  provider_benchmark_id?: string | null;
105
138
 
139
+ /**
140
+ * The ID of the provider to use for the benchmark.
141
+ */
106
142
  provider_id?: string | null;
107
143
  }
108
144