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
|
@@ -49,7 +49,10 @@ describe('resource datasets', () => {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
test('appendrows: only required params', async () => {
|
|
52
|
-
const responsePromise = client.beta.datasets.appendrows('dataset_id', {
|
|
52
|
+
const responsePromise = client.beta.datasets.appendrows('dataset_id', {
|
|
53
|
+
body_dataset_id: 'dataset_id',
|
|
54
|
+
rows: [{ foo: 'bar' }],
|
|
55
|
+
});
|
|
53
56
|
const rawResponse = await responsePromise.asResponse();
|
|
54
57
|
expect(rawResponse).toBeInstanceOf(Response);
|
|
55
58
|
const response = await responsePromise;
|
|
@@ -60,7 +63,10 @@ describe('resource datasets', () => {
|
|
|
60
63
|
});
|
|
61
64
|
|
|
62
65
|
test('appendrows: required and optional params', async () => {
|
|
63
|
-
const response = await client.beta.datasets.appendrows('dataset_id', {
|
|
66
|
+
const response = await client.beta.datasets.appendrows('dataset_id', {
|
|
67
|
+
body_dataset_id: 'dataset_id',
|
|
68
|
+
rows: [{ foo: 'bar' }],
|
|
69
|
+
});
|
|
64
70
|
});
|
|
65
71
|
|
|
66
72
|
test('iterrows', async () => {
|
|
@@ -95,7 +101,7 @@ describe('resource datasets', () => {
|
|
|
95
101
|
test('register: only required params', async () => {
|
|
96
102
|
const responsePromise = client.beta.datasets.register({
|
|
97
103
|
purpose: 'post-training/messages',
|
|
98
|
-
source: { uri: 'uri' },
|
|
104
|
+
source: { uri: 'uri', type: 'uri' },
|
|
99
105
|
});
|
|
100
106
|
const rawResponse = await responsePromise.asResponse();
|
|
101
107
|
expect(rawResponse).toBeInstanceOf(Response);
|
|
@@ -28,19 +28,27 @@ describe('resource completions', () => {
|
|
|
28
28
|
|
|
29
29
|
test('create: required and optional params', async () => {
|
|
30
30
|
const response = await client.chat.completions.create({
|
|
31
|
-
messages: [
|
|
31
|
+
messages: [
|
|
32
|
+
{
|
|
33
|
+
content: 'string',
|
|
34
|
+
name: 'name',
|
|
35
|
+
role: 'user',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
32
38
|
model: 'model',
|
|
33
|
-
frequency_penalty:
|
|
39
|
+
frequency_penalty: -2,
|
|
34
40
|
function_call: 'string',
|
|
35
41
|
functions: [{ foo: 'bar' }],
|
|
36
42
|
logit_bias: { foo: 0 },
|
|
37
43
|
logprobs: true,
|
|
38
|
-
max_completion_tokens:
|
|
39
|
-
max_tokens:
|
|
40
|
-
n:
|
|
44
|
+
max_completion_tokens: 1,
|
|
45
|
+
max_tokens: 1,
|
|
46
|
+
n: 1,
|
|
41
47
|
parallel_tool_calls: true,
|
|
42
|
-
presence_penalty:
|
|
48
|
+
presence_penalty: -2,
|
|
49
|
+
reasoning_effort: 'none',
|
|
43
50
|
response_format: { type: 'text' },
|
|
51
|
+
safety_identifier: 'safety_identifier',
|
|
44
52
|
seed: 0,
|
|
45
53
|
stop: 'string',
|
|
46
54
|
stream: false,
|
|
@@ -94,7 +102,12 @@ describe('resource completions', () => {
|
|
|
94
102
|
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
95
103
|
await expect(
|
|
96
104
|
client.chat.completions.list(
|
|
97
|
-
{
|
|
105
|
+
{
|
|
106
|
+
after: 'after',
|
|
107
|
+
limit: 0,
|
|
108
|
+
model: 'model',
|
|
109
|
+
order: 'asc',
|
|
110
|
+
},
|
|
98
111
|
{ path: '/_stainless_unknown_path' },
|
|
99
112
|
),
|
|
100
113
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -27,14 +27,14 @@ describe('resource completions', () => {
|
|
|
27
27
|
const response = await client.completions.create({
|
|
28
28
|
model: 'model',
|
|
29
29
|
prompt: 'string',
|
|
30
|
-
best_of:
|
|
30
|
+
best_of: 1,
|
|
31
31
|
echo: true,
|
|
32
|
-
frequency_penalty:
|
|
32
|
+
frequency_penalty: -2,
|
|
33
33
|
logit_bias: { foo: 0 },
|
|
34
34
|
logprobs: true,
|
|
35
|
-
max_tokens:
|
|
36
|
-
n:
|
|
37
|
-
presence_penalty:
|
|
35
|
+
max_tokens: 1,
|
|
36
|
+
n: 1,
|
|
37
|
+
presence_penalty: -2,
|
|
38
38
|
seed: 0,
|
|
39
39
|
stop: 'string',
|
|
40
40
|
stream: false,
|
|
@@ -14,7 +14,13 @@ const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL']
|
|
|
14
14
|
describe('resource items', () => {
|
|
15
15
|
test('create: only required params', async () => {
|
|
16
16
|
const responsePromise = client.conversations.items.create('conversation_id', {
|
|
17
|
-
items: [
|
|
17
|
+
items: [
|
|
18
|
+
{
|
|
19
|
+
content: 'string',
|
|
20
|
+
role: 'system',
|
|
21
|
+
type: 'message',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
18
24
|
});
|
|
19
25
|
const rawResponse = await responsePromise.asResponse();
|
|
20
26
|
expect(rawResponse).toBeInstanceOf(Response);
|
|
@@ -27,7 +33,15 @@ describe('resource items', () => {
|
|
|
27
33
|
|
|
28
34
|
test('create: required and optional params', async () => {
|
|
29
35
|
const response = await client.conversations.items.create('conversation_id', {
|
|
30
|
-
items: [
|
|
36
|
+
items: [
|
|
37
|
+
{
|
|
38
|
+
content: 'string',
|
|
39
|
+
role: 'system',
|
|
40
|
+
id: 'id',
|
|
41
|
+
status: 'status',
|
|
42
|
+
type: 'message',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
31
45
|
});
|
|
32
46
|
});
|
|
33
47
|
|
|
@@ -54,7 +68,12 @@ describe('resource items', () => {
|
|
|
54
68
|
await expect(
|
|
55
69
|
client.conversations.items.list(
|
|
56
70
|
'conversation_id',
|
|
57
|
-
{
|
|
71
|
+
{
|
|
72
|
+
after: 'after',
|
|
73
|
+
include: ['web_search_call.action.sources'],
|
|
74
|
+
limit: 0,
|
|
75
|
+
order: 'asc',
|
|
76
|
+
},
|
|
58
77
|
{ path: '/_stainless_unknown_path' },
|
|
59
78
|
),
|
|
60
79
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -27,8 +27,8 @@ describe('resource embeddings', () => {
|
|
|
27
27
|
const response = await client.embeddings.create({
|
|
28
28
|
input: 'string',
|
|
29
29
|
model: 'model',
|
|
30
|
-
dimensions:
|
|
31
|
-
encoding_format: '
|
|
30
|
+
dimensions: 1,
|
|
31
|
+
encoding_format: 'float',
|
|
32
32
|
user: 'user',
|
|
33
33
|
});
|
|
34
34
|
});
|
|
@@ -74,7 +74,12 @@ describe('resource files', () => {
|
|
|
74
74
|
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
75
75
|
await expect(
|
|
76
76
|
client.files.list(
|
|
77
|
-
{
|
|
77
|
+
{
|
|
78
|
+
after: 'after',
|
|
79
|
+
limit: 0,
|
|
80
|
+
order: 'asc',
|
|
81
|
+
purpose: 'assistants',
|
|
82
|
+
},
|
|
78
83
|
{ path: '/_stainless_unknown_path' },
|
|
79
84
|
),
|
|
80
85
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -35,7 +35,13 @@ describe('resource inputItems', () => {
|
|
|
35
35
|
await expect(
|
|
36
36
|
client.responses.inputItems.list(
|
|
37
37
|
'response_id',
|
|
38
|
-
{
|
|
38
|
+
{
|
|
39
|
+
after: 'after',
|
|
40
|
+
before: 'before',
|
|
41
|
+
include: ['web_search_call.action.sources'],
|
|
42
|
+
limit: 0,
|
|
43
|
+
order: 'asc',
|
|
44
|
+
},
|
|
39
45
|
{ path: '/_stainless_unknown_path' },
|
|
40
46
|
),
|
|
41
47
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -28,14 +28,22 @@ describe('resource responses', () => {
|
|
|
28
28
|
input: 'string',
|
|
29
29
|
model: 'model',
|
|
30
30
|
conversation: 'conversation',
|
|
31
|
-
|
|
31
|
+
guardrails: ['string'],
|
|
32
|
+
include: ['web_search_call.action.sources'],
|
|
32
33
|
instructions: 'instructions',
|
|
33
|
-
max_infer_iters:
|
|
34
|
-
|
|
34
|
+
max_infer_iters: 1,
|
|
35
|
+
max_output_tokens: 16,
|
|
36
|
+
max_tool_calls: 1,
|
|
35
37
|
metadata: { foo: 'string' },
|
|
36
38
|
parallel_tool_calls: true,
|
|
37
39
|
previous_response_id: 'previous_response_id',
|
|
38
|
-
prompt: {
|
|
40
|
+
prompt: {
|
|
41
|
+
id: 'id',
|
|
42
|
+
variables: { foo: { text: 'text', type: 'input_text' } },
|
|
43
|
+
version: 'version',
|
|
44
|
+
},
|
|
45
|
+
reasoning: { effort: 'none' },
|
|
46
|
+
safety_identifier: 'safety_identifier',
|
|
39
47
|
store: true,
|
|
40
48
|
stream: false,
|
|
41
49
|
temperature: 0,
|
|
@@ -48,6 +56,7 @@ describe('resource responses', () => {
|
|
|
48
56
|
type: 'text',
|
|
49
57
|
},
|
|
50
58
|
},
|
|
59
|
+
tool_choice: 'auto',
|
|
51
60
|
tools: [{ search_context_size: 'S?oC"high', type: 'web_search' }],
|
|
52
61
|
});
|
|
53
62
|
});
|
|
@@ -92,7 +101,12 @@ describe('resource responses', () => {
|
|
|
92
101
|
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
93
102
|
await expect(
|
|
94
103
|
client.responses.list(
|
|
95
|
-
{
|
|
104
|
+
{
|
|
105
|
+
after: 'after',
|
|
106
|
+
limit: 0,
|
|
107
|
+
model: 'model',
|
|
108
|
+
order: 'asc',
|
|
109
|
+
},
|
|
96
110
|
{ path: '/_stainless_unknown_path' },
|
|
97
111
|
),
|
|
98
112
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -15,8 +15,7 @@ describe('resource safety', () => {
|
|
|
15
15
|
test('runShield: only required params', async () => {
|
|
16
16
|
const responsePromise = client.safety.runShield({
|
|
17
17
|
messages: [{ content: 'string', role: 'user' }],
|
|
18
|
-
|
|
19
|
-
shield_id: 'shield_id',
|
|
18
|
+
shield_id: 'x',
|
|
20
19
|
});
|
|
21
20
|
const rawResponse = await responsePromise.asResponse();
|
|
22
21
|
expect(rawResponse).toBeInstanceOf(Response);
|
|
@@ -29,9 +28,14 @@ describe('resource safety', () => {
|
|
|
29
28
|
|
|
30
29
|
test('runShield: required and optional params', async () => {
|
|
31
30
|
const response = await client.safety.runShield({
|
|
32
|
-
messages: [
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
messages: [
|
|
32
|
+
{
|
|
33
|
+
content: 'string',
|
|
34
|
+
name: 'name',
|
|
35
|
+
role: 'user',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
shield_id: 'x',
|
|
35
39
|
});
|
|
36
40
|
});
|
|
37
41
|
});
|
|
@@ -13,7 +13,10 @@ const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL']
|
|
|
13
13
|
|
|
14
14
|
describe('resource toolRuntime', () => {
|
|
15
15
|
test('invokeTool: only required params', async () => {
|
|
16
|
-
const responsePromise = client.toolRuntime.invokeTool({
|
|
16
|
+
const responsePromise = client.toolRuntime.invokeTool({
|
|
17
|
+
kwargs: { foo: 'bar' },
|
|
18
|
+
tool_name: 'tool_name',
|
|
19
|
+
});
|
|
17
20
|
const rawResponse = await responsePromise.asResponse();
|
|
18
21
|
expect(rawResponse).toBeInstanceOf(Response);
|
|
19
22
|
const response = await responsePromise;
|
|
@@ -53,7 +56,11 @@ describe('resource toolRuntime', () => {
|
|
|
53
56
|
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
54
57
|
await expect(
|
|
55
58
|
client.toolRuntime.listTools(
|
|
56
|
-
{
|
|
59
|
+
{
|
|
60
|
+
authorization: 'authorization',
|
|
61
|
+
mcp_endpoint: { uri: 'uri' },
|
|
62
|
+
tool_group_id: 'tool_group_id',
|
|
63
|
+
},
|
|
57
64
|
{ path: '/_stainless_unknown_path' },
|
|
58
65
|
),
|
|
59
66
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -14,7 +14,16 @@ const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL']
|
|
|
14
14
|
describe('resource vectorIo', () => {
|
|
15
15
|
test('insert: only required params', async () => {
|
|
16
16
|
const responsePromise = client.vectorIo.insert({
|
|
17
|
-
chunks: [
|
|
17
|
+
chunks: [
|
|
18
|
+
{
|
|
19
|
+
chunk_id: 'chunk_id',
|
|
20
|
+
chunk_metadata: {},
|
|
21
|
+
content: 'string',
|
|
22
|
+
embedding: [0],
|
|
23
|
+
embedding_dimension: 0,
|
|
24
|
+
embedding_model: 'embedding_model',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
18
27
|
vector_store_id: 'vector_store_id',
|
|
19
28
|
});
|
|
20
29
|
const rawResponse = await responsePromise.asResponse();
|
|
@@ -31,10 +40,7 @@ describe('resource vectorIo', () => {
|
|
|
31
40
|
chunks: [
|
|
32
41
|
{
|
|
33
42
|
chunk_id: 'chunk_id',
|
|
34
|
-
content: 'string',
|
|
35
43
|
chunk_metadata: {
|
|
36
|
-
chunk_embedding_dimension: 0,
|
|
37
|
-
chunk_embedding_model: 'chunk_embedding_model',
|
|
38
44
|
chunk_id: 'chunk_id',
|
|
39
45
|
chunk_tokenizer: 'chunk_tokenizer',
|
|
40
46
|
chunk_window: 'chunk_window',
|
|
@@ -45,7 +51,10 @@ describe('resource vectorIo', () => {
|
|
|
45
51
|
source: 'source',
|
|
46
52
|
updated_timestamp: 0,
|
|
47
53
|
},
|
|
54
|
+
content: 'string',
|
|
48
55
|
embedding: [0],
|
|
56
|
+
embedding_dimension: 0,
|
|
57
|
+
embedding_model: 'embedding_model',
|
|
49
58
|
metadata: { foo: 'bar' },
|
|
50
59
|
},
|
|
51
60
|
],
|
|
@@ -99,7 +99,13 @@ describe('resource fileBatches', () => {
|
|
|
99
99
|
client.vectorStores.fileBatches.listFiles(
|
|
100
100
|
'vector_store_id',
|
|
101
101
|
'batch_id',
|
|
102
|
-
{
|
|
102
|
+
{
|
|
103
|
+
after: 'after',
|
|
104
|
+
before: 'before',
|
|
105
|
+
filter: 'filter',
|
|
106
|
+
limit: 0,
|
|
107
|
+
order: 'order',
|
|
108
|
+
},
|
|
103
109
|
{ path: '/_stainless_unknown_path' },
|
|
104
110
|
),
|
|
105
111
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -91,7 +91,13 @@ describe('resource files', () => {
|
|
|
91
91
|
await expect(
|
|
92
92
|
client.vectorStores.files.list(
|
|
93
93
|
'vector_store_id',
|
|
94
|
-
{
|
|
94
|
+
{
|
|
95
|
+
after: 'after',
|
|
96
|
+
before: 'before',
|
|
97
|
+
filter: 'completed',
|
|
98
|
+
limit: 0,
|
|
99
|
+
order: 'order',
|
|
100
|
+
},
|
|
95
101
|
{ path: '/_stainless_unknown_path' },
|
|
96
102
|
),
|
|
97
103
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -74,7 +74,12 @@ describe('resource vectorStores', () => {
|
|
|
74
74
|
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
75
75
|
await expect(
|
|
76
76
|
client.vectorStores.list(
|
|
77
|
-
{
|
|
77
|
+
{
|
|
78
|
+
after: 'after',
|
|
79
|
+
before: 'before',
|
|
80
|
+
limit: 0,
|
|
81
|
+
order: 'order',
|
|
82
|
+
},
|
|
78
83
|
{ path: '/_stainless_unknown_path' },
|
|
79
84
|
),
|
|
80
85
|
).rejects.toThrow(LlamaStackClient.NotFoundError);
|
|
@@ -114,7 +119,14 @@ describe('resource vectorStores', () => {
|
|
|
114
119
|
query: 'string',
|
|
115
120
|
filters: { foo: 'bar' },
|
|
116
121
|
max_num_results: 0,
|
|
117
|
-
ranking_options: {
|
|
122
|
+
ranking_options: {
|
|
123
|
+
alpha: 0,
|
|
124
|
+
impact_factor: 0,
|
|
125
|
+
model: 'model',
|
|
126
|
+
ranker: 'ranker',
|
|
127
|
+
score_threshold: 0,
|
|
128
|
+
weights: { foo: 0 },
|
|
129
|
+
},
|
|
118
130
|
rewrite_query: true,
|
|
119
131
|
search_mode: 'search_mode',
|
|
120
132
|
});
|