@vertesia/client 0.76.0 → 0.78.0-dev-9372725
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/package.json +59 -54
- package/src/AppsApi.ts +10 -1
- package/src/InteractionBase.ts +3 -3
- package/src/InteractionsApi.ts +19 -9
- package/src/RunsApi.ts +9 -2
- package/src/client.test.ts +2 -0
- package/src/client.ts +134 -56
- package/src/execute.ts +11 -5
- package/src/store/FilesApi.ts +2 -2
- package/src/store/ObjectsApi.ts +43 -13
- package/src/store/WorkflowsApi.ts +172 -4
- package/src/store/client.ts +8 -0
- package/lib/cjs/AccountApi.js +0 -85
- 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/AppsApi.js +0 -111
- package/lib/cjs/AppsApi.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/GroupsApi.js +0 -78
- package/lib/cjs/GroupsApi.js.map +0 -1
- package/lib/cjs/IamApi.js +0 -53
- 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 -263
- 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 -101
- 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 -147
- package/lib/cjs/store/FilesApi.js.map +0 -1
- package/lib/cjs/store/ObjectsApi.js +0 -264
- 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 -263
- 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 -82
- 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/AppsApi.js +0 -108
- package/lib/esm/AppsApi.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/GroupsApi.js +0 -74
- package/lib/esm/GroupsApi.js.map +0 -1
- package/lib/esm/IamApi.js +0 -47
- 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 -254
- 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 -97
- 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 -142
- package/lib/esm/store/FilesApi.js.map +0 -1
- package/lib/esm/store/ObjectsApi.js +0 -260
- 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 -257
- 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 -59
- 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/AppsApi.d.ts +0 -59
- package/lib/types/AppsApi.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/GroupsApi.d.ts +0 -65
- package/lib/types/GroupsApi.d.ts.map +0 -1
- package/lib/types/IamApi.d.ts +0 -41
- 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 -114
- 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 -8
- 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 -66
- 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 -47
- package/lib/types/store/FilesApi.d.ts.map +0 -1
- package/lib/types/store/ObjectsApi.d.ts +0 -118
- 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 -50
- 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/vertesia-client.js +0 -2
- package/lib/vertesia-client.js.map +0 -1
package/lib/cjs/CommandsApi.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
-
/**
|
|
5
|
-
* Various utility commands
|
|
6
|
-
*/
|
|
7
|
-
class CommandsApi extends api_fetch_client_1.ApiTopic {
|
|
8
|
-
constructor(parent) {
|
|
9
|
-
super(parent, "/api/v1/commands");
|
|
10
|
-
}
|
|
11
|
-
async isNamespaceAvailable(name) {
|
|
12
|
-
return this.get(`/namespaces/${name}/is_available`).then((response) => response.available);
|
|
13
|
-
}
|
|
14
|
-
async initSamples() {
|
|
15
|
-
return this.post("/onboarding/init-samples");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.default = CommandsApi;
|
|
19
|
-
//# sourceMappingURL=CommandsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../src/CommandsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAIlE;;GAEG;AAEH,MAAqB,WAAY,SAAQ,2BAAQ;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;AAdD,8BAcC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
-
class EnvironmentsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
-
constructor(parent) {
|
|
6
|
-
super(parent, "/api/v1/environments");
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* List all environments for the current project
|
|
10
|
-
* @param all if true, list all environments, otherwise only the ones for the current project
|
|
11
|
-
*/
|
|
12
|
-
list(all = false) {
|
|
13
|
-
const query = all ? { all: true } : undefined;
|
|
14
|
-
return this.get('/', { query });
|
|
15
|
-
}
|
|
16
|
-
create(payload) {
|
|
17
|
-
return this.post('/', {
|
|
18
|
-
payload
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
retrieve(id) {
|
|
22
|
-
return this.get('/' + id);
|
|
23
|
-
}
|
|
24
|
-
update(id, payload) {
|
|
25
|
-
return this.put('/' + id, {
|
|
26
|
-
payload
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Update enabled models and / or config. If enabled_models is not provided, the existing enabled models will not change.
|
|
31
|
-
* Same, if config is not provided the exiting config is not changed.
|
|
32
|
-
* If the config is provided then it will be updated without removing fields that are not provided.
|
|
33
|
-
*
|
|
34
|
-
* @param id
|
|
35
|
-
* @param payload
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
updateConfig(id, payload) {
|
|
39
|
-
return this.put('/' + id + '/config', {
|
|
40
|
-
payload
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
listModels(id, payload) {
|
|
44
|
-
return this.get('/' + id + '/models', {
|
|
45
|
-
query: payload ? { ...payload } : undefined
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
listTrainableModels(id) {
|
|
49
|
-
return this.get(`/${id}/trainable-models`);
|
|
50
|
-
}
|
|
51
|
-
embeddings(id, payload) {
|
|
52
|
-
return this.post('/' + id + '/embeddings', {
|
|
53
|
-
payload
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.default = EnvironmentsApi;
|
|
58
|
-
//# sourceMappingURL=EnvironmentsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentsApi.js","sourceRoot":"","sources":["../../src/EnvironmentsApi.ts"],"names":[],"mappings":";;AAEA,iEAAkE;AAElE,MAAqB,eAAgB,SAAQ,2BAAQ;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,I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exports.GroupsApi = void 0;
|
|
4
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
-
class GroupsApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
-
constructor(parent) {
|
|
7
|
-
super(parent, "/groups");
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* List all groups in the current account
|
|
11
|
-
* @param options Query options for filtering and pagination
|
|
12
|
-
* @returns Array of UserGroup objects
|
|
13
|
-
*/
|
|
14
|
-
list(options) {
|
|
15
|
-
return this.get('/', { query: options });
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Create a new group
|
|
19
|
-
* @param payload The group data to create
|
|
20
|
-
* @returns The created UserGroup object
|
|
21
|
-
*/
|
|
22
|
-
create(payload) {
|
|
23
|
-
return this.post('/', { payload });
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Retrieve a specific group by ID
|
|
27
|
-
* @param groupId The ID of the group to retrieve
|
|
28
|
-
* @returns The UserGroup object
|
|
29
|
-
*/
|
|
30
|
-
retrieve(groupId) {
|
|
31
|
-
return this.get('/' + groupId);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Update a group
|
|
35
|
-
* @param groupId The ID of the group to update
|
|
36
|
-
* @param payload The group data to update
|
|
37
|
-
* @returns The updated UserGroup object
|
|
38
|
-
*/
|
|
39
|
-
update(groupId, payload) {
|
|
40
|
-
return this.put('/' + groupId, { payload });
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Delete a group
|
|
44
|
-
* @param groupId The ID of the group to delete
|
|
45
|
-
* @returns Object with the deleted group ID
|
|
46
|
-
*/
|
|
47
|
-
delete(groupId) {
|
|
48
|
-
return this.del('/' + groupId);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* List members of a group
|
|
52
|
-
* @param groupId The ID of the group
|
|
53
|
-
* @returns Array of UserRef objects representing group members
|
|
54
|
-
*/
|
|
55
|
-
listMembers(groupId) {
|
|
56
|
-
return this.get('/' + groupId + '/members');
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Add a member to a group
|
|
60
|
-
* @param groupId The ID of the group
|
|
61
|
-
* @param userId The ID of the user to add
|
|
62
|
-
* @returns The updated UserGroup object
|
|
63
|
-
*/
|
|
64
|
-
addMember(groupId, userId) {
|
|
65
|
-
return this.post('/' + groupId + '/members/' + userId);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Remove a member from a group
|
|
69
|
-
* @param groupId The ID of the group
|
|
70
|
-
* @param userId The ID of the user to remove
|
|
71
|
-
* @returns The updated UserGroup object
|
|
72
|
-
*/
|
|
73
|
-
removeMember(groupId, userId) {
|
|
74
|
-
return this.del('/' + groupId + '/members/' + userId);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.GroupsApi = GroupsApi;
|
|
78
|
-
//# sourceMappingURL=GroupsApi.js.map
|
package/lib/cjs/GroupsApi.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsApi.js","sourceRoot":"","sources":["../../src/GroupsApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAUlE,MAAa,SAAU,SAAQ,2BAAQ;IAEnC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,OAA4B;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAA2B;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAe,EAAE,OAA2B;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAe;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,OAAe;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAe,EAAE,MAAc;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,OAAe,EAAE,MAAc;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;IAC1D,CAAC;CACJ;AAhFD,8BAgFC"}
|
package/lib/cjs/IamApi.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AcesApi = exports.RolesApi = exports.IamApi = void 0;
|
|
4
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
-
const GroupsApi_js_1 = require("./GroupsApi.js");
|
|
6
|
-
class IamApi extends api_fetch_client_1.ApiTopic {
|
|
7
|
-
constructor(parent) {
|
|
8
|
-
super(parent, "/api/v1/iam");
|
|
9
|
-
}
|
|
10
|
-
aces = new AcesApi(this);
|
|
11
|
-
roles = new RolesApi(this);
|
|
12
|
-
groups = new GroupsApi_js_1.GroupsApi(this);
|
|
13
|
-
}
|
|
14
|
-
exports.IamApi = IamApi;
|
|
15
|
-
class RolesApi extends api_fetch_client_1.ApiTopic {
|
|
16
|
-
constructor(parent) {
|
|
17
|
-
super(parent, "/roles");
|
|
18
|
-
}
|
|
19
|
-
list() {
|
|
20
|
-
return this.get('/');
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.RolesApi = RolesApi;
|
|
24
|
-
class AcesApi extends api_fetch_client_1.ApiTopic {
|
|
25
|
-
constructor(parent) {
|
|
26
|
-
super(parent, "/aces");
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get the list of all runs
|
|
30
|
-
* @param project optional project id to filter by
|
|
31
|
-
* @param interaction optional interaction id to filter by
|
|
32
|
-
* @returns InteractionResult[]
|
|
33
|
-
**/
|
|
34
|
-
list(options) {
|
|
35
|
-
return this.get('/', { query: { ...options } });
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get an ACE by its Id
|
|
39
|
-
* @param id
|
|
40
|
-
* @returns InteractionResult
|
|
41
|
-
**/
|
|
42
|
-
retrieve(id) {
|
|
43
|
-
return this.get('/' + id);
|
|
44
|
-
}
|
|
45
|
-
create(payload) {
|
|
46
|
-
return this.post('/', { payload });
|
|
47
|
-
}
|
|
48
|
-
delete(id) {
|
|
49
|
-
return this.del('/' + id);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.AcesApi = AcesApi;
|
|
53
|
-
//# sourceMappingURL=IamApi.js.map
|
package/lib/cjs/IamApi.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IamApi.js","sourceRoot":"","sources":["../../src/IamApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAClE,iDAA2C;AAU3C,MAAa,MAAO,SAAQ,2BAAQ;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;IAC1B,MAAM,GAAG,IAAI,wBAAS,CAAC,IAAI,CAAC,CAAA;CAC/B;AATD,wBASC;AAED,MAAa,QAAS,SAAQ,2BAAQ;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;AAVD,4BAUC;AAGD,MAAa,OAAQ,SAAQ,2BAAQ;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;AAjCD,0BAiCC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InteractionBase = void 0;
|
|
4
|
-
const client_js_1 = require("./client.js");
|
|
5
|
-
const execute_js_1 = require("./execute.js");
|
|
6
|
-
class InteractionBase {
|
|
7
|
-
id;
|
|
8
|
-
client;
|
|
9
|
-
constructor(id, clientOrOpts) {
|
|
10
|
-
this.id = id;
|
|
11
|
-
if (clientOrOpts instanceof client_js_1.VertesiaClient) {
|
|
12
|
-
this.client = clientOrOpts;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
this.client = new client_js_1.VertesiaClient(clientOrOpts);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
retrieve() {
|
|
19
|
-
return this.client.interactions.retrieve(this.id);
|
|
20
|
-
}
|
|
21
|
-
update(payload) {
|
|
22
|
-
return this.client.interactions.update(this.id, payload);
|
|
23
|
-
}
|
|
24
|
-
render(data) {
|
|
25
|
-
data;
|
|
26
|
-
//TODO
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
30
|
-
* the run completes or fails.
|
|
31
|
-
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
32
|
-
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
33
|
-
* When all chunks are received the function will return the resolved promise
|
|
34
|
-
* @param id of the interaction to execute
|
|
35
|
-
* @param payload InteractionExecutionPayload
|
|
36
|
-
* @param onChunk callback to be called when the next chunk of the response is available
|
|
37
|
-
* @returns the resolved execution run as Promise<ExecutionRun>
|
|
38
|
-
*/
|
|
39
|
-
async execute(payload = {}, onChunk) {
|
|
40
|
-
return (0, execute_js_1.executeInteraction)(this.client, this.id, payload, onChunk);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.InteractionBase = InteractionBase;
|
|
44
|
-
//# sourceMappingURL=InteractionBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionBase.js","sourceRoot":"","sources":["../../src/InteractionBase.ts"],"names":[],"mappings":";;;AACA,2CAAkE;AAClE,6CAAkD;AAElD,MAAa,eAAe;IAGL;IAFnB,MAAM,CAAiB;IAEvB,YAAmB,EAAU,EAAE,YAAkD;QAA9D,OAAE,GAAF,EAAE,CAAQ;QACzB,IAAI,YAAY,YAAY,0BAAc,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAc,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,IAAA,+BAAkB,EAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACJ;AAvCD,0CAuCC"}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
-
const execute_js_1 = require("./execute.js");
|
|
5
|
-
class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
-
constructor(parent) {
|
|
7
|
-
super(parent, "/api/v1/interactions");
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Get the list of all interactions in the current project
|
|
11
|
-
* @returns InteractionRef[]
|
|
12
|
-
**/
|
|
13
|
-
list(payload = {}) {
|
|
14
|
-
const query = payload.query || {};
|
|
15
|
-
return this.get("/", {
|
|
16
|
-
query: {
|
|
17
|
-
...query
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Find interactions given a mongo match query.
|
|
23
|
-
* You can also specify if prompts schemas are included in the result
|
|
24
|
-
*/
|
|
25
|
-
listEndpoints(payload) {
|
|
26
|
-
return this.post("/endpoints", {
|
|
27
|
-
payload
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* List all interaction versions in the project having the given endpoint name.
|
|
32
|
-
* This is useful to list orphaned versions
|
|
33
|
-
* @param name
|
|
34
|
-
*/
|
|
35
|
-
listVersionsByName(name) {
|
|
36
|
-
return this.get(`/versions/${name}`);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get the list of all interactions facets
|
|
40
|
-
* @param payload query payload to filter facet search
|
|
41
|
-
* @returns ComputeInteractionFacetsResponse[]
|
|
42
|
-
**/
|
|
43
|
-
computeFacets(query) {
|
|
44
|
-
return this.post("/facets", {
|
|
45
|
-
payload: query
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* List interaction names in the current project
|
|
50
|
-
* @returns
|
|
51
|
-
*/
|
|
52
|
-
listNames() {
|
|
53
|
-
return this.get('/names');
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Get the list of all interactions in the current project. Schemas will be returned too.
|
|
57
|
-
* @returns InteractionRefWithSchema[]
|
|
58
|
-
**/
|
|
59
|
-
export(payload) {
|
|
60
|
-
return this.post('/export', { payload });
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Create a new interaction
|
|
64
|
-
* @param payload InteractionCreatePayload
|
|
65
|
-
* @returns Interaction
|
|
66
|
-
* @throws ApiError
|
|
67
|
-
* @throws 400 if payload is invalid
|
|
68
|
-
* @throws 500 if interaction creation fails
|
|
69
|
-
**/
|
|
70
|
-
create(payload) {
|
|
71
|
-
return this.post('/', {
|
|
72
|
-
payload
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Retrieve an existing interaction definition
|
|
77
|
-
* @param id of the interaction to retrieve
|
|
78
|
-
* @returns Interaction
|
|
79
|
-
**/
|
|
80
|
-
retrieve(id) {
|
|
81
|
-
return this.get(`/${id}`);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Update an existing interaction definition
|
|
85
|
-
* @param id of the interaction to update
|
|
86
|
-
* @param payload InteractionUpdatePayload
|
|
87
|
-
* @returns Interaction
|
|
88
|
-
* @throws ApiError
|
|
89
|
-
* @throws 400 if payload is invalid
|
|
90
|
-
* @throws 500 if interaction update fails
|
|
91
|
-
* @throws 404 if interaction not found
|
|
92
|
-
**/
|
|
93
|
-
update(id, payload) {
|
|
94
|
-
return this.put(`/${id}`, {
|
|
95
|
-
payload
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
100
|
-
* the run completes or fails.
|
|
101
|
-
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
102
|
-
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
103
|
-
* When all chunks are received the function will return the resolved promise
|
|
104
|
-
* @param id of the interaction to execute
|
|
105
|
-
* @param payload InteractionExecutionPayload
|
|
106
|
-
* @param onChunk callback to be called when the next chunk of the response is available
|
|
107
|
-
* @returns Promise<ExecutionRun>
|
|
108
|
-
* @throws ApiError
|
|
109
|
-
* @throws 404 if interaction not found
|
|
110
|
-
* @throws 400 if payload is invalid
|
|
111
|
-
* @throws 500 if interaction execution fails
|
|
112
|
-
* @throws 500 if interaction execution times out
|
|
113
|
-
**/
|
|
114
|
-
execute(id, payload = {}, onChunk) {
|
|
115
|
-
return (0, execute_js_1.executeInteraction)(this.client, id, payload, onChunk).catch(err => {
|
|
116
|
-
if (err instanceof api_fetch_client_1.ServerError && err.payload?.id) {
|
|
117
|
-
throw err.updateDetails({ run_id: err.payload.id });
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
throw err;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Same as execute but uses the interaction name selector instead of the id.
|
|
126
|
-
*
|
|
127
|
-
* A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
|
|
128
|
-
* 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.
|
|
129
|
-
* Examples of selectors:
|
|
130
|
-
* - `ReviewContract` - select the latest version of the ReviewContract interaction
|
|
131
|
-
* - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
|
|
132
|
-
* - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
|
|
133
|
-
* - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
|
|
134
|
-
* @param nameWithTag
|
|
135
|
-
* @param payload
|
|
136
|
-
* @param onChunk
|
|
137
|
-
* @returns
|
|
138
|
-
*/
|
|
139
|
-
executeByName(nameWithTag, payload = {}, onChunk) {
|
|
140
|
-
return (0, execute_js_1.executeInteractionByName)(this.client, nameWithTag, payload, onChunk).catch(err => {
|
|
141
|
-
if (err instanceof api_fetch_client_1.ServerError && err.payload?.id) {
|
|
142
|
-
throw err.updateDetails({ run_id: err.payload.id });
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
throw err;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Execute an interaction in an workflow
|
|
151
|
-
* @param payload
|
|
152
|
-
* @returns
|
|
153
|
-
*/
|
|
154
|
-
executeAsync(payload) {
|
|
155
|
-
return (0, execute_js_1.executeInteractionAsync)(this.client, payload);
|
|
156
|
-
}
|
|
157
|
-
publish(id, payload) {
|
|
158
|
-
return this.post(`/${id}/publish`, {
|
|
159
|
-
payload
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
fork(id, payload) {
|
|
163
|
-
return this.post(`/${id}/fork`, {
|
|
164
|
-
payload
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Generate Composable definition of an interaction
|
|
169
|
-
**/
|
|
170
|
-
generateInteraction(id, payload) {
|
|
171
|
-
return this.post(`${id}/generate-interaction`, {
|
|
172
|
-
payload
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Generate Test Data for an interaction
|
|
177
|
-
**/
|
|
178
|
-
generateTestData(id, payload) {
|
|
179
|
-
return this.post(`${id}/generate-test-data`, {
|
|
180
|
-
payload
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Suggest Improvement for a prompt
|
|
185
|
-
*/
|
|
186
|
-
suggestImprovements(id, payload) {
|
|
187
|
-
return this.post(`${id}/suggest-prompt-improvements`, {
|
|
188
|
-
payload
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* List the versions of the interaction. Returns an empty array if no versions are found
|
|
193
|
-
* @param id
|
|
194
|
-
* @returns the versions list or an empty array if no versions are found
|
|
195
|
-
*/
|
|
196
|
-
listVersions(id) {
|
|
197
|
-
return this.get(`/${id}/versions`);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* List the forks of the interaction. Returns an empty array if no forks are found
|
|
201
|
-
* @param id
|
|
202
|
-
* @returns the versions list or an empty array if no forks are found
|
|
203
|
-
*/
|
|
204
|
-
listForks(id) {
|
|
205
|
-
return this.get(`/${id}/forks`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
exports.default = InteractionsApi;
|
|
209
|
-
//# sourceMappingURL=InteractionsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionsApi.js","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":";;AAAA,iEAA+E;AAG/E,6CAAqG;AAYrG,MAAqB,eAAgB,SAAQ,2BAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,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AAU,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;AAjOD,kCAiOC"}
|
package/lib/cjs/ProjectsApi.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
-
class ProjectsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
-
constructor(parent) {
|
|
6
|
-
super(parent, "/api/v1/projects");
|
|
7
|
-
}
|
|
8
|
-
list(account) {
|
|
9
|
-
return this.get('/', { query: { account } });
|
|
10
|
-
}
|
|
11
|
-
retrieve(projectId) {
|
|
12
|
-
return this.get(`/${projectId}`);
|
|
13
|
-
}
|
|
14
|
-
create(payload) {
|
|
15
|
-
return this.post('/', {
|
|
16
|
-
payload
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
update(projectId, payload) {
|
|
20
|
-
return this.put(`/${projectId}`, {
|
|
21
|
-
payload
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
integrations = new IntegrationsConfigurationApi(this);
|
|
25
|
-
}
|
|
26
|
-
exports.default = ProjectsApi;
|
|
27
|
-
class IntegrationsConfigurationApi extends api_fetch_client_1.ApiTopic {
|
|
28
|
-
constructor(parent) {
|
|
29
|
-
super(parent, "/");
|
|
30
|
-
}
|
|
31
|
-
list(projectId) {
|
|
32
|
-
return this.get(`/${projectId}/integrations`).then(res => res.integrations);
|
|
33
|
-
}
|
|
34
|
-
retrieve(projectId, integrationId) {
|
|
35
|
-
return this.get(`/${projectId}/integrations/${integrationId}`).catch(err => {
|
|
36
|
-
if (err.status === 404) {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
throw err;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
update(projectId, integrationId, payload) {
|
|
43
|
-
return this.put(`/${projectId}/integrations/${integrationId}`, {
|
|
44
|
-
payload
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=ProjectsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsApi.js","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAGlE,MAAqB,WAAY,SAAQ,2BAAQ;IAC7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,OAAkB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,E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AAC,CAAC;IACP,CAAC;CAEJ"}
|
package/lib/cjs/PromptsApi.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
-
class PromptsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
-
constructor(parent) {
|
|
6
|
-
super(parent, "/api/v1/prompts");
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Get the list of all prompt templates
|
|
10
|
-
* @param payload query payload to filter search
|
|
11
|
-
* @returns PromptTemplateRef[]
|
|
12
|
-
**/
|
|
13
|
-
list(payload = {}) {
|
|
14
|
-
const query = payload.query || {};
|
|
15
|
-
return this.get("/", {
|
|
16
|
-
query: {
|
|
17
|
-
...query
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get the list of all prompt facets
|
|
23
|
-
* @param payload query payload to filter facet search
|
|
24
|
-
* @returns ComputePromptFacetsResponse[]
|
|
25
|
-
**/
|
|
26
|
-
computeFacets(query) {
|
|
27
|
-
return this.post("/facets", {
|
|
28
|
-
payload: query
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create a new prompt template
|
|
33
|
-
* @param payload PromptTemplateCreatePayload
|
|
34
|
-
* @returns PromptTemplate
|
|
35
|
-
* @throws ApiError
|
|
36
|
-
* @throws 400 if payload is invalid
|
|
37
|
-
* @throws 500 if creation fails
|
|
38
|
-
**/
|
|
39
|
-
create(payload) {
|
|
40
|
-
return this.post('/', {
|
|
41
|
-
payload
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Retrieve an existing prompt template
|
|
46
|
-
* @param id of the prompt template to retrieve
|
|
47
|
-
* @returns PromptTemplate
|
|
48
|
-
**/
|
|
49
|
-
retrieve(id) {
|
|
50
|
-
return this.get(`/${id}`);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Update an existing prompt template
|
|
54
|
-
* @param id of the prompt template to update
|
|
55
|
-
* @param payload PromptTemplateCreatePayload
|
|
56
|
-
* @returns PromptTemplate
|
|
57
|
-
* @throws ApiError
|
|
58
|
-
* @throws 400 if payload is invalid
|
|
59
|
-
* @throws 500 if update fails
|
|
60
|
-
* @throws 404 if not found
|
|
61
|
-
**/
|
|
62
|
-
update(id, payload) {
|
|
63
|
-
return this.put(`/${id}`, {
|
|
64
|
-
payload
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Delete an existing prompt template
|
|
69
|
-
* @param id of the prompt template to delete
|
|
70
|
-
* @returns void
|
|
71
|
-
*/
|
|
72
|
-
delete(id) {
|
|
73
|
-
return this.del(`/${id}`);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Fork an existing prompt template
|
|
77
|
-
* @param id of the prompt template to fork
|
|
78
|
-
* @param payload PromptTemplateForkPayload
|
|
79
|
-
* @returns Forked PromptTemplate
|
|
80
|
-
*/
|
|
81
|
-
fork(id, payload) {
|
|
82
|
-
return this.post(`/${id}/fork`, {
|
|
83
|
-
payload
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Render a prompt template
|
|
88
|
-
* @param id of the prompt template to render
|
|
89
|
-
* @param payload that will be passed to the prompt template to generate the prompts
|
|
90
|
-
* @returns PromptTemplate
|
|
91
|
-
* @throws ApiError
|
|
92
|
-
* @throws 404 if not found
|
|
93
|
-
* @throws 400 if payload is invalid
|
|
94
|
-
* @throws 500 if render fails
|
|
95
|
-
**/
|
|
96
|
-
render(id, payload) {
|
|
97
|
-
return this.post(`/${id}/render`, {
|
|
98
|
-
payload
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Get options for a field
|
|
103
|
-
* @param field name to get options for
|
|
104
|
-
* @returns string[]
|
|
105
|
-
*/
|
|
106
|
-
options(field) {
|
|
107
|
-
return this.get(`/options/${field}`);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* List the versions of the prompt template. Returns an empty array if no versions are found
|
|
111
|
-
* @param id
|
|
112
|
-
* @returns the versions list or an empty array if no versions are found
|
|
113
|
-
*/
|
|
114
|
-
listVersions(id) {
|
|
115
|
-
return this.get(`/${id}/versions`);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Retrieve list of interactions that use the prompt template
|
|
119
|
-
*/
|
|
120
|
-
listInteractions(id) {
|
|
121
|
-
return this.get(`/${id}/interactions`);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* List the forks of the prompt. Returns an empty array if no forks are found
|
|
125
|
-
* @param id of the prompt to search forks
|
|
126
|
-
* @returns the versions list or an empty array if no forks are found
|
|
127
|
-
*/
|
|
128
|
-
listForks(id) {
|
|
129
|
-
return this.get(`/${id}/forks`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
exports.default = PromptsApi;
|
|
133
|
-
//# sourceMappingURL=PromptsApi.js.map
|