@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
package/src/RefsApi.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ResolvableRef, ResourceRef } from "@vertesia/common"
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class RefsApi extends ApiTopic {
|
|
6
|
+
|
|
7
|
+
constructor(parent: ClientBase) {
|
|
8
|
+
super(parent, "/api/v1/refs")
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
resolve(refs: ResolvableRef[]): Promise<ResourceRef[]> {
|
|
13
|
+
|
|
14
|
+
return this.post('/resolve', { payload: { refs } })
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
package/src/RunsApi.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { ExecutionResponse } from "@llumiverse/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import {
|
|
4
|
+
CheckpointConversationPayload,
|
|
5
|
+
ComputeRunFacetPayload,
|
|
6
|
+
ExecutionRun,
|
|
7
|
+
ExecutionRunRef,
|
|
8
|
+
FindPayload,
|
|
9
|
+
PopulatedExecutionRun,
|
|
10
|
+
RunCreatePayload,
|
|
11
|
+
RunListingFilters,
|
|
12
|
+
RunListingQueryOptions,
|
|
13
|
+
RunSearchPayload,
|
|
14
|
+
ToolResultsPayload,
|
|
15
|
+
UserMessagePayload,
|
|
16
|
+
} from "@vertesia/common";
|
|
17
|
+
import { VertesiaClient } from "./client.js";
|
|
18
|
+
import { EnhancedExecutionRun, enhanceExecutionRun } from "./InteractionOutput.js";
|
|
19
|
+
|
|
20
|
+
export interface FilterOption {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
count: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ComputeRunFacetsResponse {
|
|
27
|
+
environments?: { _id: string; count: number }[];
|
|
28
|
+
interactions?: { _id: string; count: number }[];
|
|
29
|
+
models?: { _id: string; count: number }[];
|
|
30
|
+
tags?: { _id: string; count: number }[];
|
|
31
|
+
status?: { _id: string; count: number }[];
|
|
32
|
+
total?: { count: number }[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class RunsApi extends ApiTopic {
|
|
36
|
+
constructor(parent: ClientBase) {
|
|
37
|
+
super(parent, "/api/v1/runs");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the list of all runs
|
|
42
|
+
* @param project optional project id to filter by
|
|
43
|
+
* @param interaction optional interaction id to filter by
|
|
44
|
+
* @returns InteractionResult[]
|
|
45
|
+
**/
|
|
46
|
+
list({ limit, offset, filters }: RunListingQueryOptions): Promise<ExecutionRunRef[]> {
|
|
47
|
+
const query = {
|
|
48
|
+
limit,
|
|
49
|
+
offset,
|
|
50
|
+
...filters,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return this.get("/", { query: query });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
find(payload: FindPayload): Promise<ExecutionRun[]> {
|
|
57
|
+
return this.post("/find", {
|
|
58
|
+
payload,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Get a run by id
|
|
64
|
+
*
|
|
65
|
+
* @param id
|
|
66
|
+
* @returns InteractionResult
|
|
67
|
+
**/
|
|
68
|
+
async retrieve<ResultT = any, ParamsT = any>(id: string): Promise<EnhancedExecutionRun<ResultT, ParamsT>> {
|
|
69
|
+
const r = await this.get("/" + id);
|
|
70
|
+
return enhanceExecutionRun<ResultT, ParamsT>(r);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
retrievePopulated<P = any>(id: string): Promise<PopulatedExecutionRun<P>> {
|
|
74
|
+
return this.get("/" + id, {
|
|
75
|
+
query: { populate: "true" },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get filter options for a field
|
|
81
|
+
* return FilterOption[]
|
|
82
|
+
*/
|
|
83
|
+
filterOptions(field: string, filters: RunListingFilters): Promise<FilterOption[]> {
|
|
84
|
+
const query = {
|
|
85
|
+
...filters,
|
|
86
|
+
};
|
|
87
|
+
return this.get(`/filter-options/${field}`, { query });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async create<ResultT = any, ParamsT = any>(payload: RunCreatePayload): Promise<EnhancedExecutionRun<ResultT, ParamsT>> {
|
|
91
|
+
const sessionTags = (this.client as VertesiaClient).sessionTags;
|
|
92
|
+
if (sessionTags) {
|
|
93
|
+
let tags = Array.isArray(sessionTags) ? sessionTags : [sessionTags];
|
|
94
|
+
if (Array.isArray(payload.tags)) {
|
|
95
|
+
tags = tags.concat(payload.tags);
|
|
96
|
+
} else if (payload.tags) {
|
|
97
|
+
tags = tags.concat([payload.tags]);
|
|
98
|
+
}
|
|
99
|
+
payload = { ...payload, tags };
|
|
100
|
+
}
|
|
101
|
+
const r = await this.post("/", {
|
|
102
|
+
payload,
|
|
103
|
+
});
|
|
104
|
+
return enhanceExecutionRun<ResultT, ParamsT>(r);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Send tool results and continues the conversation
|
|
109
|
+
* @param payload
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
sendToolResults(payload: ToolResultsPayload): Promise<ExecutionResponse> {
|
|
113
|
+
return this.post(`/tool-results`, {
|
|
114
|
+
payload,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @param payload
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
sendUserMessage(payload: UserMessagePayload): Promise<ExecutionResponse> {
|
|
124
|
+
return this.post(`/user-message`, {
|
|
125
|
+
payload,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
createCheckpoint(payload: CheckpointConversationPayload): Promise<ExecutionResponse> {
|
|
130
|
+
return this.post(`/checkpoint`, {
|
|
131
|
+
payload,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get the list of all runs facets
|
|
137
|
+
* @param payload query payload to filter facet search
|
|
138
|
+
* @returns ComputeRunFacetsResponse[]
|
|
139
|
+
**/
|
|
140
|
+
computeFacets(query: ComputeRunFacetPayload): Promise<ComputeRunFacetsResponse> {
|
|
141
|
+
return this.post("/facets", {
|
|
142
|
+
payload: query,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
search(payload: RunSearchPayload): Promise<ExecutionRunRef[]> {
|
|
147
|
+
return this.post("/search", {
|
|
148
|
+
payload,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
package/src/SkillsApi.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import {
|
|
3
|
+
FindRelevantSkillsPayload,
|
|
4
|
+
InjectedSkill,
|
|
5
|
+
SkillContext,
|
|
6
|
+
} from "@vertesia/common";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* API client for skill operations.
|
|
10
|
+
* Skills are interactions with agent_runner_options.is_skill = true.
|
|
11
|
+
* They provide contextual instructions to agents by executing/rendering
|
|
12
|
+
* the interaction and returning the result.
|
|
13
|
+
*/
|
|
14
|
+
export default class SkillsApi extends ApiTopic {
|
|
15
|
+
constructor(parent: ClientBase) {
|
|
16
|
+
super(parent, "/api/v1/skills");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Find skills relevant to a given context.
|
|
21
|
+
* This is the core skill matching API for auto-injection.
|
|
22
|
+
* @param context The context to match against
|
|
23
|
+
* @param limit Maximum number of skills to return (default: 5)
|
|
24
|
+
* @returns Array of injected skills with match scores
|
|
25
|
+
*/
|
|
26
|
+
findRelevant(context: SkillContext, limit?: number): Promise<InjectedSkill[]> {
|
|
27
|
+
const payload: FindRelevantSkillsPayload = { context, limit };
|
|
28
|
+
return this.post("/find-relevant", { payload });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Convenience method to find relevant skills by task description
|
|
33
|
+
* @param taskDescription The task or prompt to match
|
|
34
|
+
* @param toolNames Optional list of tools being used
|
|
35
|
+
* @returns Array of injected skills
|
|
36
|
+
*/
|
|
37
|
+
findRelevantForTask(
|
|
38
|
+
taskDescription: string,
|
|
39
|
+
toolNames?: string[]
|
|
40
|
+
): Promise<InjectedSkill[]> {
|
|
41
|
+
return this.findRelevant({
|
|
42
|
+
task_description: taskDescription,
|
|
43
|
+
tool_names: toolNames,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { TrainingJob } from "@llumiverse/common";
|
|
2
|
+
import { ExecutionRunRef, ListTrainingSessionsQuery, TrainingSession, TrainingSessionCreatePayload, TrainingSessionRef } from "@vertesia/common";
|
|
3
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class TrainingApi extends ApiTopic {
|
|
7
|
+
|
|
8
|
+
constructor(parent: ClientBase) {
|
|
9
|
+
super(parent, "/api/v1/training")
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
listSessions(query: ListTrainingSessionsQuery = {}): Promise<TrainingSessionRef[]> {
|
|
13
|
+
return this.get('/', { query: query as any });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
listSessionNames(query: ListTrainingSessionsQuery = {}): Promise<{ id: string, name: string }[]> {
|
|
17
|
+
return this.get('/names', { query: query as any });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
createSession(payload: TrainingSessionCreatePayload): Promise<TrainingSession> {
|
|
21
|
+
return this.post('/', { payload })
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getSession(sessionId: string): Promise<TrainingSession> {
|
|
25
|
+
return this.get('/' + sessionId)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
addToSession(sessionId: string, runs: string[]): Promise<any> {
|
|
29
|
+
return this.post('/' + sessionId + '/add', { payload: { runs } })
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
listSessionRuns(sessionId: string, limit = 100, offset = 0): Promise<ExecutionRunRef[]> {
|
|
33
|
+
return this.get('/' + sessionId + '/runs', { query: { limit, offset } });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
buildSession(sessionId: string) {
|
|
37
|
+
return this.post('/' + sessionId + '/build');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getDataUrl(sessionId: string): Promise<{ url: string }> {
|
|
41
|
+
return this.get('/' + sessionId + '/url')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getDataUploadUrl(sessionId: string, isResumable = false): Promise<{ url: string }> {
|
|
45
|
+
return this.get('/' + sessionId + '/upload-url',
|
|
46
|
+
isResumable ? { query: { resumable: 'true' } } : {})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
startTraining(sessionId: string): Promise<TrainingJob> {
|
|
50
|
+
return this.post('/' + sessionId + '/start');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
cancelTraining(sessionId: string): Promise<TrainingJob> {
|
|
54
|
+
return this.post('/' + sessionId + '/cancel');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getTrainingJob(jobId: string): Promise<TrainingJob> {
|
|
58
|
+
return this.get(`/job/${jobId}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getAndSyncTrainingJob(jobId: string): Promise<TrainingJob> {
|
|
62
|
+
return this.get(`/job/${jobId}`, {
|
|
63
|
+
query: { sync: 'true' }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
setDataset(sessionId: string, name: string = "default"): Promise<any> {
|
|
68
|
+
return this.post('/' + sessionId + '/dataset', { payload: { dataset: name } })
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
package/src/UsersApi.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { User } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class UsersApi extends ApiTopic {
|
|
8
|
+
|
|
9
|
+
constructor(parent: ClientBase) {
|
|
10
|
+
super(parent, "/api/v1/users")
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
retrieve(userId: string): Promise<User> {
|
|
14
|
+
return this.get('/' + userId);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { VertesiaClient } from "./client";
|
|
3
|
+
|
|
4
|
+
describe('Test Vertesia Client', () => {
|
|
5
|
+
test('Initialization with studio and zeno URLs', () => {
|
|
6
|
+
const client = new VertesiaClient({
|
|
7
|
+
serverUrl: 'https://api.vertesia.io',
|
|
8
|
+
storeUrl: 'https://api.vertesia.io',
|
|
9
|
+
tokenServerUrl: 'https://sts.vertesia.io',
|
|
10
|
+
apikey: '1234',
|
|
11
|
+
});
|
|
12
|
+
expect(client).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Initialization with studio URL only', () => {
|
|
16
|
+
expect(() => {
|
|
17
|
+
new VertesiaClient({
|
|
18
|
+
serverUrl: 'https://api.vertesia.io',
|
|
19
|
+
storeUrl: '',
|
|
20
|
+
});
|
|
21
|
+
}).toThrowError("Parameter 'site' or 'storeUrl' is required for VertesiaClient");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('Initialization with zeno URL only', () => {
|
|
25
|
+
expect(() => {
|
|
26
|
+
new VertesiaClient({
|
|
27
|
+
serverUrl: '',
|
|
28
|
+
storeUrl: 'https://api.vertesia.io',
|
|
29
|
+
});
|
|
30
|
+
}).toThrowError("Parameter 'site' or 'serverUrl' is required for VertesiaClient");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('Initialization with same site', () => {
|
|
34
|
+
const client = new VertesiaClient({
|
|
35
|
+
serverUrl: 'https://api.vertesia.io',
|
|
36
|
+
storeUrl: 'https://api.vertesia.io',
|
|
37
|
+
site: 'api.vertesia.io',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
expect(client).toBeDefined();
|
|
41
|
+
expect(client.baseUrl).toBe('https://api.vertesia.io');
|
|
42
|
+
expect(client.storeUrl).toBe('https://api.vertesia.io');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('Initialization with default parameters', () => {
|
|
46
|
+
const client = new VertesiaClient();
|
|
47
|
+
|
|
48
|
+
expect(client).toBeDefined();
|
|
49
|
+
expect(client.baseUrl).toBe('https://api.vertesia.io');
|
|
50
|
+
expect(client.storeUrl).toBe('https://api.vertesia.io');
|
|
51
|
+
expect(client.tokenServerUrl).toBe('https://sts.vertesia.io');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('Initialization with site api-preview.vertesia.io', () => {
|
|
55
|
+
const client = new VertesiaClient({
|
|
56
|
+
site: 'api-preview.vertesia.io',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
expect(client).toBeDefined();
|
|
60
|
+
expect(client.baseUrl).toBe('https://api-preview.vertesia.io');
|
|
61
|
+
expect(client.storeUrl).toBe('https://api-preview.vertesia.io');
|
|
62
|
+
expect(client.tokenServerUrl).toBe('https://sts.vertesia.io');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('Initialization with site api-staging.vertesia.io', () => {
|
|
66
|
+
const client = new VertesiaClient({
|
|
67
|
+
site: 'api-staging.vertesia.io',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
expect(client).toBeDefined();
|
|
71
|
+
expect(client.baseUrl).toBe('https://api-staging.vertesia.io');
|
|
72
|
+
expect(client.storeUrl).toBe('https://api-staging.vertesia.io');
|
|
73
|
+
expect(client.tokenServerUrl).toBe('https://sts-staging.vertesia.io');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('Initialization with site localhost', () => {
|
|
77
|
+
const client = new VertesiaClient({
|
|
78
|
+
serverUrl: 'http://localhost:8091',
|
|
79
|
+
storeUrl: 'http://localhost:8092',
|
|
80
|
+
tokenServerUrl: 'http://localhost:8093',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
expect(client).toBeDefined();
|
|
84
|
+
expect(client.baseUrl).toBe('http://localhost:8091');
|
|
85
|
+
expect(client.storeUrl).toBe('http://localhost:8092');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('Initialization with overrides', () => {
|
|
89
|
+
const client = new VertesiaClient({
|
|
90
|
+
serverUrl: 'https://studio-server-production.api.becomposable.com',
|
|
91
|
+
storeUrl: 'https://zeno-server-production.api.becomposable.com',
|
|
92
|
+
site: 'api.vertesia.io',
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
expect(client).toBeDefined();
|
|
96
|
+
expect(client.baseUrl).toBe('https://studio-server-production.api.becomposable.com');
|
|
97
|
+
expect(client.storeUrl).toBe('https://zeno-server-production.api.becomposable.com');
|
|
98
|
+
});
|
|
99
|
+
});
|