@vertesia/client 0.53.0 → 0.54.0
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/LICENSE +3 -3
- package/package.json +5 -5
- package/src/ApiKeysApi.ts +1 -1
- package/src/EnvironmentsApi.ts +2 -2
- package/src/InteractionBase.ts +1 -1
- package/src/InteractionsApi.ts +5 -5
- package/src/PluginsApi.ts +28 -0
- package/src/ProjectsApi.ts +10 -2
- package/src/PromptsApi.ts +1 -1
- package/src/client.ts +2 -0
- package/src/execute.ts +5 -5
- package/src/store/ObjectsApi.ts +179 -86
- package/lib/cjs/AccountApi.js +0 -84
- package/lib/cjs/AccountApi.js.map +0 -1
- package/lib/cjs/AccountsApi.js +0 -16
- package/lib/cjs/AccountsApi.js.map +0 -1
- package/lib/cjs/AnalyticsApi.js +0 -13
- package/lib/cjs/AnalyticsApi.js.map +0 -1
- package/lib/cjs/ApiKeysApi.js +0 -63
- package/lib/cjs/ApiKeysApi.js.map +0 -1
- package/lib/cjs/CommandsApi.js +0 -19
- package/lib/cjs/CommandsApi.js.map +0 -1
- package/lib/cjs/EnvironmentsApi.js +0 -58
- package/lib/cjs/EnvironmentsApi.js.map +0 -1
- package/lib/cjs/IamApi.js +0 -51
- package/lib/cjs/IamApi.js.map +0 -1
- package/lib/cjs/InteractionBase.js +0 -44
- package/lib/cjs/InteractionBase.js.map +0 -1
- package/lib/cjs/InteractionsApi.js +0 -209
- package/lib/cjs/InteractionsApi.js.map +0 -1
- package/lib/cjs/ProjectsApi.js +0 -48
- package/lib/cjs/ProjectsApi.js.map +0 -1
- package/lib/cjs/PromptsApi.js +0 -133
- package/lib/cjs/PromptsApi.js.map +0 -1
- package/lib/cjs/RefsApi.js +0 -14
- package/lib/cjs/RefsApi.js.map +0 -1
- package/lib/cjs/RunsApi.js +0 -105
- package/lib/cjs/RunsApi.js.map +0 -1
- package/lib/cjs/StreamSource.js +0 -17
- package/lib/cjs/StreamSource.js.map +0 -1
- package/lib/cjs/TrainingApi.js +0 -54
- package/lib/cjs/TrainingApi.js.map +0 -1
- package/lib/cjs/UsersApi.js +0 -13
- package/lib/cjs/UsersApi.js.map +0 -1
- package/lib/cjs/client.js +0 -216
- package/lib/cjs/client.js.map +0 -1
- package/lib/cjs/execute.js +0 -152
- package/lib/cjs/execute.js.map +0 -1
- package/lib/cjs/index.js +0 -21
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
- package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/cjs/nodejs/index.js +0 -18
- package/lib/cjs/nodejs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/store/AgentsApi.js +0 -16
- package/lib/cjs/store/AgentsApi.js.map +0 -1
- package/lib/cjs/store/AnalyzeDocApi.js +0 -56
- package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
- package/lib/cjs/store/CollectionsApi.js +0 -77
- package/lib/cjs/store/CollectionsApi.js.map +0 -1
- package/lib/cjs/store/CommandsApi.js +0 -17
- package/lib/cjs/store/CommandsApi.js.map +0 -1
- package/lib/cjs/store/EmbeddingsApi.js +0 -29
- package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
- package/lib/cjs/store/FilesApi.js +0 -128
- package/lib/cjs/store/FilesApi.js.map +0 -1
- package/lib/cjs/store/ObjectsApi.js +0 -189
- package/lib/cjs/store/ObjectsApi.js.map +0 -1
- package/lib/cjs/store/TypesApi.js +0 -57
- package/lib/cjs/store/TypesApi.js.map +0 -1
- package/lib/cjs/store/WorkflowsApi.js +0 -174
- package/lib/cjs/store/WorkflowsApi.js.map +0 -1
- package/lib/cjs/store/client.js +0 -55
- package/lib/cjs/store/client.js.map +0 -1
- package/lib/cjs/store/errors.js +0 -11
- package/lib/cjs/store/errors.js.map +0 -1
- package/lib/cjs/store/index.js +0 -22
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/esm/AccountApi.js +0 -81
- package/lib/esm/AccountApi.js.map +0 -1
- package/lib/esm/AccountsApi.js +0 -13
- package/lib/esm/AccountsApi.js.map +0 -1
- package/lib/esm/AnalyticsApi.js +0 -10
- package/lib/esm/AnalyticsApi.js.map +0 -1
- package/lib/esm/ApiKeysApi.js +0 -59
- package/lib/esm/ApiKeysApi.js.map +0 -1
- package/lib/esm/CommandsApi.js +0 -16
- package/lib/esm/CommandsApi.js.map +0 -1
- package/lib/esm/EnvironmentsApi.js +0 -55
- package/lib/esm/EnvironmentsApi.js.map +0 -1
- package/lib/esm/IamApi.js +0 -45
- package/lib/esm/IamApi.js.map +0 -1
- package/lib/esm/InteractionBase.js +0 -40
- package/lib/esm/InteractionBase.js.map +0 -1
- package/lib/esm/InteractionsApi.js +0 -206
- package/lib/esm/InteractionsApi.js.map +0 -1
- package/lib/esm/ProjectsApi.js +0 -45
- package/lib/esm/ProjectsApi.js.map +0 -1
- package/lib/esm/PromptsApi.js +0 -130
- package/lib/esm/PromptsApi.js.map +0 -1
- package/lib/esm/RefsApi.js +0 -10
- package/lib/esm/RefsApi.js.map +0 -1
- package/lib/esm/RunsApi.js +0 -101
- package/lib/esm/RunsApi.js.map +0 -1
- package/lib/esm/StreamSource.js +0 -13
- package/lib/esm/StreamSource.js.map +0 -1
- package/lib/esm/TrainingApi.js +0 -51
- package/lib/esm/TrainingApi.js.map +0 -1
- package/lib/esm/UsersApi.js +0 -10
- package/lib/esm/UsersApi.js.map +0 -1
- package/lib/esm/client.js +0 -209
- package/lib/esm/client.js.map +0 -1
- package/lib/esm/execute.js +0 -113
- package/lib/esm/execute.js.map +0 -1
- package/lib/esm/index.js +0 -5
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/nodejs/NodeStreamSource.js +0 -41
- package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/esm/nodejs/index.js +0 -2
- package/lib/esm/nodejs/index.js.map +0 -1
- package/lib/esm/store/AgentsApi.js +0 -12
- package/lib/esm/store/AgentsApi.js.map +0 -1
- package/lib/esm/store/AnalyzeDocApi.js +0 -52
- package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
- package/lib/esm/store/CollectionsApi.js +0 -73
- package/lib/esm/store/CollectionsApi.js.map +0 -1
- package/lib/esm/store/CommandsApi.js +0 -13
- package/lib/esm/store/CommandsApi.js.map +0 -1
- package/lib/esm/store/EmbeddingsApi.js +0 -25
- package/lib/esm/store/EmbeddingsApi.js.map +0 -1
- package/lib/esm/store/FilesApi.js +0 -123
- package/lib/esm/store/FilesApi.js.map +0 -1
- package/lib/esm/store/ObjectsApi.js +0 -185
- package/lib/esm/store/ObjectsApi.js.map +0 -1
- package/lib/esm/store/TypesApi.js +0 -53
- package/lib/esm/store/TypesApi.js.map +0 -1
- package/lib/esm/store/WorkflowsApi.js +0 -168
- package/lib/esm/store/WorkflowsApi.js.map +0 -1
- package/lib/esm/store/client.js +0 -51
- package/lib/esm/store/client.js.map +0 -1
- package/lib/esm/store/errors.js +0 -7
- package/lib/esm/store/errors.js.map +0 -1
- package/lib/esm/store/index.js +0 -6
- package/lib/esm/store/index.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/AccountApi.d.ts +0 -58
- package/lib/types/AccountApi.d.ts.map +0 -1
- package/lib/types/AccountsApi.d.ts +0 -7
- package/lib/types/AccountsApi.d.ts.map +0 -1
- package/lib/types/AnalyticsApi.d.ts +0 -6
- package/lib/types/AnalyticsApi.d.ts.map +0 -1
- package/lib/types/ApiKeysApi.d.ts +0 -42
- package/lib/types/ApiKeysApi.d.ts.map +0 -1
- package/lib/types/CommandsApi.d.ts +0 -10
- package/lib/types/CommandsApi.d.ts.map +0 -1
- package/lib/types/EnvironmentsApi.d.ts +0 -30
- package/lib/types/EnvironmentsApi.d.ts.map +0 -1
- package/lib/types/IamApi.d.ts +0 -39
- package/lib/types/IamApi.d.ts.map +0 -1
- package/lib/types/InteractionBase.d.ts +0 -22
- package/lib/types/InteractionBase.d.ts.map +0 -1
- package/lib/types/InteractionsApi.d.ts +0 -150
- package/lib/types/InteractionsApi.d.ts.map +0 -1
- package/lib/types/ProjectsApi.d.ts +0 -17
- package/lib/types/ProjectsApi.d.ts.map +0 -1
- package/lib/types/PromptsApi.d.ts +0 -106
- package/lib/types/PromptsApi.d.ts.map +0 -1
- package/lib/types/RefsApi.d.ts +0 -6
- package/lib/types/RefsApi.d.ts.map +0 -1
- package/lib/types/RunsApi.d.ts +0 -77
- package/lib/types/RunsApi.d.ts.map +0 -1
- package/lib/types/StreamSource.d.ts +0 -7
- package/lib/types/StreamSource.d.ts.map +0 -1
- package/lib/types/TrainingApi.d.ts +0 -27
- package/lib/types/TrainingApi.d.ts.map +0 -1
- package/lib/types/UsersApi.d.ts +0 -6
- package/lib/types/UsersApi.d.ts.map +0 -1
- package/lib/types/client.d.ts +0 -101
- package/lib/types/client.d.ts.map +0 -1
- package/lib/types/execute.d.ts +0 -36
- package/lib/types/execute.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -7
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/nodejs/NodeStreamSource.d.ts +0 -9
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
- package/lib/types/nodejs/index.d.ts +0 -1
- package/lib/types/nodejs/index.d.ts.map +0 -1
- package/lib/types/store/AgentsApi.d.ts +0 -6
- package/lib/types/store/AgentsApi.d.ts.map +0 -1
- package/lib/types/store/AnalyzeDocApi.d.ts +0 -17
- package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
- package/lib/types/store/CollectionsApi.d.ts +0 -37
- package/lib/types/store/CollectionsApi.d.ts.map +0 -1
- package/lib/types/store/CommandsApi.d.ts +0 -10
- package/lib/types/store/CommandsApi.d.ts.map +0 -1
- package/lib/types/store/EmbeddingsApi.d.ts +0 -12
- package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
- package/lib/types/store/FilesApi.d.ts +0 -41
- package/lib/types/store/FilesApi.d.ts.map +0 -1
- package/lib/types/store/ObjectsApi.d.ts +0 -78
- package/lib/types/store/ObjectsApi.d.ts.map +0 -1
- package/lib/types/store/TypesApi.d.ts +0 -23
- package/lib/types/store/TypesApi.d.ts.map +0 -1
- package/lib/types/store/WorkflowsApi.d.ts +0 -47
- package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
- package/lib/types/store/client.d.ts +0 -29
- package/lib/types/store/client.d.ts.map +0 -1
- package/lib/types/store/errors.d.ts +0 -4
- package/lib/types/store/errors.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -5
- package/lib/types/store/index.d.ts.map +0 -1
package/lib/esm/ApiKeysApi.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export class ApiKeysApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/apikeys");
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* List all keys for account without values
|
|
8
|
-
* @returns ApiKey[]
|
|
9
|
-
*/
|
|
10
|
-
list() {
|
|
11
|
-
return this.get('/');
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Create an new ApiKey for account
|
|
15
|
-
* BE VERY CAREFUL USING THIS API
|
|
16
|
-
* ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
|
|
17
|
-
* @returns ApiKeyWithValue
|
|
18
|
-
*/
|
|
19
|
-
create(payload) {
|
|
20
|
-
return this.post('/', { payload });
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Update an existing ApiKey for account
|
|
24
|
-
* @returns ApiKey
|
|
25
|
-
*/
|
|
26
|
-
update(id, payload) {
|
|
27
|
-
return this.put(`/${id}`, { payload });
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Retrieve an ApiKey and its value
|
|
31
|
-
* BE VERY CAREFUL USING THIS API AS IT EXPOSE THE API KEY VALUE
|
|
32
|
-
* ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
|
|
33
|
-
* @returns ApiKeyWithValue
|
|
34
|
-
* */
|
|
35
|
-
retrieve(id, withValue = false) {
|
|
36
|
-
if (withValue) {
|
|
37
|
-
return this.get(`/${id}`, { query: { withValue: true } });
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return this.get(`/${id}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* get or create a temporary public key which can be used from browser to browse and execute itneractions.
|
|
45
|
-
* If a public key already exists for the given project (or for the current organization) then it is returned, otherwise a new one is created.
|
|
46
|
-
* The payload object can contain the following properties:
|
|
47
|
-
* - name: the name of the public key. If not specified a random name is generated.
|
|
48
|
-
* - projectId: the id of the project to which the public key will be associated.
|
|
49
|
-
* If not specified the key is associated with the current organization. (i.e. account).
|
|
50
|
-
* - ttl: the time to live of the public key in seconds.
|
|
51
|
-
* The ttl defaults to 1h.
|
|
52
|
-
* @param opts
|
|
53
|
-
* @returns
|
|
54
|
-
*/
|
|
55
|
-
requestPublicKey(payload = {}) {
|
|
56
|
-
return this.get('/pk', { query: payload });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=ApiKeysApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeysApi.js","sourceRoot":"","sources":["../../src/ApiKeysApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,MAAM,OAAO,UAAW,SAAQ,QAAQ;IAGpC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAGD;;;OAGG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAoC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,EAAU,EAAE,OAAoC;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;SAKK;IACL,QAAQ,CAAC,EAAU,EAAE,YAAqB,KAAK;QAC3C,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,UAAkC,EAAE;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAA0C,EAAE,CAAC,CAAC;IAClF,CAAC;CACJ"}
|
package/lib/esm/CommandsApi.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
/**
|
|
3
|
-
* Various utility commands
|
|
4
|
-
*/
|
|
5
|
-
export default class CommandsApi extends ApiTopic {
|
|
6
|
-
constructor(parent) {
|
|
7
|
-
super(parent, "/api/v1/commands");
|
|
8
|
-
}
|
|
9
|
-
async isNamespaceAvailable(name) {
|
|
10
|
-
return this.get(`/namespaces/${name}/is_available`).then((response) => response.available);
|
|
11
|
-
}
|
|
12
|
-
async initSamples() {
|
|
13
|
-
return this.post("/onboarding/init-samples");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=CommandsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../src/CommandsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAIlE;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAY;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACjD,CAAC;CAEJ"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export default class EnvironmentsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/environments");
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* List all environments for the current project
|
|
8
|
-
* @param all if true, list all environments, otherwise only the ones for the current project
|
|
9
|
-
*/
|
|
10
|
-
list(all = false) {
|
|
11
|
-
const query = all ? { all: true } : undefined;
|
|
12
|
-
return this.get('/', { query });
|
|
13
|
-
}
|
|
14
|
-
create(payload) {
|
|
15
|
-
return this.post('/', {
|
|
16
|
-
payload
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
retrieve(id) {
|
|
20
|
-
return this.get('/' + id);
|
|
21
|
-
}
|
|
22
|
-
update(id, payload) {
|
|
23
|
-
return this.put('/' + id, {
|
|
24
|
-
payload
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* udpate enabled models and / or config. If enabled_models is not provided, the existing enabled models will not change.
|
|
29
|
-
* Same, if config is not provioded the exiting config is not changed.
|
|
30
|
-
* If the config is provided then it will be updated without removing fields that are not provided.
|
|
31
|
-
*
|
|
32
|
-
* @param id
|
|
33
|
-
* @param payload
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
updateConfig(id, payload) {
|
|
37
|
-
return this.put('/' + id + '/config', {
|
|
38
|
-
payload
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
listModels(id, payload) {
|
|
42
|
-
return this.get('/' + id + '/models', {
|
|
43
|
-
query: payload ? { ...payload } : undefined
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
listTrainableModels(id) {
|
|
47
|
-
return this.get(`/${id}/trainable-models`);
|
|
48
|
-
}
|
|
49
|
-
embeddings(id, payload) {
|
|
50
|
-
return this.post('/' + id + '/embeddings', {
|
|
51
|
-
payload
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=EnvironmentsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentsApi.js","sourceRoot":"","sources":["../../src/EnvironmentsApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,MAAe,KAAK;QACrB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,OAA0C;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAA0C;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE;YACtB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAU,EAAE,OAGxB;QACG,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA4B;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SAC9C,CAAC,CAAC;IACP,CAAC;IAED,mBAAmB,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC/C,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA2B;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,aAAa,EAAE;YACvC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ"}
|
package/lib/esm/IamApi.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export class IamApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/iam");
|
|
5
|
-
}
|
|
6
|
-
aces = new AcesApi(this);
|
|
7
|
-
roles = new RolesApi(this);
|
|
8
|
-
}
|
|
9
|
-
export class RolesApi extends ApiTopic {
|
|
10
|
-
constructor(parent) {
|
|
11
|
-
super(parent, "/roles");
|
|
12
|
-
}
|
|
13
|
-
list() {
|
|
14
|
-
return this.get('/');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export class AcesApi extends ApiTopic {
|
|
18
|
-
constructor(parent) {
|
|
19
|
-
super(parent, "/aces");
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get the list of all runs
|
|
23
|
-
* @param project optional project id to filter by
|
|
24
|
-
* @param interaction optional interaction id to filter by
|
|
25
|
-
* @returns InteractionResult[]
|
|
26
|
-
**/
|
|
27
|
-
list(options) {
|
|
28
|
-
return this.get('/', { query: { ...options } });
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get an ACE by its Id
|
|
32
|
-
* @param id
|
|
33
|
-
* @returns InteractionResult
|
|
34
|
-
**/
|
|
35
|
-
retrieve(id) {
|
|
36
|
-
return this.get('/' + id);
|
|
37
|
-
}
|
|
38
|
-
create(payload) {
|
|
39
|
-
return this.post('/', { payload });
|
|
40
|
-
}
|
|
41
|
-
delete(id) {
|
|
42
|
-
return this.del('/' + id);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=IamApi.js.map
|
package/lib/esm/IamApi.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IamApi.js","sourceRoot":"","sources":["../../src/IamApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAUlE,MAAM,OAAO,MAAO,SAAQ,QAAQ;IAEhC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,KAAK,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;CAC7B;AAED,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAElC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CAEJ;AAGD,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IAEjC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED;;;;;QAKI;IACJ,IAAI,CAAC,OAAyB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;;QAII;IACJ,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,OAAyB;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC7B,CAAC;CAEJ"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { VertesiaClient } from "./client.js";
|
|
2
|
-
import { executeInteraction } from "./execute.js";
|
|
3
|
-
export class InteractionBase {
|
|
4
|
-
id;
|
|
5
|
-
client;
|
|
6
|
-
constructor(id, clientOrOpts) {
|
|
7
|
-
this.id = id;
|
|
8
|
-
if (clientOrOpts instanceof VertesiaClient) {
|
|
9
|
-
this.client = clientOrOpts;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
this.client = new VertesiaClient(clientOrOpts);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
retrieve() {
|
|
16
|
-
return this.client.interactions.retrieve(this.id);
|
|
17
|
-
}
|
|
18
|
-
update(payload) {
|
|
19
|
-
return this.client.interactions.update(this.id, payload);
|
|
20
|
-
}
|
|
21
|
-
render(data) {
|
|
22
|
-
data;
|
|
23
|
-
//TODO
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
27
|
-
* the run completes or fails.
|
|
28
|
-
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
29
|
-
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
30
|
-
* When all chunks are received the fucntion will return the resolved promise
|
|
31
|
-
* @param id of the interaction to execute
|
|
32
|
-
* @param payload InteractionExecutionPayload
|
|
33
|
-
* @param onChunk callback to be called when the next chunk of the response is available
|
|
34
|
-
* @returns the resolved execution run as Promise<ExecutionRun>
|
|
35
|
-
*/
|
|
36
|
-
async execute(payload = {}, onChunk) {
|
|
37
|
-
return executeInteraction(this.client, this.id, payload, onChunk);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=InteractionBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionBase.js","sourceRoot":"","sources":["../../src/InteractionBase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,OAAO,eAAe;IAGL;IAFnB,MAAM,CAAiB;IAEvB,YAAmB,EAAU,EAAE,YAAkD;QAA9D,OAAE,GAAF,EAAE,CAAQ;QACzB,IAAI,YAAY,YAAY,cAAc,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,OAAiC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,IAAO;QACV,IAAI,CAAC;QACL,MAAM;IACV,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,CAAC,UAAuC,EAAE,EACnD,OAAiC;QACjC,OAAO,kBAAkB,CAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACJ"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, ServerError } from "@vertesia/api-fetch-client";
|
|
2
|
-
import { executeInteraction, executeInteractionAsync, executeInteractionByName } from "./execute.js";
|
|
3
|
-
export default class InteractionsApi extends ApiTopic {
|
|
4
|
-
constructor(parent) {
|
|
5
|
-
super(parent, "/api/v1/interactions");
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Get the list of all interactions in the current project
|
|
9
|
-
* @returns InteractionRef[]
|
|
10
|
-
**/
|
|
11
|
-
list(payload = {}) {
|
|
12
|
-
const query = payload.query || {};
|
|
13
|
-
return this.get("/", {
|
|
14
|
-
query: {
|
|
15
|
-
...query
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Find interractions given a mongo match query.
|
|
21
|
-
* You can also specify if prompts schemas are included in the result
|
|
22
|
-
*/
|
|
23
|
-
listEndpoints(payload) {
|
|
24
|
-
return this.post("/endpoints", {
|
|
25
|
-
payload
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* List all interaction versions in the project having the given endpoint name.
|
|
30
|
-
* This is useful to list orphaned versions
|
|
31
|
-
* @param name
|
|
32
|
-
*/
|
|
33
|
-
listVersionsByName(name) {
|
|
34
|
-
return this.get(`/versions/${name}`);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get the list of all interactions facets
|
|
38
|
-
* @param payload query payload to filter facet search
|
|
39
|
-
* @returns ComputeInteractionFacetsResponse[]
|
|
40
|
-
**/
|
|
41
|
-
computeFacets(query) {
|
|
42
|
-
return this.post("/facets", {
|
|
43
|
-
payload: query
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* List interaction names in the current project
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
listNames() {
|
|
51
|
-
return this.get('/names');
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Get the list of all interactions in the current project. Schemas will be returned too.
|
|
55
|
-
* @returns InteractionRefWithSchema[]
|
|
56
|
-
**/
|
|
57
|
-
export(payload) {
|
|
58
|
-
return this.post('/export', { payload });
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Create a new interaction
|
|
62
|
-
* @param payload InteractionCreatePayload
|
|
63
|
-
* @returns Interaction
|
|
64
|
-
* @throws ApiError
|
|
65
|
-
* @throws 400 if payload is invalid
|
|
66
|
-
* @throws 500 if interaction creation fails
|
|
67
|
-
**/
|
|
68
|
-
create(payload) {
|
|
69
|
-
return this.post('/', {
|
|
70
|
-
payload
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Retrieve an existing interaction definiton
|
|
75
|
-
* @param id of the interaction to retrieve
|
|
76
|
-
* @returns Interaction
|
|
77
|
-
**/
|
|
78
|
-
retrieve(id) {
|
|
79
|
-
return this.get(`/${id}`);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Update an existing interaction definiton
|
|
83
|
-
* @param id of the interaction to update
|
|
84
|
-
* @param payload InteractionUpdatePayload
|
|
85
|
-
* @returns Interaction
|
|
86
|
-
* @throws ApiError
|
|
87
|
-
* @throws 400 if payload is invalid
|
|
88
|
-
* @throws 500 if interaction update fails
|
|
89
|
-
* @throws 404 if interaction not found
|
|
90
|
-
**/
|
|
91
|
-
update(id, payload) {
|
|
92
|
-
return this.put(`/${id}`, {
|
|
93
|
-
payload
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
98
|
-
* the run completes or fails.
|
|
99
|
-
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
100
|
-
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
101
|
-
* When all chunks are received the fucntion will return the resolved promise
|
|
102
|
-
* @param id of the interaction to execute
|
|
103
|
-
* @param payload InteractionExecutionPayload
|
|
104
|
-
* @param onChunk callback to be called when the next chunk of the response is available
|
|
105
|
-
* @returns Promise<ExecutionRun>
|
|
106
|
-
* @throws ApiError
|
|
107
|
-
* @throws 404 if interaction not found
|
|
108
|
-
* @throws 400 if payload is invalid
|
|
109
|
-
* @throws 500 if interaction execution fails
|
|
110
|
-
* @throws 500 if interaction execution times out
|
|
111
|
-
**/
|
|
112
|
-
execute(id, payload = {}, onChunk) {
|
|
113
|
-
return executeInteraction(this.client, id, payload, onChunk).catch(err => {
|
|
114
|
-
if (err instanceof ServerError && err.payload?.id) {
|
|
115
|
-
throw err.updateDetails({ run_id: err.payload.id });
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
throw err;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Same as execute but uses the interaction name selector instead of the id.
|
|
124
|
-
*
|
|
125
|
-
* A name selector is the interaction endpoint name suffuxed with an optional tag or version wich is starting with a `@` character.
|
|
126
|
-
* The special `draft` tag is used to select the draft version of the interaction. If no tag or version is specified then the latest version is selected.
|
|
127
|
-
* Examples of selectors:
|
|
128
|
-
* - `ReviewContract` - select the latest version of the ReviewContract interaction
|
|
129
|
-
* - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
|
|
130
|
-
* - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
|
|
131
|
-
* - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
|
|
132
|
-
* @param nameWithTag
|
|
133
|
-
* @param payload
|
|
134
|
-
* @param onChunk
|
|
135
|
-
* @returns
|
|
136
|
-
*/
|
|
137
|
-
executeByName(nameWithTag, payload = {}, onChunk) {
|
|
138
|
-
return executeInteractionByName(this.client, nameWithTag, payload, onChunk).catch(err => {
|
|
139
|
-
if (err instanceof ServerError && err.payload?.id) {
|
|
140
|
-
throw err.updateDetails({ run_id: err.payload.id });
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
throw err;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Execute an interaction in an workflow
|
|
149
|
-
* @param payload
|
|
150
|
-
* @returns
|
|
151
|
-
*/
|
|
152
|
-
executeAsync(payload) {
|
|
153
|
-
return executeInteractionAsync(this.client, payload);
|
|
154
|
-
}
|
|
155
|
-
publish(id, payload) {
|
|
156
|
-
return this.post(`/${id}/publish`, {
|
|
157
|
-
payload
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
fork(id, payload) {
|
|
161
|
-
return this.post(`/${id}/fork`, {
|
|
162
|
-
payload
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Generate Composable definition of an interaction
|
|
167
|
-
**/
|
|
168
|
-
generateInteraction(id, payload) {
|
|
169
|
-
return this.post(`${id}/generate-interaction`, {
|
|
170
|
-
payload
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Generate Test Data for an interaction
|
|
175
|
-
**/
|
|
176
|
-
generateTestData(id, payload) {
|
|
177
|
-
return this.post(`${id}/generate-test-data`, {
|
|
178
|
-
payload
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Suggest Improvement for a prompt
|
|
183
|
-
*/
|
|
184
|
-
suggestImprovements(id, payload) {
|
|
185
|
-
return this.post(`${id}/suggest-prompt-improvements`, {
|
|
186
|
-
payload
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* List the versions of the interaction. Returns an empty array if no versions are found
|
|
191
|
-
* @param id
|
|
192
|
-
* @returns the versions list or an empty array if no versions are found
|
|
193
|
-
*/
|
|
194
|
-
listVersions(id) {
|
|
195
|
-
return this.get(`/${id}/versions`);
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* List the forks of the interaction. Returns an empty array if no forks are found
|
|
199
|
-
* @param id
|
|
200
|
-
* @returns the versions list or an empty array if no forks are found
|
|
201
|
-
*/
|
|
202
|
-
listForks(id) {
|
|
203
|
-
return this.get(`/${id}/forks`);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
//# sourceMappingURL=InteractionsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionsApi.js","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAYrG,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;QAGI;IACJ,IAAI,CAAC,UAAoC,EAAE;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAA4B,CAAC;QAE5D,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK,EAAE;gBACH,GAAG,KAAK;aACX;SACJ,CAAC,CAAC;IACP,CAAC;IACD;;;OAGG;IACH,aAAa,CAAC,OAAiC;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAC3B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;QAII;IACJ,aAAa,CAAC,KAAqC;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACxB,OAAO,EAAE,KAAK;SACjB,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,SAAS;QACL,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;QAGI;IACJ,MAAM,CAAC,OAAkC;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;QAOI;IACJ,MAAM,CAAC,OAAiC;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;QAII;IACJ,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;;;QASI;IACJ,MAAM,CAAC,EAAU,EAAE,OAAiC;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE;YACtB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;QAeI;IACJ,OAAO,CAAmB,EAAU,EAAE,UAAuC,EAAE,EAC3E,OAAiC;QACjC,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAwB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACvF,IAAI,GAAG,YAAY,WAAW,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;gBAChD,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACJ,MAAM,GAAG,CAAC;YACd,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAmB,WAAmB,EAAE,UAAuC,EAAE,EAC1F,OAAiC;QACjC,OAAO,wBAAwB,CAAC,IAAI,CAAC,MAAwB,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACtG,IAAI,GAAG,YAAY,WAAW,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;gBAChD,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACJ,MAAM,GAAG,CAAC;YACd,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,OAA8B;QACvC,OAAO,uBAAuB,CAAC,IAAI,CAAC,MAAwB,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,EAAU,EAAE,OAAkC;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE;YAC/B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,IAAI,CAAC,EAAU,EAAE,OAA+B;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE;YAC5B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;QAEI;IACJ,mBAAmB,CAAC,EAAU,EAAE,OAAmC;QAE/D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,EAAE;YAC3C,OAAO;SACV,CAAC,CAAC;IAEP,CAAC;IAED;;QAEI;IACJ,gBAAgB,CAAC,EAAU,EAAE,OAAgC;QAEzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,EAAE;YACzC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,EAAU,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,8BAA8B,EAAE;YAClD,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;CAEJ"}
|
package/lib/esm/ProjectsApi.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export default class ProjectsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/projects");
|
|
5
|
-
}
|
|
6
|
-
list(account) {
|
|
7
|
-
return this.get('/', { query: { account } });
|
|
8
|
-
}
|
|
9
|
-
retrieve(projectId) {
|
|
10
|
-
return this.get(`/${projectId}`);
|
|
11
|
-
}
|
|
12
|
-
create(payload) {
|
|
13
|
-
return this.post('/', {
|
|
14
|
-
payload
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
update(projectId, payload) {
|
|
18
|
-
return this.put(`/${projectId}`, {
|
|
19
|
-
payload
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
integrations = new IntegrationsConfigurationApi(this);
|
|
23
|
-
}
|
|
24
|
-
class IntegrationsConfigurationApi extends ApiTopic {
|
|
25
|
-
constructor(parent) {
|
|
26
|
-
super(parent, "/");
|
|
27
|
-
}
|
|
28
|
-
list(projectId) {
|
|
29
|
-
return this.get(`/${projectId}/integrations`).then(res => res.integrations);
|
|
30
|
-
}
|
|
31
|
-
retrieve(projectId, integrationId) {
|
|
32
|
-
return this.get(`/${projectId}/integrations/${integrationId}`).catch(err => {
|
|
33
|
-
if (err.status === 404) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
throw err;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
update(projectId, integrationId, payload) {
|
|
40
|
-
return this.put(`/${projectId}/integrations/${integrationId}`, {
|
|
41
|
-
payload
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=ProjectsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsApi.js","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAC7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,OAAkB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,OAA8B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,OAAyB;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,EAAE;YAC7B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,YAAY,GAAiC,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;CAEvF;AAED,MAAM,4BAA6B,SAAQ,QAAQ;IAE/C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,SAAiB;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAChF,CAAC;IAED,QAAQ,CAAC,SAAiB,EAAE,aAAoC;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,iBAAiB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACvE,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,MAAM,GAAG,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,aAAqB,EAAE,OAAY;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,iBAAiB,aAAa,EAAE,EAAE;YAC3D,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ"}
|
package/lib/esm/PromptsApi.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export default class PromptsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/prompts");
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Get the list of all prompt templates
|
|
8
|
-
* @param payload query payload to filter search
|
|
9
|
-
* @returns PromptTemplateRef[]
|
|
10
|
-
**/
|
|
11
|
-
list(payload = {}) {
|
|
12
|
-
const query = payload.query || {};
|
|
13
|
-
return this.get("/", {
|
|
14
|
-
query: {
|
|
15
|
-
...query
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the list of all prompt facets
|
|
21
|
-
* @param payload query payload to filter facet search
|
|
22
|
-
* @returns ComputePromptFacetsResponse[]
|
|
23
|
-
**/
|
|
24
|
-
computeFacets(query) {
|
|
25
|
-
return this.post("/facets", {
|
|
26
|
-
payload: query
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Create a new prompt template
|
|
31
|
-
* @param payload PromptTemplateCreatePayload
|
|
32
|
-
* @returns PromptTemplate
|
|
33
|
-
* @throws ApiError
|
|
34
|
-
* @throws 400 if payload is invalid
|
|
35
|
-
* @throws 500 if creation fails
|
|
36
|
-
**/
|
|
37
|
-
create(payload) {
|
|
38
|
-
return this.post('/', {
|
|
39
|
-
payload
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Retrieve an existing prompt template
|
|
44
|
-
* @param id of the prompt template to retrieve
|
|
45
|
-
* @returns PromptTemplate
|
|
46
|
-
**/
|
|
47
|
-
retrieve(id) {
|
|
48
|
-
return this.get(`/${id}`);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Update an existing prompt template
|
|
52
|
-
* @param id of the prompt template to update
|
|
53
|
-
* @param payload PromptTemplateCreatePayload
|
|
54
|
-
* @returns PromptTemplate
|
|
55
|
-
* @throws ApiError
|
|
56
|
-
* @throws 400 if payload is invalid
|
|
57
|
-
* @throws 500 if update fails
|
|
58
|
-
* @throws 404 if not found
|
|
59
|
-
**/
|
|
60
|
-
update(id, payload) {
|
|
61
|
-
return this.put(`/${id}`, {
|
|
62
|
-
payload
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Delete an existing prompt template
|
|
67
|
-
* @param id of the prompt template to delete
|
|
68
|
-
* @returns void
|
|
69
|
-
*/
|
|
70
|
-
delete(id) {
|
|
71
|
-
return this.del(`/${id}`);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Fork an existing prompt template
|
|
75
|
-
* @param id of the prompt template to fork
|
|
76
|
-
* @param payload PromptTemplateForkPayload
|
|
77
|
-
* @returns Forked PromptTemplate
|
|
78
|
-
*/
|
|
79
|
-
fork(id, payload) {
|
|
80
|
-
return this.post(`/${id}/fork`, {
|
|
81
|
-
payload
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Render a prompt template
|
|
86
|
-
* @param id of the prompt template to render
|
|
87
|
-
* @param payload that will be passed to the prompt template to generate the prompts
|
|
88
|
-
* @returns PromptTemplate
|
|
89
|
-
* @throws ApiError
|
|
90
|
-
* @throws 404 if not found
|
|
91
|
-
* @throws 400 if payload is invalid
|
|
92
|
-
* @throws 500 if render fails
|
|
93
|
-
**/
|
|
94
|
-
render(id, payload) {
|
|
95
|
-
return this.post(`/${id}/render`, {
|
|
96
|
-
payload
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Get options for a field
|
|
101
|
-
* @param field name to get options for
|
|
102
|
-
* @returns string[]
|
|
103
|
-
*/
|
|
104
|
-
options(field) {
|
|
105
|
-
return this.get(`/options/${field}`);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* List the versions of the prompt template. Returens an empty array if no versions are found
|
|
109
|
-
* @param id
|
|
110
|
-
* @returns the versions list or an empty array if no versions are found
|
|
111
|
-
*/
|
|
112
|
-
listVersions(id) {
|
|
113
|
-
return this.get(`/${id}/versions`);
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Retrieve list of interactions that use the prompt template
|
|
117
|
-
*/
|
|
118
|
-
listInteractions(id) {
|
|
119
|
-
return this.get(`/${id}/interactions`);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* List the forks of the prompt. Returns an empty array if no forks are found
|
|
123
|
-
* @param id of the prompt to search forks
|
|
124
|
-
* @returns the versions list or an empty array if no forks are found
|
|
125
|
-
*/
|
|
126
|
-
listForks(id) {
|
|
127
|
-
return this.get(`/${id}/forks`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=PromptsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PromptsApi.js","sourceRoot":"","sources":["../../src/PromptsApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAOlE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,QAAQ;IAC5C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED;;;;QAII;IACJ,IAAI,CAAC,UAA+B,EAAE;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAuB,CAAC;QAEvD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK,EAAE;gBACH,GAAG,KAAK;aACX;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;QAII;IACJ,aAAa,CAAC,KAAgC;QAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACxB,OAAO,EAAE,KAAK;SACjB,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;QAOI;IACJ,MAAM,CAAC,OAAoC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;QAII;IACJ,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;;;QASI;IACJ,MAAM,CAAC,EAAU,EAAE,OAAoC;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE;YACtB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,EAAU,EAAE,OAAkC;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE;YAC5B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;QASI;IACJ,MAAM,CAAC,EAAU,EAAE,OAAW;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE;YAC9B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,KAAa;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC;IAGD;;OAEG;IACH,gBAAgB,CAAC,EAAU;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;CAEJ"}
|
package/lib/esm/RefsApi.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
-
export class RefsApi extends ApiTopic {
|
|
3
|
-
constructor(parent) {
|
|
4
|
-
super(parent, "/api/v1/refs");
|
|
5
|
-
}
|
|
6
|
-
resolve(refs) {
|
|
7
|
-
return this.post('/resolve', { payload: { refs } });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=RefsApi.js.map
|
package/lib/esm/RefsApi.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefsApi.js","sourceRoot":"","sources":["../../src/RefsApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAA;AAGjE,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IAEjC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACjC,CAAC;IAGD,OAAO,CAAC,IAAqB;QAEzB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAEvD,CAAC;CAEJ"}
|