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.
- package/.github/workflows/ci.yml +4 -4
- package/.github/workflows/release-doctor.yml +1 -1
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +41 -0
- package/LICENSE +1 -1
- package/README.md +41 -27
- package/api.md +32 -25
- package/dist/CHANGELOG.md +41 -0
- package/dist/LICENSE +1 -1
- package/dist/README.md +41 -27
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +5 -0
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +5 -0
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/alpha/admin.d.ts +41 -0
- package/dist/resources/alpha/admin.d.ts.map +1 -0
- package/dist/resources/alpha/admin.js +46 -0
- package/dist/resources/alpha/admin.js.map +1 -0
- package/dist/resources/alpha/admin.mjs +42 -0
- package/dist/resources/alpha/admin.mjs.map +1 -0
- package/dist/resources/alpha/alpha.d.ts +8 -4
- package/dist/resources/alpha/alpha.d.ts.map +1 -1
- package/dist/resources/alpha/alpha.js +6 -2
- package/dist/resources/alpha/alpha.js.map +1 -1
- package/dist/resources/alpha/alpha.mjs +6 -2
- package/dist/resources/alpha/alpha.mjs.map +1 -1
- package/dist/resources/alpha/benchmarks.d.ts +37 -1
- package/dist/resources/alpha/benchmarks.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.d.ts +28 -7
- package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.js.map +1 -1
- package/dist/resources/alpha/eval/eval.mjs.map +1 -1
- package/dist/resources/alpha/index.d.ts +2 -1
- package/dist/resources/alpha/index.d.ts.map +1 -1
- package/dist/resources/alpha/index.js +3 -1
- package/dist/resources/alpha/index.js.map +1 -1
- package/dist/resources/alpha/index.mjs +1 -0
- package/dist/resources/alpha/index.mjs.map +1 -1
- package/dist/resources/alpha/inference.d.ts +58 -7
- package/dist/resources/alpha/inference.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.d.ts +2 -2
- package/dist/resources/alpha/post-training/index.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.js.map +1 -1
- package/dist/resources/alpha/post-training/index.mjs +1 -1
- package/dist/resources/alpha/post-training/index.mjs.map +1 -1
- package/dist/resources/alpha/post-training/job.d.ts +4 -16
- package/dist/resources/alpha/post-training/job.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/job.js +5 -6
- package/dist/resources/alpha/post-training/job.js.map +1 -1
- package/dist/resources/alpha/post-training/job.mjs +5 -6
- package/dist/resources/alpha/post-training/job.mjs.map +1 -1
- package/dist/resources/alpha/post-training/post-training.d.ts +38 -11
- package/dist/resources/alpha/post-training/post-training.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/post-training.js.map +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs.map +1 -1
- package/dist/resources/beta/datasets.d.ts +102 -8
- package/dist/resources/beta/datasets.d.ts.map +1 -1
- package/dist/resources/chat/chat.d.ts +119 -17
- package/dist/resources/chat/chat.d.ts.map +1 -1
- package/dist/resources/chat/chat.js.map +1 -1
- package/dist/resources/chat/chat.mjs.map +1 -1
- package/dist/resources/chat/completions.d.ts +1130 -73
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +0 -2
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +0 -2
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/completions.d.ts +135 -26
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/completions.js.map +1 -1
- package/dist/resources/completions.mjs.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +56 -12
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js +0 -8
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs +0 -8
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/items.d.ts +364 -81
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +0 -6
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +0 -6
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/embeddings.d.ts +46 -8
- package/dist/resources/embeddings.d.ts.map +1 -1
- package/dist/resources/embeddings.js +0 -2
- package/dist/resources/embeddings.js.map +1 -1
- package/dist/resources/embeddings.mjs +0 -2
- package/dist/resources/embeddings.mjs.map +1 -1
- package/dist/resources/files.d.ts +58 -31
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +4 -16
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs +4 -16
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +3 -3
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/inspect.d.ts +3 -45
- package/dist/resources/inspect.d.ts.map +1 -1
- package/dist/resources/inspect.js +0 -4
- package/dist/resources/inspect.js.map +1 -1
- package/dist/resources/inspect.mjs +0 -4
- package/dist/resources/inspect.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +21 -6
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +0 -6
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +0 -6
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/moderations.d.ts +38 -5
- package/dist/resources/moderations.d.ts.map +1 -1
- package/dist/resources/moderations.js +1 -3
- package/dist/resources/moderations.js.map +1 -1
- package/dist/resources/moderations.mjs +1 -3
- package/dist/resources/moderations.mjs.map +1 -1
- package/dist/resources/prompts/prompts.d.ts +24 -10
- package/dist/resources/prompts/prompts.d.ts.map +1 -1
- package/dist/resources/prompts/prompts.js +2 -10
- package/dist/resources/prompts/prompts.js.map +1 -1
- package/dist/resources/prompts/prompts.mjs +2 -10
- package/dist/resources/prompts/prompts.mjs.map +1 -1
- package/dist/resources/prompts/versions.d.ts +0 -2
- package/dist/resources/prompts/versions.d.ts.map +1 -1
- package/dist/resources/prompts/versions.js +0 -2
- package/dist/resources/prompts/versions.js.map +1 -1
- package/dist/resources/prompts/versions.mjs +0 -2
- package/dist/resources/prompts/versions.mjs.map +1 -1
- package/dist/resources/providers.d.ts +5 -12
- package/dist/resources/providers.d.ts.map +1 -1
- package/dist/resources/providers.js +0 -4
- package/dist/resources/providers.js.map +1 -1
- package/dist/resources/providers.mjs +0 -4
- package/dist/resources/providers.mjs.map +1 -1
- package/dist/resources/responses/input-items.d.ts +108 -9
- package/dist/resources/responses/input-items.d.ts.map +1 -1
- package/dist/resources/responses/responses.d.ts +881 -124
- package/dist/resources/responses/responses.d.ts.map +1 -1
- package/dist/resources/responses/responses.js.map +1 -1
- package/dist/resources/responses/responses.mjs.map +1 -1
- package/dist/resources/routes.d.ts +10 -9
- package/dist/resources/routes.d.ts.map +1 -1
- package/dist/resources/routes.js.map +1 -1
- package/dist/resources/routes.mjs.map +1 -1
- package/dist/resources/safety.d.ts +131 -9
- package/dist/resources/safety.d.ts.map +1 -1
- package/dist/resources/safety.js +1 -3
- package/dist/resources/safety.js.map +1 -1
- package/dist/resources/safety.mjs +1 -3
- package/dist/resources/safety.mjs.map +1 -1
- package/dist/resources/scoring-functions.d.ts +23 -1
- package/dist/resources/scoring-functions.d.ts.map +1 -1
- package/dist/resources/scoring.d.ts +24 -0
- package/dist/resources/scoring.d.ts.map +1 -1
- package/dist/resources/shared.d.ts +139 -7
- package/dist/resources/shared.d.ts.map +1 -1
- package/dist/resources/shields.d.ts +21 -0
- package/dist/resources/shields.d.ts.map +1 -1
- package/dist/resources/vector-io.d.ts +75 -58
- package/dist/resources/vector-io.d.ts.map +1 -1
- package/dist/resources/vector-io.js +1 -1
- package/dist/resources/vector-io.mjs +1 -1
- package/dist/resources/vector-stores/file-batches.d.ts +13 -7
- package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/dist/resources/vector-stores/file-batches.js +3 -6
- package/dist/resources/vector-stores/file-batches.js.map +1 -1
- package/dist/resources/vector-stores/file-batches.mjs +3 -6
- package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
- package/dist/resources/vector-stores/files.d.ts +31 -9
- package/dist/resources/vector-stores/files.d.ts.map +1 -1
- package/dist/resources/vector-stores/files.js +4 -4
- package/dist/resources/vector-stores/files.js.map +1 -1
- package/dist/resources/vector-stores/files.mjs +4 -4
- package/dist/resources/vector-stores/files.mjs.map +1 -1
- package/dist/resources/vector-stores/vector-stores.d.ts +87 -13
- package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/dist/resources/vector-stores/vector-stores.js +5 -10
- package/dist/resources/vector-stores/vector-stores.js.map +1 -1
- package/dist/resources/vector-stores/vector-stores.mjs +5 -10
- package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/dist/src/core.ts +6 -0
- package/dist/src/index.ts +11 -16
- package/dist/src/resources/alpha/admin.ts +84 -0
- package/dist/src/resources/alpha/alpha.ts +16 -8
- package/dist/src/resources/alpha/benchmarks.ts +37 -1
- package/dist/src/resources/alpha/eval/eval.ts +28 -7
- package/dist/src/resources/alpha/index.ts +2 -0
- package/dist/src/resources/alpha/inference.ts +58 -7
- package/dist/src/resources/alpha/post-training/index.ts +2 -10
- package/dist/src/resources/alpha/post-training/job.ts +5 -26
- package/dist/src/resources/alpha/post-training/post-training.ts +38 -22
- package/dist/src/resources/beta/datasets.ts +103 -8
- package/dist/src/resources/chat/chat.ts +122 -20
- package/dist/src/resources/chat/completions.ts +1138 -79
- package/dist/src/resources/completions.ts +137 -28
- package/dist/src/resources/conversations/conversations.ts +67 -15
- package/dist/src/resources/conversations/items.ts +479 -110
- package/dist/src/resources/embeddings.ts +46 -8
- package/dist/src/resources/files.ts +58 -31
- package/dist/src/resources/index.ts +3 -3
- package/dist/src/resources/inspect.ts +3 -57
- package/dist/src/resources/models/models.ts +21 -6
- package/dist/src/resources/moderations.ts +38 -5
- package/dist/src/resources/prompts/prompts.ts +26 -12
- package/dist/src/resources/prompts/versions.ts +0 -2
- package/dist/src/resources/providers.ts +5 -16
- package/dist/src/resources/responses/input-items.ts +138 -15
- package/dist/src/resources/responses/responses.ts +1076 -196
- package/dist/src/resources/routes.ts +10 -14
- package/dist/src/resources/safety.ts +131 -8
- package/dist/src/resources/scoring-functions.ts +23 -1
- package/dist/src/resources/scoring.ts +24 -0
- package/dist/src/resources/shared.ts +148 -7
- package/dist/src/resources/shields.ts +21 -0
- package/dist/src/resources/vector-io.ts +95 -78
- package/dist/src/resources/vector-stores/file-batches.ts +13 -7
- package/dist/src/resources/vector-stores/files.ts +31 -11
- package/dist/src/resources/vector-stores/vector-stores.ts +89 -15
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/core.ts +6 -0
- package/src/index.ts +11 -16
- package/src/resources/alpha/admin.ts +84 -0
- package/src/resources/alpha/alpha.ts +16 -8
- package/src/resources/alpha/benchmarks.ts +37 -1
- package/src/resources/alpha/eval/eval.ts +28 -7
- package/src/resources/alpha/index.ts +2 -0
- package/src/resources/alpha/inference.ts +58 -7
- package/src/resources/alpha/post-training/index.ts +2 -10
- package/src/resources/alpha/post-training/job.ts +5 -26
- package/src/resources/alpha/post-training/post-training.ts +38 -22
- package/src/resources/beta/datasets.ts +103 -8
- package/src/resources/chat/chat.ts +122 -20
- package/src/resources/chat/completions.ts +1138 -79
- package/src/resources/completions.ts +137 -28
- package/src/resources/conversations/conversations.ts +67 -15
- package/src/resources/conversations/items.ts +479 -110
- package/src/resources/embeddings.ts +46 -8
- package/src/resources/files.ts +58 -31
- package/src/resources/index.ts +3 -3
- package/src/resources/inspect.ts +3 -57
- package/src/resources/models/models.ts +21 -6
- package/src/resources/moderations.ts +38 -5
- package/src/resources/prompts/prompts.ts +26 -12
- package/src/resources/prompts/versions.ts +0 -2
- package/src/resources/providers.ts +5 -16
- package/src/resources/responses/input-items.ts +138 -15
- package/src/resources/responses/responses.ts +1076 -196
- package/src/resources/routes.ts +10 -14
- package/src/resources/safety.ts +131 -8
- package/src/resources/scoring-functions.ts +23 -1
- package/src/resources/scoring.ts +24 -0
- package/src/resources/shared.ts +148 -7
- package/src/resources/shields.ts +21 -0
- package/src/resources/vector-io.ts +95 -78
- package/src/resources/vector-stores/file-batches.ts +13 -7
- package/src/resources/vector-stores/files.ts +31 -11
- package/src/resources/vector-stores/vector-stores.ts +89 -15
- package/src/version.ts +1 -1
- package/tests/api-resources/alpha/admin.test.ts +111 -0
- package/tests/api-resources/alpha/eval/eval.test.ts +40 -20
- package/tests/api-resources/alpha/inference.test.ts +1 -1
- package/tests/api-resources/alpha/post-training/job.test.ts +21 -12
- package/tests/api-resources/alpha/post-training/post-training.test.ts +12 -2
- package/tests/api-resources/beta/datasets.test.ts +9 -3
- package/tests/api-resources/chat/completions.test.ts +20 -7
- package/tests/api-resources/completions.test.ts +5 -5
- package/tests/api-resources/conversations/items.test.ts +22 -3
- package/tests/api-resources/embeddings.test.ts +2 -2
- package/tests/api-resources/files.test.ts +6 -1
- package/tests/api-resources/responses/input-items.test.ts +7 -1
- package/tests/api-resources/responses/responses.test.ts +19 -5
- package/tests/api-resources/safety.test.ts +9 -5
- package/tests/api-resources/tool-runtime.test.ts +9 -2
- package/tests/api-resources/vector-io.test.ts +13 -4
- package/tests/api-resources/vector-stores/file-batches.test.ts +7 -1
- package/tests/api-resources/vector-stores/files.test.ts +7 -1
- 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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
@@ -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: {
|
|
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: '
|
|
39
|
+
model: 'x',
|
|
35
40
|
sampling_params: {
|
|
36
|
-
max_tokens:
|
|
37
|
-
repetition_penalty:
|
|
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:
|
|
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: {
|
|
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: '
|
|
89
|
+
model: 'x',
|
|
80
90
|
sampling_params: {
|
|
81
|
-
max_tokens:
|
|
82
|
-
repetition_penalty:
|
|
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:
|
|
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: {
|
|
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: '
|
|
137
|
+
model: 'x',
|
|
123
138
|
sampling_params: {
|
|
124
|
-
max_tokens:
|
|
125
|
-
repetition_penalty:
|
|
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:
|
|
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: {
|
|
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: '
|
|
183
|
+
model: 'x',
|
|
164
184
|
sampling_params: {
|
|
165
|
-
max_tokens:
|
|
166
|
-
repetition_penalty:
|
|
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:
|
|
193
|
+
num_examples: 1,
|
|
174
194
|
scoring_params: {
|
|
175
195
|
foo: {
|
|
176
196
|
judge_model: 'judge_model',
|
|
@@ -30,8 +30,8 @@ describe('resource job', () => {
|
|
|
30
30
|
);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
test('artifacts
|
|
34
|
-
const responsePromise = client.alpha.postTraining.job.artifacts(
|
|
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:
|
|
45
|
-
|
|
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
|
|
49
|
-
const responsePromise = client.alpha.postTraining.job.cancel(
|
|
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:
|
|
60
|
-
|
|
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
|
|
64
|
-
const responsePromise = client.alpha.postTraining.job.status(
|
|
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:
|
|
75
|
-
|
|
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: {
|
|
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: {
|
|
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,
|