@vertesia/client 0.24.0-dev.202601221707
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 +13 -0
- package/README.md +110 -0
- package/lib/cjs/AccountApi.js +85 -0
- package/lib/cjs/AccountApi.js.map +1 -0
- package/lib/cjs/AccountsApi.js +16 -0
- package/lib/cjs/AccountsApi.js.map +1 -0
- package/lib/cjs/AnalyticsApi.js +41 -0
- package/lib/cjs/AnalyticsApi.js.map +1 -0
- package/lib/cjs/ApiKeysApi.js +63 -0
- package/lib/cjs/ApiKeysApi.js.map +1 -0
- package/lib/cjs/AppsApi.js +119 -0
- package/lib/cjs/AppsApi.js.map +1 -0
- package/lib/cjs/CommandsApi.js +19 -0
- package/lib/cjs/CommandsApi.js.map +1 -0
- package/lib/cjs/EnvironmentsApi.js +72 -0
- package/lib/cjs/EnvironmentsApi.js.map +1 -0
- package/lib/cjs/GroupsApi.js +78 -0
- package/lib/cjs/GroupsApi.js.map +1 -0
- package/lib/cjs/IamApi.js +53 -0
- package/lib/cjs/IamApi.js.map +1 -0
- package/lib/cjs/InteractionBase.js +44 -0
- package/lib/cjs/InteractionBase.js.map +1 -0
- package/lib/cjs/InteractionCatalogApi.js +64 -0
- package/lib/cjs/InteractionCatalogApi.js.map +1 -0
- package/lib/cjs/InteractionOutput.js +300 -0
- package/lib/cjs/InteractionOutput.js.map +1 -0
- package/lib/cjs/InteractionResult.example.js +57 -0
- package/lib/cjs/InteractionResult.example.js.map +1 -0
- package/lib/cjs/InteractionsApi.js +262 -0
- package/lib/cjs/InteractionsApi.js.map +1 -0
- package/lib/cjs/MCPOAuthApi.js +62 -0
- package/lib/cjs/MCPOAuthApi.js.map +1 -0
- package/lib/cjs/ProjectsApi.js +72 -0
- package/lib/cjs/ProjectsApi.js.map +1 -0
- package/lib/cjs/PromptsApi.js +133 -0
- package/lib/cjs/PromptsApi.js.map +1 -0
- package/lib/cjs/RefsApi.js +14 -0
- package/lib/cjs/RefsApi.js.map +1 -0
- package/lib/cjs/RunsApi.js +113 -0
- package/lib/cjs/RunsApi.js.map +1 -0
- package/lib/cjs/SkillsApi.js +39 -0
- package/lib/cjs/SkillsApi.js.map +1 -0
- package/lib/cjs/StreamSource.js +17 -0
- package/lib/cjs/StreamSource.js.map +1 -0
- package/lib/cjs/TrainingApi.js +54 -0
- package/lib/cjs/TrainingApi.js.map +1 -0
- package/lib/cjs/UsersApi.js +13 -0
- package/lib/cjs/UsersApi.js.map +1 -0
- package/lib/cjs/client.js +360 -0
- package/lib/cjs/client.js.map +1 -0
- package/lib/cjs/execute.js +158 -0
- package/lib/cjs/execute.js.map +1 -0
- package/lib/cjs/index.js +22 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
- package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/cjs/nodejs/index.js +18 -0
- package/lib/cjs/nodejs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/store/AnalyzeDocApi.js +56 -0
- package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
- package/lib/cjs/store/CollectionsApi.js +131 -0
- package/lib/cjs/store/CollectionsApi.js.map +1 -0
- package/lib/cjs/store/CommandsApi.js +17 -0
- package/lib/cjs/store/CommandsApi.js.map +1 -0
- package/lib/cjs/store/DashboardApi.js +182 -0
- package/lib/cjs/store/DashboardApi.js.map +1 -0
- package/lib/cjs/store/DataApi.js +433 -0
- package/lib/cjs/store/DataApi.js.map +1 -0
- package/lib/cjs/store/EmailApi.js +103 -0
- package/lib/cjs/store/EmailApi.js.map +1 -0
- package/lib/cjs/store/EmbeddingsApi.js +29 -0
- package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
- package/lib/cjs/store/FilesApi.js +237 -0
- package/lib/cjs/store/FilesApi.js.map +1 -0
- package/lib/cjs/store/ObjectsApi.js +314 -0
- package/lib/cjs/store/ObjectsApi.js.map +1 -0
- package/lib/cjs/store/PendingAsksApi.js +43 -0
- package/lib/cjs/store/PendingAsksApi.js.map +1 -0
- package/lib/cjs/store/SchedulesApi.js +103 -0
- package/lib/cjs/store/SchedulesApi.js.map +1 -0
- package/lib/cjs/store/ToolsApi.js +21 -0
- package/lib/cjs/store/ToolsApi.js.map +1 -0
- package/lib/cjs/store/TypesApi.js +57 -0
- package/lib/cjs/store/TypesApi.js.map +1 -0
- package/lib/cjs/store/WorkersApi.js +16 -0
- package/lib/cjs/store/WorkersApi.js.map +1 -0
- package/lib/cjs/store/WorkflowsApi.js +596 -0
- package/lib/cjs/store/WorkflowsApi.js.map +1 -0
- package/lib/cjs/store/client.js +81 -0
- package/lib/cjs/store/client.js.map +1 -0
- package/lib/cjs/store/errors.js +11 -0
- package/lib/cjs/store/errors.js.map +1 -0
- package/lib/cjs/store/index.js +27 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/version.js +6 -0
- package/lib/cjs/store/version.js.map +1 -0
- package/lib/esm/AccountApi.js +82 -0
- package/lib/esm/AccountApi.js.map +1 -0
- package/lib/esm/AccountsApi.js +13 -0
- package/lib/esm/AccountsApi.js.map +1 -0
- package/lib/esm/AnalyticsApi.js +38 -0
- package/lib/esm/AnalyticsApi.js.map +1 -0
- package/lib/esm/ApiKeysApi.js +59 -0
- package/lib/esm/ApiKeysApi.js.map +1 -0
- package/lib/esm/AppsApi.js +116 -0
- package/lib/esm/AppsApi.js.map +1 -0
- package/lib/esm/CommandsApi.js +16 -0
- package/lib/esm/CommandsApi.js.map +1 -0
- package/lib/esm/EnvironmentsApi.js +69 -0
- package/lib/esm/EnvironmentsApi.js.map +1 -0
- package/lib/esm/GroupsApi.js +74 -0
- package/lib/esm/GroupsApi.js.map +1 -0
- package/lib/esm/IamApi.js +47 -0
- package/lib/esm/IamApi.js.map +1 -0
- package/lib/esm/InteractionBase.js +40 -0
- package/lib/esm/InteractionBase.js.map +1 -0
- package/lib/esm/InteractionCatalogApi.js +60 -0
- package/lib/esm/InteractionCatalogApi.js.map +1 -0
- package/lib/esm/InteractionOutput.js +293 -0
- package/lib/esm/InteractionOutput.js.map +1 -0
- package/lib/esm/InteractionResult.example.js +55 -0
- package/lib/esm/InteractionResult.example.js.map +1 -0
- package/lib/esm/InteractionsApi.js +259 -0
- package/lib/esm/InteractionsApi.js.map +1 -0
- package/lib/esm/MCPOAuthApi.js +59 -0
- package/lib/esm/MCPOAuthApi.js.map +1 -0
- package/lib/esm/ProjectsApi.js +69 -0
- package/lib/esm/ProjectsApi.js.map +1 -0
- package/lib/esm/PromptsApi.js +130 -0
- package/lib/esm/PromptsApi.js.map +1 -0
- package/lib/esm/RefsApi.js +10 -0
- package/lib/esm/RefsApi.js.map +1 -0
- package/lib/esm/RunsApi.js +109 -0
- package/lib/esm/RunsApi.js.map +1 -0
- package/lib/esm/SkillsApi.js +36 -0
- package/lib/esm/SkillsApi.js.map +1 -0
- package/lib/esm/StreamSource.js +13 -0
- package/lib/esm/StreamSource.js.map +1 -0
- package/lib/esm/TrainingApi.js +51 -0
- package/lib/esm/TrainingApi.js.map +1 -0
- package/lib/esm/UsersApi.js +10 -0
- package/lib/esm/UsersApi.js.map +1 -0
- package/lib/esm/client.js +351 -0
- package/lib/esm/client.js.map +1 -0
- package/lib/esm/execute.js +118 -0
- package/lib/esm/execute.js.map +1 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/nodejs/NodeStreamSource.js +41 -0
- package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/esm/nodejs/index.js +2 -0
- package/lib/esm/nodejs/index.js.map +1 -0
- package/lib/esm/store/AnalyzeDocApi.js +52 -0
- package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
- package/lib/esm/store/CollectionsApi.js +127 -0
- package/lib/esm/store/CollectionsApi.js.map +1 -0
- package/lib/esm/store/CommandsApi.js +13 -0
- package/lib/esm/store/CommandsApi.js.map +1 -0
- package/lib/esm/store/DashboardApi.js +178 -0
- package/lib/esm/store/DashboardApi.js.map +1 -0
- package/lib/esm/store/DataApi.js +429 -0
- package/lib/esm/store/DataApi.js.map +1 -0
- package/lib/esm/store/EmailApi.js +99 -0
- package/lib/esm/store/EmailApi.js.map +1 -0
- package/lib/esm/store/EmbeddingsApi.js +25 -0
- package/lib/esm/store/EmbeddingsApi.js.map +1 -0
- package/lib/esm/store/FilesApi.js +231 -0
- package/lib/esm/store/FilesApi.js.map +1 -0
- package/lib/esm/store/ObjectsApi.js +309 -0
- package/lib/esm/store/ObjectsApi.js.map +1 -0
- package/lib/esm/store/PendingAsksApi.js +39 -0
- package/lib/esm/store/PendingAsksApi.js.map +1 -0
- package/lib/esm/store/SchedulesApi.js +99 -0
- package/lib/esm/store/SchedulesApi.js.map +1 -0
- package/lib/esm/store/ToolsApi.js +17 -0
- package/lib/esm/store/ToolsApi.js.map +1 -0
- package/lib/esm/store/TypesApi.js +53 -0
- package/lib/esm/store/TypesApi.js.map +1 -0
- package/lib/esm/store/WorkersApi.js +12 -0
- package/lib/esm/store/WorkersApi.js.map +1 -0
- package/lib/esm/store/WorkflowsApi.js +590 -0
- package/lib/esm/store/WorkflowsApi.js.map +1 -0
- package/lib/esm/store/client.js +77 -0
- package/lib/esm/store/client.js.map +1 -0
- package/lib/esm/store/errors.js +7 -0
- package/lib/esm/store/errors.js.map +1 -0
- package/lib/esm/store/index.js +11 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/version.js +3 -0
- package/lib/esm/store/version.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/AccountApi.d.ts +59 -0
- package/lib/types/AccountApi.d.ts.map +1 -0
- package/lib/types/AccountsApi.d.ts +7 -0
- package/lib/types/AccountsApi.d.ts.map +1 -0
- package/lib/types/AnalyticsApi.d.ts +11 -0
- package/lib/types/AnalyticsApi.d.ts.map +1 -0
- package/lib/types/ApiKeysApi.d.ts +42 -0
- package/lib/types/ApiKeysApi.d.ts.map +1 -0
- package/lib/types/AppsApi.d.ts +65 -0
- package/lib/types/AppsApi.d.ts.map +1 -0
- package/lib/types/CommandsApi.d.ts +10 -0
- package/lib/types/CommandsApi.d.ts.map +1 -0
- package/lib/types/EnvironmentsApi.d.ts +40 -0
- package/lib/types/EnvironmentsApi.d.ts.map +1 -0
- package/lib/types/GroupsApi.d.ts +65 -0
- package/lib/types/GroupsApi.d.ts.map +1 -0
- package/lib/types/IamApi.d.ts +41 -0
- package/lib/types/IamApi.d.ts.map +1 -0
- package/lib/types/InteractionBase.d.ts +22 -0
- package/lib/types/InteractionBase.d.ts.map +1 -0
- package/lib/types/InteractionCatalogApi.d.ts +36 -0
- package/lib/types/InteractionCatalogApi.d.ts.map +1 -0
- package/lib/types/InteractionOutput.d.ts +174 -0
- package/lib/types/InteractionOutput.d.ts.map +1 -0
- package/lib/types/InteractionResult.example.d.ts +6 -0
- package/lib/types/InteractionResult.example.d.ts.map +1 -0
- package/lib/types/InteractionsApi.d.ts +183 -0
- package/lib/types/InteractionsApi.d.ts.map +1 -0
- package/lib/types/MCPOAuthApi.d.ts +45 -0
- package/lib/types/MCPOAuthApi.d.ts.map +1 -0
- package/lib/types/ProjectsApi.d.ts +28 -0
- package/lib/types/ProjectsApi.d.ts.map +1 -0
- package/lib/types/PromptsApi.d.ts +106 -0
- package/lib/types/PromptsApi.d.ts.map +1 -0
- package/lib/types/RefsApi.d.ts +6 -0
- package/lib/types/RefsApi.d.ts.map +1 -0
- package/lib/types/RunsApi.d.ts +79 -0
- package/lib/types/RunsApi.d.ts.map +1 -0
- package/lib/types/SkillsApi.d.ts +26 -0
- package/lib/types/SkillsApi.d.ts.map +1 -0
- package/lib/types/StreamSource.d.ts +7 -0
- package/lib/types/StreamSource.d.ts.map +1 -0
- package/lib/types/TrainingApi.d.ts +27 -0
- package/lib/types/TrainingApi.d.ts.map +1 -0
- package/lib/types/UsersApi.d.ts +6 -0
- package/lib/types/UsersApi.d.ts.map +1 -0
- package/lib/types/client.d.ts +136 -0
- package/lib/types/client.d.ts.map +1 -0
- package/lib/types/execute.d.ts +37 -0
- package/lib/types/execute.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
- package/lib/types/nodejs/index.d.ts +1 -0
- package/lib/types/nodejs/index.d.ts.map +1 -0
- package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
- package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
- package/lib/types/store/CollectionsApi.d.ts +82 -0
- package/lib/types/store/CollectionsApi.d.ts.map +1 -0
- package/lib/types/store/CommandsApi.d.ts +10 -0
- package/lib/types/store/CommandsApi.d.ts.map +1 -0
- package/lib/types/store/DashboardApi.d.ts +149 -0
- package/lib/types/store/DashboardApi.d.ts.map +1 -0
- package/lib/types/store/DataApi.d.ts +392 -0
- package/lib/types/store/DataApi.d.ts.map +1 -0
- package/lib/types/store/EmailApi.d.ts +185 -0
- package/lib/types/store/EmailApi.d.ts.map +1 -0
- package/lib/types/store/EmbeddingsApi.d.ts +12 -0
- package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
- package/lib/types/store/FilesApi.d.ts +110 -0
- package/lib/types/store/FilesApi.d.ts.map +1 -0
- package/lib/types/store/ObjectsApi.d.ts +139 -0
- package/lib/types/store/ObjectsApi.d.ts.map +1 -0
- package/lib/types/store/PendingAsksApi.d.ts +79 -0
- package/lib/types/store/PendingAsksApi.d.ts.map +1 -0
- package/lib/types/store/SchedulesApi.d.ts +89 -0
- package/lib/types/store/SchedulesApi.d.ts.map +1 -0
- package/lib/types/store/ToolsApi.d.ts +13 -0
- package/lib/types/store/ToolsApi.d.ts.map +1 -0
- package/lib/types/store/TypesApi.d.ts +23 -0
- package/lib/types/store/TypesApi.d.ts.map +1 -0
- package/lib/types/store/WorkersApi.d.ts +6 -0
- package/lib/types/store/WorkersApi.d.ts.map +1 -0
- package/lib/types/store/WorkflowsApi.d.ts +167 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/types/store/client.d.ts +45 -0
- package/lib/types/store/client.d.ts.map +1 -0
- package/lib/types/store/errors.d.ts +4 -0
- package/lib/types/store/errors.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +10 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/version.d.ts +2 -0
- package/lib/types/store/version.d.ts.map +1 -0
- package/lib/vertesia-client.js +2 -0
- package/lib/vertesia-client.js.map +1 -0
- package/package.json +71 -0
- package/src/AccountApi.ts +96 -0
- package/src/AccountsApi.ts +22 -0
- package/src/AnalyticsApi.ts +36 -0
- package/src/ApiKeysApi.ts +67 -0
- package/src/AppsApi.ts +134 -0
- package/src/CommandsApi.ts +23 -0
- package/src/EnvironmentsApi.ts +94 -0
- package/src/GroupsApi.ts +92 -0
- package/src/IamApi.ts +70 -0
- package/src/InteractionBase.ts +44 -0
- package/src/InteractionCatalogApi.ts +72 -0
- package/src/InteractionOutput.test.ts +305 -0
- package/src/InteractionOutput.ts +328 -0
- package/src/InteractionResult.example.ts +72 -0
- package/src/InteractionsApi.ts +308 -0
- package/src/MCPOAuthApi.ts +67 -0
- package/src/ProjectsApi.ts +85 -0
- package/src/PromptsApi.ts +160 -0
- package/src/RefsApi.ts +18 -0
- package/src/RunsApi.ts +151 -0
- package/src/SkillsApi.ts +46 -0
- package/src/StreamSource.ts +3 -0
- package/src/TrainingApi.ts +71 -0
- package/src/UsersApi.ts +18 -0
- package/src/client.test.ts +99 -0
- package/src/client.ts +419 -0
- package/src/execute.ts +126 -0
- package/src/index.ts +10 -0
- package/src/nodejs/NodeStreamSource.ts +43 -0
- package/src/nodejs/index.ts +1 -0
- package/src/store/AnalyzeDocApi.ts +61 -0
- package/src/store/CollectionsApi.ts +166 -0
- package/src/store/CommandsApi.ts +15 -0
- package/src/store/DashboardApi.ts +216 -0
- package/src/store/DataApi.ts +516 -0
- package/src/store/EmailApi.ts +211 -0
- package/src/store/EmbeddingsApi.ts +39 -0
- package/src/store/FilesApi.ts +288 -0
- package/src/store/ObjectsApi.ts +432 -0
- package/src/store/PendingAsksApi.ts +98 -0
- package/src/store/SchedulesApi.ts +114 -0
- package/src/store/ToolsApi.ts +19 -0
- package/src/store/TypesApi.ts +65 -0
- package/src/store/WorkersApi.ts +17 -0
- package/src/store/WorkflowsApi.ts +752 -0
- package/src/store/client.ts +95 -0
- package/src/store/errors.ts +7 -0
- package/src/store/index.ts +11 -0
- package/src/store/version.ts +2 -0
- package/tsconfig.dist.json +20 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { GenericCommandResponse } from "@vertesia/common";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Various utility commands
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default class CommandsApi extends ApiTopic {
|
|
10
|
+
|
|
11
|
+
constructor(parent: ClientBase) {
|
|
12
|
+
super(parent, "/api/v1/commands")
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async isNamespaceAvailable(name: string): Promise<boolean> {
|
|
16
|
+
return this.get(`/namespaces/${name}/is_available`).then((response) => response.available);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async initSamples(): Promise<GenericCommandResponse> {
|
|
20
|
+
return this.post("/onboarding/init-samples");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { AIModel, EmbeddingsOptions, EmbeddingsResult, ModelSearchPayload } from "@llumiverse/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import {
|
|
4
|
+
ExecutionEnvironment,
|
|
5
|
+
ExecutionEnvironmentCreatePayload,
|
|
6
|
+
ExecutionEnvironmentRef,
|
|
7
|
+
ExecutionEnvironmentUpdatePayload,
|
|
8
|
+
LoadBalancingEnvConfig,
|
|
9
|
+
MediatorEnvConfig,
|
|
10
|
+
MigrateInteractionsPayload,
|
|
11
|
+
MigrateInteractionsResult
|
|
12
|
+
} from "@vertesia/common";
|
|
13
|
+
|
|
14
|
+
export default class EnvironmentsApi extends ApiTopic {
|
|
15
|
+
constructor(parent: ClientBase) {
|
|
16
|
+
super(parent, "/api/v1/environments");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List all environments for the current project
|
|
21
|
+
* @param all if true, list all environments, otherwise only the ones for the current project
|
|
22
|
+
*/
|
|
23
|
+
list(all: boolean = false): Promise<ExecutionEnvironmentRef[]> {
|
|
24
|
+
const query = all ? { all: true } : undefined;
|
|
25
|
+
|
|
26
|
+
return this.get('/', { query });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
create(payload: ExecutionEnvironmentCreatePayload): Promise<ExecutionEnvironment> {
|
|
30
|
+
return this.post('/', {
|
|
31
|
+
payload
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
retrieve(id: string): Promise<ExecutionEnvironment> {
|
|
36
|
+
return this.get('/' + id);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
update(id: string, payload: ExecutionEnvironmentUpdatePayload): Promise<ExecutionEnvironment> {
|
|
40
|
+
return this.put('/' + id, {
|
|
41
|
+
payload
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Update enabled models and / or config. If enabled_models is not provided, the existing enabled models will not change.
|
|
47
|
+
* Same, if config is not provided the exiting config is not changed.
|
|
48
|
+
* If the config is provided then it will be updated without removing fields that are not provided.
|
|
49
|
+
*
|
|
50
|
+
* @param id
|
|
51
|
+
* @param payload
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
updateConfig(id: string, payload: {
|
|
55
|
+
enabled_models?: AIModel[],
|
|
56
|
+
config?: MediatorEnvConfig | LoadBalancingEnvConfig
|
|
57
|
+
}): Promise<ExecutionEnvironment> {
|
|
58
|
+
return this.put('/' + id + '/config', {
|
|
59
|
+
payload
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
listModels(id: string, payload?: ModelSearchPayload): Promise<AIModel[]> {
|
|
64
|
+
return this.get('/' + id + '/models', {
|
|
65
|
+
query: payload ? { ...payload } : undefined
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
listTrainableModels(id: string): Promise<AIModel[]> {
|
|
70
|
+
return this.get(`/${id}/trainable-models`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
embeddings(id: string, payload?: EmbeddingsOptions): Promise<EmbeddingsResult> {
|
|
74
|
+
return this.post('/' + id + '/embeddings', {
|
|
75
|
+
payload
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Batch update the LLM Environment for multiple Interactions, including the model used and the
|
|
81
|
+
* Environment that they belong to.
|
|
82
|
+
*
|
|
83
|
+
* It only updates Interactions that are in draft status.
|
|
84
|
+
*
|
|
85
|
+
* @param payload - The migration payload containing modelId and interactionIds
|
|
86
|
+
* @returns The count of matched and modified interactions
|
|
87
|
+
*/
|
|
88
|
+
migrateInteractions(payload: MigrateInteractionsPayload): Promise<MigrateInteractionsResult> {
|
|
89
|
+
return this.post(`/migrate-interactions`, {
|
|
90
|
+
payload
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
}
|
package/src/GroupsApi.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { UserGroup, UserRef } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
|
|
4
|
+
export interface GroupsQueryOptions {
|
|
5
|
+
search?: string;
|
|
6
|
+
tags?: string[];
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
[key: string]: string | string[] | number | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class GroupsApi extends ApiTopic {
|
|
13
|
+
|
|
14
|
+
constructor(parent: ClientBase) {
|
|
15
|
+
super(parent, "/groups");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* List all groups in the current account
|
|
20
|
+
* @param options Query options for filtering and pagination
|
|
21
|
+
* @returns Array of UserGroup objects
|
|
22
|
+
*/
|
|
23
|
+
list(options?: GroupsQueryOptions): Promise<UserGroup[]> {
|
|
24
|
+
return this.get('/', { query: options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create a new group
|
|
29
|
+
* @param payload The group data to create
|
|
30
|
+
* @returns The created UserGroup object
|
|
31
|
+
*/
|
|
32
|
+
create(payload: Partial<UserGroup>): Promise<UserGroup> {
|
|
33
|
+
return this.post('/', { payload });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve a specific group by ID
|
|
38
|
+
* @param groupId The ID of the group to retrieve
|
|
39
|
+
* @returns The UserGroup object
|
|
40
|
+
*/
|
|
41
|
+
retrieve(groupId: string): Promise<UserGroup> {
|
|
42
|
+
return this.get('/' + groupId);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Update a group
|
|
47
|
+
* @param groupId The ID of the group to update
|
|
48
|
+
* @param payload The group data to update
|
|
49
|
+
* @returns The updated UserGroup object
|
|
50
|
+
*/
|
|
51
|
+
update(groupId: string, payload: Partial<UserGroup>): Promise<UserGroup> {
|
|
52
|
+
return this.put('/' + groupId, { payload });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Delete a group
|
|
57
|
+
* @param groupId The ID of the group to delete
|
|
58
|
+
* @returns Object with the deleted group ID
|
|
59
|
+
*/
|
|
60
|
+
delete(groupId: string): Promise<{ id: string }> {
|
|
61
|
+
return this.del('/' + groupId);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* List members of a group
|
|
66
|
+
* @param groupId The ID of the group
|
|
67
|
+
* @returns Array of UserRef objects representing group members
|
|
68
|
+
*/
|
|
69
|
+
listMembers(groupId: string): Promise<UserRef[]> {
|
|
70
|
+
return this.get('/' + groupId + '/members');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Add a member to a group
|
|
75
|
+
* @param groupId The ID of the group
|
|
76
|
+
* @param userId The ID of the user to add
|
|
77
|
+
* @returns The updated UserGroup object
|
|
78
|
+
*/
|
|
79
|
+
addMember(groupId: string, userId: string): Promise<UserGroup> {
|
|
80
|
+
return this.post('/' + groupId + '/members/' + userId);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Remove a member from a group
|
|
85
|
+
* @param groupId The ID of the group
|
|
86
|
+
* @param userId The ID of the user to remove
|
|
87
|
+
* @returns The updated UserGroup object
|
|
88
|
+
*/
|
|
89
|
+
removeMember(groupId: string, userId: string): Promise<UserGroup> {
|
|
90
|
+
return this.del('/' + groupId + '/members/' + userId);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/IamApi.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AccessControlEntry, ACECreatePayload, AcesQueryOptions, Permission, ProjectRoles } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import { GroupsApi } from "./GroupsApi.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface FilterOption {
|
|
7
|
+
id: string,
|
|
8
|
+
name: string,
|
|
9
|
+
count: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export class IamApi extends ApiTopic {
|
|
14
|
+
|
|
15
|
+
constructor(parent: ClientBase) {
|
|
16
|
+
super(parent, "/api/v1/iam")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
aces = new AcesApi(this)
|
|
20
|
+
roles = new RolesApi(this)
|
|
21
|
+
groups = new GroupsApi(this)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class RolesApi extends ApiTopic {
|
|
25
|
+
|
|
26
|
+
constructor(parent: ClientBase) {
|
|
27
|
+
super(parent, "/roles")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
list(): Promise<{ name: ProjectRoles, permissions: Permission[] }[]> {
|
|
31
|
+
return this.get('/');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export class AcesApi extends ApiTopic {
|
|
38
|
+
|
|
39
|
+
constructor(parent: ClientBase) {
|
|
40
|
+
super(parent, "/aces")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the list of all runs
|
|
45
|
+
* @param project optional project id to filter by
|
|
46
|
+
* @param interaction optional interaction id to filter by
|
|
47
|
+
* @returns InteractionResult[]
|
|
48
|
+
**/
|
|
49
|
+
list(options: AcesQueryOptions): Promise<AccessControlEntry[]> {
|
|
50
|
+
return this.get('/', { query: { ...options } });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get an ACE by its Id
|
|
55
|
+
* @param id
|
|
56
|
+
* @returns InteractionResult
|
|
57
|
+
**/
|
|
58
|
+
retrieve(id: string): Promise<AccessControlEntry> {
|
|
59
|
+
return this.get('/' + id);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
create(payload: ACECreatePayload): Promise<AccessControlEntry> {
|
|
63
|
+
return this.post('/', { payload })
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
delete(id: string): Promise<{ id: string }> {
|
|
67
|
+
return this.del('/' + id)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ExecutionRun, InteractionUpdatePayload, InteractionExecutionPayload } from "@vertesia/common";
|
|
2
|
+
import { VertesiaClient, VertesiaClientProps } from "./client.js";
|
|
3
|
+
import { executeInteraction } from "./execute.js";
|
|
4
|
+
|
|
5
|
+
export class InteractionBase<P = any> {
|
|
6
|
+
client: VertesiaClient;
|
|
7
|
+
|
|
8
|
+
constructor(public id: string, clientOrOpts: VertesiaClient | VertesiaClientProps) {
|
|
9
|
+
if (clientOrOpts instanceof VertesiaClient) {
|
|
10
|
+
this.client = clientOrOpts;
|
|
11
|
+
} else {
|
|
12
|
+
this.client = new VertesiaClient(clientOrOpts);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
retrieve() {
|
|
17
|
+
return this.client.interactions.retrieve(this.id);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
update(payload: InteractionUpdatePayload) {
|
|
21
|
+
return this.client.interactions.update(this.id, payload);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render(data: P) {
|
|
25
|
+
data;
|
|
26
|
+
//TODO
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
31
|
+
* the run completes or fails.
|
|
32
|
+
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
33
|
+
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
34
|
+
* When all chunks are received the function will return the resolved promise
|
|
35
|
+
* @param id of the interaction to execute
|
|
36
|
+
* @param payload InteractionExecutionPayload
|
|
37
|
+
* @param onChunk callback to be called when the next chunk of the response is available
|
|
38
|
+
* @returns the resolved execution run as Promise<ExecutionRun>
|
|
39
|
+
*/
|
|
40
|
+
async execute(payload: InteractionExecutionPayload = {},
|
|
41
|
+
onChunk?: (chunk: string) => void): Promise<ExecutionRun<P>> {
|
|
42
|
+
return executeInteraction<P>(this.client, this.id, payload, onChunk);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import {
|
|
3
|
+
CatalogInteractionRef,
|
|
4
|
+
InCodeInteraction,
|
|
5
|
+
InteractionStatus
|
|
6
|
+
} from "@vertesia/common";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export class InteractionCatalogApi extends ApiTopic {
|
|
10
|
+
constructor(parent: ClientBase) {
|
|
11
|
+
super(parent, "/api/v1/interactions/catalog");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List all project interactions
|
|
16
|
+
*/
|
|
17
|
+
list(query: { status?: InteractionStatus, tag?: string } = {}): Promise<CatalogInteractionRef[]> {
|
|
18
|
+
return this.get("/", {
|
|
19
|
+
query
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* List all stored interactions
|
|
25
|
+
*/
|
|
26
|
+
listStoredInteractions(query: { status?: InteractionStatus, tag?: string } = {}): Promise<CatalogInteractionRef[]> {
|
|
27
|
+
return this.get("/stored", {
|
|
28
|
+
query
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* List sys interactions
|
|
34
|
+
*/
|
|
35
|
+
listSysInteractions(tag?: string): Promise<CatalogInteractionRef[]> {
|
|
36
|
+
return this.get(`/sys`, {
|
|
37
|
+
query: {
|
|
38
|
+
tag
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* List sys interactions
|
|
45
|
+
*/
|
|
46
|
+
listAppInteractions(appName: string, tag?: string): Promise<CatalogInteractionRef[]> {
|
|
47
|
+
return this.get(`/apps/${appName}`, {
|
|
48
|
+
query: {
|
|
49
|
+
tag
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* List all app interactions
|
|
56
|
+
*/
|
|
57
|
+
listAllAppInteractions(tag?: string): Promise<CatalogInteractionRef[]> {
|
|
58
|
+
return this.get(`/apps`, {
|
|
59
|
+
query: {
|
|
60
|
+
tag
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Resolve an interaction given its id to a InCodeInteraction
|
|
67
|
+
* @param id Interaction id
|
|
68
|
+
*/
|
|
69
|
+
resolve(id: string): Promise<InCodeInteraction> {
|
|
70
|
+
return this.get(`/resolve/${id}`);
|
|
71
|
+
}
|
|
72
|
+
}
|