@vertesia/client 1.6.0-dev.20260918.063824Z → 1.6.0-dev.20260918.115658Z
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/lib/EnvironmentsApi.d.ts +6 -1
- package/lib/EnvironmentsApi.d.ts.map +1 -1
- package/lib/EnvironmentsApi.js +15 -0
- package/lib/EnvironmentsApi.js.map +1 -1
- package/lib/store/EmbeddingsApi.d.ts +8 -2
- package/lib/store/EmbeddingsApi.d.ts.map +1 -1
- package/lib/store/EmbeddingsApi.js +20 -2
- package/lib/store/EmbeddingsApi.js.map +1 -1
- package/lib/vertesia-client.js +2 -2
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +4 -4
- package/src/EnvironmentsApi.ts +28 -0
- package/src/store/EmbeddingsApi.test.ts +31 -0
- package/src/store/EmbeddingsApi.ts +47 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "1.6.0-dev.20260918.
|
|
3
|
+
"version": "1.6.0-dev.20260918.115658Z",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@llumiverse/common": "1.6.0-dev.20260918.055633Z",
|
|
22
|
-
"@vertesia/api-fetch-client": "1.6.0-dev.20260918.
|
|
23
|
-
"@vertesia/common": "1.6.0-dev.20260918.
|
|
22
|
+
"@vertesia/api-fetch-client": "1.6.0-dev.20260918.115658Z",
|
|
23
|
+
"@vertesia/common": "1.6.0-dev.20260918.115658Z",
|
|
24
24
|
"eventsource": "^5.1.1"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ai",
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "5961811f0fdaee3b4902a2230875a3325e64ad80",
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "biome lint src",
|
|
54
54
|
"clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
|
package/src/EnvironmentsApi.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { AIModel, ModelSearchPayload } from '@llumiverse/common';
|
|
2
2
|
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
3
3
|
import type {
|
|
4
|
+
EmbeddingBatchCapabilityRequest,
|
|
5
|
+
EmbeddingBatchCapabilityResponse,
|
|
6
|
+
EmbeddingBatchCreateRequest,
|
|
7
|
+
EmbeddingBatchJobRequest,
|
|
8
|
+
EmbeddingBatchJobResponse,
|
|
4
9
|
EmbeddingsApiRequest,
|
|
5
10
|
EmbeddingsApiResult,
|
|
6
11
|
EnableEnvironmentModelPayload,
|
|
@@ -84,6 +89,29 @@ export default class EnvironmentsApi extends ApiTopic {
|
|
|
84
89
|
});
|
|
85
90
|
}
|
|
86
91
|
|
|
92
|
+
embeddingBatchCapability(
|
|
93
|
+
id: string,
|
|
94
|
+
payload: EmbeddingBatchCapabilityRequest,
|
|
95
|
+
): Promise<EmbeddingBatchCapabilityResponse> {
|
|
96
|
+
return this.post(`/${id}/embedding-batches/capability`, { payload });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
createEmbeddingBatch(id: string, payload: EmbeddingBatchCreateRequest): Promise<EmbeddingBatchJobResponse> {
|
|
100
|
+
return this.post(`/${id}/embedding-batches`, { payload });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
getEmbeddingBatch(id: string, payload: EmbeddingBatchJobRequest): Promise<EmbeddingBatchJobResponse> {
|
|
104
|
+
return this.post(`/${id}/embedding-batches/get`, { payload });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
cancelEmbeddingBatch(id: string, payload: EmbeddingBatchJobRequest): Promise<EmbeddingBatchJobResponse> {
|
|
108
|
+
return this.post(`/${id}/embedding-batches/cancel`, { payload });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
deleteEmbeddingBatch(id: string, payload: EmbeddingBatchJobRequest): Promise<EmbeddingBatchJobResponse> {
|
|
112
|
+
return this.post(`/${id}/embedding-batches/delete`, { payload });
|
|
113
|
+
}
|
|
114
|
+
|
|
87
115
|
/**
|
|
88
116
|
* Batch update the LLM Environment for multiple Interactions, including the model used and the
|
|
89
117
|
* Environment that they belong to.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SupportedEmbeddingTypes } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { ZenoClient } from './client.js';
|
|
4
|
+
|
|
5
|
+
describe('EmbeddingsApi', () => {
|
|
6
|
+
it('omits the mode by default and sends the explicit sync override when requested', async () => {
|
|
7
|
+
const requests: Request[] = [];
|
|
8
|
+
const client = new ZenoClient({
|
|
9
|
+
serverUrl: 'https://store.example.com',
|
|
10
|
+
apikey: 'token',
|
|
11
|
+
fetch: vi.fn(
|
|
12
|
+
async () =>
|
|
13
|
+
new Response(JSON.stringify({ status: 'success', message: 'started' }), {
|
|
14
|
+
status: 200,
|
|
15
|
+
headers: { 'content-type': 'application/json' },
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
onRequest: (request) => requests.push(request),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
await client.embeddings.recalculate(SupportedEmbeddingTypes.text);
|
|
22
|
+
await client.embeddings.recalculate(SupportedEmbeddingTypes.text, { mode: 'sync' });
|
|
23
|
+
await client.embeddings.recalculate(SupportedEmbeddingTypes.image, { force: true });
|
|
24
|
+
|
|
25
|
+
expect(requests.map(({ url }) => url)).toEqual([
|
|
26
|
+
'https://store.example.com/api/v1/embeddings/text/recalculate',
|
|
27
|
+
'https://store.example.com/api/v1/embeddings/text/recalculate?mode=sync',
|
|
28
|
+
'https://store.example.com/api/v1/embeddings/image/recalculate?force=true',
|
|
29
|
+
]);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
2
|
import type {
|
|
3
|
+
EmbeddingBatchApplyRequest,
|
|
4
|
+
EmbeddingBatchApplyResponse,
|
|
5
|
+
EmbeddingBatchPrepareRequest,
|
|
6
|
+
EmbeddingBatchPrepareResponse,
|
|
7
|
+
EmbeddingBatchRenditionPageRequest,
|
|
8
|
+
EmbeddingBatchRenditionPageResponse,
|
|
9
|
+
EmbeddingBatchUpdateRequest,
|
|
3
10
|
EmbeddingsStatusResponse,
|
|
4
11
|
GenericCommandResponse,
|
|
5
12
|
ProjectConfigurationEmbeddingEnablePayload,
|
|
13
|
+
RecalculateEmbeddingsQuery,
|
|
6
14
|
SupportedEmbeddingTypes,
|
|
7
15
|
} from '@vertesia/common';
|
|
8
16
|
|
|
@@ -33,7 +41,44 @@ export class EmbeddingsApi extends ApiTopic {
|
|
|
33
41
|
return this.post(`${type}/disable`);
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
async recalculate(
|
|
37
|
-
|
|
44
|
+
async recalculate(
|
|
45
|
+
type: SupportedEmbeddingTypes,
|
|
46
|
+
query: RecalculateEmbeddingsQuery = {},
|
|
47
|
+
): Promise<GenericCommandResponse> {
|
|
48
|
+
return this.post(`${type}/recalculate`, Object.keys(query).length ? { query } : undefined);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async prepareBatch(
|
|
52
|
+
payload: EmbeddingBatchPrepareRequest,
|
|
53
|
+
timeoutMs: number | false | null = false,
|
|
54
|
+
): Promise<EmbeddingBatchPrepareResponse> {
|
|
55
|
+
return this.post('/batch/prepare', { payload, timeoutMs });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async updateBatch(payload: EmbeddingBatchUpdateRequest): Promise<GenericCommandResponse> {
|
|
59
|
+
return this.post('/batch/update', { payload });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async prepareBatchRenditionPage(
|
|
63
|
+
payload: EmbeddingBatchRenditionPageRequest,
|
|
64
|
+
): Promise<EmbeddingBatchRenditionPageResponse> {
|
|
65
|
+
return this.post('/batch/renditions/prepare', { payload });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async pollBatchRenditionPage(
|
|
69
|
+
payload: EmbeddingBatchRenditionPageRequest,
|
|
70
|
+
): Promise<EmbeddingBatchRenditionPageResponse> {
|
|
71
|
+
return this.post('/batch/renditions/status', { payload });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async cancelBatchRenditionPage(payload: EmbeddingBatchRenditionPageRequest): Promise<GenericCommandResponse> {
|
|
75
|
+
return this.post('/batch/renditions/cancel', { payload });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async applyBatch(
|
|
79
|
+
payload: EmbeddingBatchApplyRequest,
|
|
80
|
+
timeoutMs: number | false | null = false,
|
|
81
|
+
): Promise<EmbeddingBatchApplyResponse> {
|
|
82
|
+
return this.post('/batch/apply', { payload, timeoutMs });
|
|
38
83
|
}
|
|
39
84
|
}
|