@vertesia/client 0.78.0-dev-28b447d → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +13 -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 +58 -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/InteractionsApi.js +217 -0
- package/lib/cjs/InteractionsApi.js.map +1 -0
- package/lib/cjs/ProjectsApi.js +48 -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 +105 -0
- package/lib/cjs/RunsApi.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 +279 -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 +21 -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/AgentsApi.js +16 -0
- package/lib/cjs/store/AgentsApi.js.map +1 -0
- package/lib/cjs/store/AnalyzeDocApi.js +56 -0
- package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
- package/lib/cjs/store/CollectionsApi.js +101 -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/EmbeddingsApi.js +29 -0
- package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
- package/lib/cjs/store/FilesApi.js +147 -0
- package/lib/cjs/store/FilesApi.js.map +1 -0
- package/lib/cjs/store/ObjectsApi.js +281 -0
- package/lib/cjs/store/ObjectsApi.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/WorkflowsApi.js +265 -0
- package/lib/cjs/store/WorkflowsApi.js.map +1 -0
- package/lib/cjs/store/client.js +71 -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 +22 -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 +10 -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 +55 -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/InteractionsApi.js +214 -0
- package/lib/esm/InteractionsApi.js.map +1 -0
- package/lib/esm/ProjectsApi.js +45 -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 +101 -0
- package/lib/esm/RunsApi.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 +270 -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 +5 -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/AgentsApi.js +12 -0
- package/lib/esm/store/AgentsApi.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 +97 -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/EmbeddingsApi.js +25 -0
- package/lib/esm/store/EmbeddingsApi.js.map +1 -0
- package/lib/esm/store/FilesApi.js +142 -0
- package/lib/esm/store/FilesApi.js.map +1 -0
- package/lib/esm/store/ObjectsApi.js +277 -0
- package/lib/esm/store/ObjectsApi.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/WorkflowsApi.js +259 -0
- package/lib/esm/store/WorkflowsApi.js.map +1 -0
- package/lib/esm/store/client.js +67 -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 +6 -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 +6 -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 +30 -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/InteractionsApi.d.ts +156 -0
- package/lib/types/InteractionsApi.d.ts.map +1 -0
- package/lib/types/ProjectsApi.d.ts +17 -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 +77 -0
- package/lib/types/RunsApi.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 +119 -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 +8 -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/AgentsApi.d.ts +6 -0
- package/lib/types/store/AgentsApi.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 +66 -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/EmbeddingsApi.d.ts +12 -0
- package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
- package/lib/types/store/FilesApi.d.ts +47 -0
- package/lib/types/store/FilesApi.d.ts.map +1 -0
- package/lib/types/store/ObjectsApi.d.ts +122 -0
- package/lib/types/store/ObjectsApi.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/WorkflowsApi.d.ts +50 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/types/store/client.d.ts +34 -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 +5 -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 +54 -59
- package/src/InteractionsApi.ts +1 -2
- package/src/RunsApi.ts +1 -8
- package/src/client.test.ts +0 -2
- package/src/client.ts +69 -129
- package/src/store/FilesApi.ts +2 -2
- package/src/store/WorkflowsApi.ts +0 -166
- package/src/store/client.ts +12 -3
- package/src/store/version.ts +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsApi.d.ts","sourceRoot":"","sources":["../../src/GroupsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD;AAED,qBAAa,SAAU,SAAQ,QAAQ;gBAEvB,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAIxD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI7C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAIxE;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAIhD;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIhD;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI9D;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAGpE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
export interface FilterOption {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class IamApi extends ApiTopic {
|
|
10
|
+
constructor(parent: ClientBase);
|
|
11
|
+
aces: AcesApi;
|
|
12
|
+
roles: RolesApi;
|
|
13
|
+
groups: GroupsApi;
|
|
14
|
+
}
|
|
15
|
+
export declare class RolesApi extends ApiTopic {
|
|
16
|
+
constructor(parent: ClientBase);
|
|
17
|
+
list(): Promise<{
|
|
18
|
+
name: ProjectRoles;
|
|
19
|
+
permissions: Permission[];
|
|
20
|
+
}[]>;
|
|
21
|
+
}
|
|
22
|
+
export declare class AcesApi extends ApiTopic {
|
|
23
|
+
constructor(parent: ClientBase);
|
|
24
|
+
/**
|
|
25
|
+
* Get the list of all runs
|
|
26
|
+
* @param project optional project id to filter by
|
|
27
|
+
* @param interaction optional interaction id to filter by
|
|
28
|
+
* @returns InteractionResult[]
|
|
29
|
+
**/
|
|
30
|
+
list(options: AcesQueryOptions): Promise<AccessControlEntry[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Get an ACE by its Id
|
|
33
|
+
* @param id
|
|
34
|
+
* @returns InteractionResult
|
|
35
|
+
**/
|
|
36
|
+
retrieve(id: string): Promise<AccessControlEntry>;
|
|
37
|
+
create(payload: ACECreatePayload): Promise<AccessControlEntry>;
|
|
38
|
+
delete(id: string): Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IamApi.d.ts","sourceRoot":"","sources":["../../src/IamApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAA;CAChB;AAGD,qBAAa,MAAO,SAAQ,QAAQ;gBAEpB,MAAM,EAAE,UAAU;IAI9B,IAAI,UAAoB;IACxB,KAAK,WAAqB;IAC1B,MAAM,YAAsB;CAC/B;AAED,qBAAa,QAAS,SAAQ,QAAQ;gBAEtB,MAAM,EAAE,UAAU;IAI9B,IAAI,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,EAAE,CAAC;CAIvE;AAGD,qBAAa,OAAQ,SAAQ,QAAQ;gBAErB,MAAM,EAAE,UAAU;IAI9B;;;;;QAKI;IACJ,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAI9D;;;;QAII;IACJ,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIjD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI9D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAI9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExecutionRun, InteractionUpdatePayload, InteractionExecutionPayload } from "@vertesia/common";
|
|
2
|
+
import { VertesiaClient, VertesiaClientProps } from "./client.js";
|
|
3
|
+
export declare class InteractionBase<P = any> {
|
|
4
|
+
id: string;
|
|
5
|
+
client: VertesiaClient;
|
|
6
|
+
constructor(id: string, clientOrOpts: VertesiaClient | VertesiaClientProps);
|
|
7
|
+
retrieve(): Promise<import("@vertesia/common").Interaction>;
|
|
8
|
+
update(payload: InteractionUpdatePayload): Promise<import("@vertesia/common").Interaction>;
|
|
9
|
+
render(data: P): void;
|
|
10
|
+
/**
|
|
11
|
+
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
12
|
+
* the run completes or fails.
|
|
13
|
+
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
14
|
+
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
15
|
+
* When all chunks are received the function will return the resolved promise
|
|
16
|
+
* @param id of the interaction to execute
|
|
17
|
+
* @param payload InteractionExecutionPayload
|
|
18
|
+
* @param onChunk callback to be called when the next chunk of the response is available
|
|
19
|
+
* @returns the resolved execution run as Promise<ExecutionRun>
|
|
20
|
+
*/
|
|
21
|
+
execute(payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<ExecutionRun<P>>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionBase.d.ts","sourceRoot":"","sources":["../../src/InteractionBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlE,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG;IAGb,EAAE,EAAE,MAAM;IAF7B,MAAM,EAAE,cAAc,CAAC;gBAEJ,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,GAAG,mBAAmB;IAQjF,QAAQ;IAIR,MAAM,CAAC,OAAO,EAAE,wBAAwB;IAIxC,MAAM,CAAC,IAAI,EAAE,CAAC;IAKd;;;;;;;;;;OAUG;IACG,OAAO,CAAC,OAAO,GAAE,2BAAgC,EACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAGnE"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { AsyncExecutionPayload, ComputeInteractionFacetPayload, ExecutionRun, GenerateInteractionPayload, GenerateTestDataPayload, ImprovePromptPayload, Interaction, InteractionCreatePayload, InteractionEndpoint, InteractionEndpointQuery, InteractionExecutionPayload, InteractionExecutionResult, InteractionForkPayload, InteractionPublishPayload, InteractionRef, InteractionRefWithSchema, InteractionSearchPayload, InteractionUpdatePayload, InteractionsExportPayload, RateLimitRequestPayload, RateLimitRequestResponse } from "@vertesia/common";
|
|
3
|
+
export interface ComputeInteractionFacetsResponse {
|
|
4
|
+
tags?: {
|
|
5
|
+
_id: string;
|
|
6
|
+
count: number;
|
|
7
|
+
}[];
|
|
8
|
+
status?: {
|
|
9
|
+
_id: string;
|
|
10
|
+
count: number;
|
|
11
|
+
}[];
|
|
12
|
+
total?: {
|
|
13
|
+
count: number;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export interface AsyncExecutionResult {
|
|
17
|
+
runId: string;
|
|
18
|
+
workflowId: string;
|
|
19
|
+
}
|
|
20
|
+
export default class InteractionsApi extends ApiTopic {
|
|
21
|
+
constructor(parent: ClientBase);
|
|
22
|
+
/**
|
|
23
|
+
* Get the list of all interactions in the current project
|
|
24
|
+
* @returns InteractionRef[]
|
|
25
|
+
**/
|
|
26
|
+
list(payload?: InteractionSearchPayload): Promise<InteractionRef[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Find interactions given a mongo match query.
|
|
29
|
+
* You can also specify if prompts schemas are included in the result
|
|
30
|
+
*/
|
|
31
|
+
listEndpoints(payload: InteractionEndpointQuery): Promise<InteractionEndpoint[]>;
|
|
32
|
+
/**
|
|
33
|
+
* List all interaction versions in the project having the given endpoint name.
|
|
34
|
+
* This is useful to list orphaned versions
|
|
35
|
+
* @param name
|
|
36
|
+
*/
|
|
37
|
+
listVersionsByName(name: string): Promise<InteractionRef[]>;
|
|
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: ComputeInteractionFacetPayload): Promise<ComputeInteractionFacetsResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* List interaction names in the current project
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
listNames(): Promise<{
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
}[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Get the list of all interactions in the current project. Schemas will be returned too.
|
|
54
|
+
* @returns InteractionRefWithSchema[]
|
|
55
|
+
**/
|
|
56
|
+
export(payload: InteractionsExportPayload): Promise<InteractionRefWithSchema[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a new interaction
|
|
59
|
+
* @param payload InteractionCreatePayload
|
|
60
|
+
* @returns Interaction
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
* @throws 400 if payload is invalid
|
|
63
|
+
* @throws 500 if interaction creation fails
|
|
64
|
+
**/
|
|
65
|
+
create(payload: InteractionCreatePayload): Promise<Interaction>;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieve an existing interaction definition
|
|
68
|
+
* @param id of the interaction to retrieve
|
|
69
|
+
* @returns Interaction
|
|
70
|
+
**/
|
|
71
|
+
retrieve(id: string): Promise<Interaction>;
|
|
72
|
+
/**
|
|
73
|
+
* Update an existing interaction definition
|
|
74
|
+
* @param id of the interaction to update
|
|
75
|
+
* @param payload InteractionUpdatePayload
|
|
76
|
+
* @returns Interaction
|
|
77
|
+
* @throws ApiError
|
|
78
|
+
* @throws 400 if payload is invalid
|
|
79
|
+
* @throws 500 if interaction update fails
|
|
80
|
+
* @throws 404 if interaction not found
|
|
81
|
+
**/
|
|
82
|
+
update(id: string, payload: InteractionUpdatePayload): Promise<Interaction>;
|
|
83
|
+
/**
|
|
84
|
+
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
85
|
+
* the run completes or fails.
|
|
86
|
+
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
87
|
+
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
88
|
+
* When all chunks are received the function will return the resolved promise
|
|
89
|
+
* @param id of the interaction to execute
|
|
90
|
+
* @param payload InteractionExecutionPayload
|
|
91
|
+
* @param onChunk callback to be called when the next chunk of the response is available
|
|
92
|
+
* @returns Promise<ExecutionRun>
|
|
93
|
+
* @throws ApiError
|
|
94
|
+
* @throws 404 if interaction not found
|
|
95
|
+
* @throws 400 if payload is invalid
|
|
96
|
+
* @throws 500 if interaction execution fails
|
|
97
|
+
* @throws 500 if interaction execution times out
|
|
98
|
+
**/
|
|
99
|
+
execute<P = any>(id: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<ExecutionRun<P>>;
|
|
100
|
+
/**
|
|
101
|
+
* Same as execute but uses the interaction name selector instead of the id.
|
|
102
|
+
*
|
|
103
|
+
* A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
|
|
104
|
+
* 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.
|
|
105
|
+
* Examples of selectors:
|
|
106
|
+
* - `ReviewContract` - select the latest version of the ReviewContract interaction
|
|
107
|
+
* - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
|
|
108
|
+
* - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
|
|
109
|
+
* - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
|
|
110
|
+
* @param nameWithTag
|
|
111
|
+
* @param payload
|
|
112
|
+
* @param onChunk
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
executeByName<P = any>(nameWithTag: string, payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<InteractionExecutionResult<P>>;
|
|
116
|
+
/**
|
|
117
|
+
* Execute an interaction in an workflow
|
|
118
|
+
* @param payload
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
executeAsync(payload: AsyncExecutionPayload): Promise<AsyncExecutionResult>;
|
|
122
|
+
publish(id: string, payload: InteractionPublishPayload): Promise<Interaction>;
|
|
123
|
+
fork(id: string, payload: InteractionForkPayload): Promise<Interaction>;
|
|
124
|
+
/**
|
|
125
|
+
* Generate Composable definition of an interaction
|
|
126
|
+
**/
|
|
127
|
+
generateInteraction(id: string, payload: GenerateInteractionPayload): Promise<any[]>;
|
|
128
|
+
/**
|
|
129
|
+
* Generate Test Data for an interaction
|
|
130
|
+
**/
|
|
131
|
+
generateTestData(id: string, payload: GenerateTestDataPayload): Promise<any[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Suggest Improvement for a prompt
|
|
134
|
+
*/
|
|
135
|
+
suggestImprovements(id: string, payload: ImprovePromptPayload): Promise<{
|
|
136
|
+
result: string;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* List the versions of the interaction. Returns an empty array if no versions are found
|
|
140
|
+
* @param id
|
|
141
|
+
* @returns the versions list or an empty array if no versions are found
|
|
142
|
+
*/
|
|
143
|
+
listVersions(id: string): Promise<InteractionRef[]>;
|
|
144
|
+
/**
|
|
145
|
+
* List the forks of the interaction. Returns an empty array if no forks are found
|
|
146
|
+
* @param id
|
|
147
|
+
* @returns the versions list or an empty array if no forks are found
|
|
148
|
+
*/
|
|
149
|
+
listForks(id: string): Promise<InteractionRef[]>;
|
|
150
|
+
/**
|
|
151
|
+
* Request a time slot to execute an interaction with a given environment / model
|
|
152
|
+
* @param payload RateLimitRequestPayload
|
|
153
|
+
* @returns RateLimitRequestResponse with delay_ms
|
|
154
|
+
*/
|
|
155
|
+
requestSlot(payload: RateLimitRequestPayload): Promise<RateLimitRequestResponse>;
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionsApi.d.ts","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE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AC,GAAG,EAAE,CAAC;IAQpF;;QAEI;IACJ,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAO9E;;OAEG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;KAAE,CAAC;IAM5F;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAInD;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAIhD;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAInF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { AwsConfiguration, GithubConfiguration, GladiaConfiguration, ICreateProjectPayload, MagicPdfConfiguration, Project, ProjectIntegrationListEntry, ProjectRef, SupportedIntegrations } from "@vertesia/common";
|
|
3
|
+
export default class ProjectsApi extends ApiTopic {
|
|
4
|
+
constructor(parent: ClientBase);
|
|
5
|
+
list(account?: string[]): Promise<ProjectRef[]>;
|
|
6
|
+
retrieve(projectId: string): Promise<Project>;
|
|
7
|
+
create(payload: ICreateProjectPayload): Promise<Project>;
|
|
8
|
+
update(projectId: string, payload: Partial<Project>): Promise<Project>;
|
|
9
|
+
integrations: IntegrationsConfigurationApi;
|
|
10
|
+
}
|
|
11
|
+
declare class IntegrationsConfigurationApi extends ApiTopic {
|
|
12
|
+
constructor(parent: ClientBase);
|
|
13
|
+
list(projectId: string): Promise<ProjectIntegrationListEntry[]>;
|
|
14
|
+
retrieve(projectId: string, integrationId: SupportedIntegrations): Promise<GladiaConfiguration | GithubConfiguration | AwsConfiguration | MagicPdfConfiguration | undefined>;
|
|
15
|
+
update(projectId: string, integrationId: string, payload: any): Promise<GladiaConfiguration | GithubConfiguration>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectsApi.d.ts","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAErN,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;gBACjC,MAAM,EAAE,UAAU;IAI9B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7C,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMxD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAMtE,YAAY,EAAE,4BAA4B,CAA0C;CAEvF;AAED,cAAM,4BAA6B,SAAQ,QAAQ;gBAEnC,MAAM,EAAE,UAAU;IAI9B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAI/D,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,SAAS,CAAC;IAS5K,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;CAMrH"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ComputePromptFacetPayload, PromptSearchPayload, PromptTemplate, PromptTemplateForkPayload, PromptTemplateCreatePayload, PromptTemplateRef, PromptTemplateUpdatePayload } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
export interface ComputePromptFacetsResponse {
|
|
4
|
+
role?: {
|
|
5
|
+
_id: string;
|
|
6
|
+
count: number;
|
|
7
|
+
}[];
|
|
8
|
+
total?: {
|
|
9
|
+
count: number;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export default class PromptsApi extends ApiTopic {
|
|
13
|
+
constructor(parent: ClientBase);
|
|
14
|
+
/**
|
|
15
|
+
* Get the list of all prompt templates
|
|
16
|
+
* @param payload query payload to filter search
|
|
17
|
+
* @returns PromptTemplateRef[]
|
|
18
|
+
**/
|
|
19
|
+
list(payload?: PromptSearchPayload): Promise<PromptTemplateRef[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the list of all prompt facets
|
|
22
|
+
* @param payload query payload to filter facet search
|
|
23
|
+
* @returns ComputePromptFacetsResponse[]
|
|
24
|
+
**/
|
|
25
|
+
computeFacets(query: ComputePromptFacetPayload): Promise<ComputePromptFacetsResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new prompt template
|
|
28
|
+
* @param payload PromptTemplateCreatePayload
|
|
29
|
+
* @returns PromptTemplate
|
|
30
|
+
* @throws ApiError
|
|
31
|
+
* @throws 400 if payload is invalid
|
|
32
|
+
* @throws 500 if creation fails
|
|
33
|
+
**/
|
|
34
|
+
create(payload: PromptTemplateCreatePayload): Promise<PromptTemplate>;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve an existing prompt template
|
|
37
|
+
* @param id of the prompt template to retrieve
|
|
38
|
+
* @returns PromptTemplate
|
|
39
|
+
**/
|
|
40
|
+
retrieve(id: string): Promise<PromptTemplate>;
|
|
41
|
+
/**
|
|
42
|
+
* Update an existing prompt template
|
|
43
|
+
* @param id of the prompt template to update
|
|
44
|
+
* @param payload PromptTemplateCreatePayload
|
|
45
|
+
* @returns PromptTemplate
|
|
46
|
+
* @throws ApiError
|
|
47
|
+
* @throws 400 if payload is invalid
|
|
48
|
+
* @throws 500 if update fails
|
|
49
|
+
* @throws 404 if not found
|
|
50
|
+
**/
|
|
51
|
+
update(id: string, payload: PromptTemplateUpdatePayload): Promise<PromptTemplate>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete an existing prompt template
|
|
54
|
+
* @param id of the prompt template to delete
|
|
55
|
+
* @returns void
|
|
56
|
+
*/
|
|
57
|
+
delete(id: string): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Fork an existing prompt template
|
|
60
|
+
* @param id of the prompt template to fork
|
|
61
|
+
* @param payload PromptTemplateForkPayload
|
|
62
|
+
* @returns Forked PromptTemplate
|
|
63
|
+
*/
|
|
64
|
+
fork(id: string, payload: PromptTemplateForkPayload): Promise<PromptTemplate>;
|
|
65
|
+
/**
|
|
66
|
+
* Render a prompt template
|
|
67
|
+
* @param id of the prompt template to render
|
|
68
|
+
* @param payload that will be passed to the prompt template to generate the prompts
|
|
69
|
+
* @returns PromptTemplate
|
|
70
|
+
* @throws ApiError
|
|
71
|
+
* @throws 404 if not found
|
|
72
|
+
* @throws 400 if payload is invalid
|
|
73
|
+
* @throws 500 if render fails
|
|
74
|
+
**/
|
|
75
|
+
render(id: string, payload: {}): Promise<PromptTemplate>;
|
|
76
|
+
/**
|
|
77
|
+
* Get options for a field
|
|
78
|
+
* @param field name to get options for
|
|
79
|
+
* @returns string[]
|
|
80
|
+
*/
|
|
81
|
+
options(field: string): Promise<string[]>;
|
|
82
|
+
/**
|
|
83
|
+
* List the versions of the prompt template. Returns an empty array if no versions are found
|
|
84
|
+
* @param id
|
|
85
|
+
* @returns the versions list or an empty array if no versions are found
|
|
86
|
+
*/
|
|
87
|
+
listVersions(id: string): Promise<PromptTemplateRef[]>;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve list of interactions that use the prompt template
|
|
90
|
+
*/
|
|
91
|
+
listInteractions(id: string): Promise<ListInteractionsResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* List the forks of the prompt. Returns an empty array if no forks are found
|
|
94
|
+
* @param id of the prompt to search forks
|
|
95
|
+
* @returns the versions list or an empty array if no forks are found
|
|
96
|
+
*/
|
|
97
|
+
listForks(id: string): Promise<PromptTemplateRef[]>;
|
|
98
|
+
}
|
|
99
|
+
export interface ListInteractionsResponse {
|
|
100
|
+
prompt: string;
|
|
101
|
+
interactions: {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
versions: string[];
|
|
105
|
+
}[];
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptsApi.d.ts","sourceRoot":"","sources":["../../src/PromptsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAqB,cAAc,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC7N,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,2BAA2B;IACxC,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,QAAQ;gBAChC,MAAM,EAAE,UAAU;IAI9B;;;;QAII;IACJ,IAAI,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAA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AE,CAAA;CACN"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ResolvableRef, ResourceRef } from "@vertesia/common";
|
|
2
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
export declare class RefsApi extends ApiTopic {
|
|
4
|
+
constructor(parent: ClientBase);
|
|
5
|
+
resolve(refs: ResolvableRef[]): Promise<ResourceRef[]>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefsApi.d.ts","sourceRoot":"","sources":["../../src/RefsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAGjE,qBAAa,OAAQ,SAAQ,QAAQ;gBAErB,MAAM,EAAE,UAAU;IAK9B,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAMzD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { CheckpointConversationPayload, ComputeRunFacetPayload, ExecutionRun, ExecutionRunRef, FindPayload, RunCreatePayload, RunListingFilters, RunListingQueryOptions, RunSearchPayload, ToolResultsPayload, UserMessagePayload } from "@vertesia/common";
|
|
3
|
+
import type { ExecutionResponse } from "@llumiverse/common";
|
|
4
|
+
export interface FilterOption {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ComputeRunFacetsResponse {
|
|
10
|
+
environments?: {
|
|
11
|
+
_id: string;
|
|
12
|
+
count: number;
|
|
13
|
+
}[];
|
|
14
|
+
interactions?: {
|
|
15
|
+
_id: string;
|
|
16
|
+
count: number;
|
|
17
|
+
}[];
|
|
18
|
+
models?: {
|
|
19
|
+
_id: string;
|
|
20
|
+
count: number;
|
|
21
|
+
}[];
|
|
22
|
+
tags?: {
|
|
23
|
+
_id: string;
|
|
24
|
+
count: number;
|
|
25
|
+
}[];
|
|
26
|
+
status?: {
|
|
27
|
+
_id: string;
|
|
28
|
+
count: number;
|
|
29
|
+
}[];
|
|
30
|
+
total?: {
|
|
31
|
+
count: number;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export declare class RunsApi extends ApiTopic {
|
|
35
|
+
constructor(parent: ClientBase);
|
|
36
|
+
/**
|
|
37
|
+
* Get the list of all runs
|
|
38
|
+
* @param project optional project id to filter by
|
|
39
|
+
* @param interaction optional interaction id to filter by
|
|
40
|
+
* @returns InteractionResult[]
|
|
41
|
+
**/
|
|
42
|
+
list({ limit, offset, filters }: RunListingQueryOptions): Promise<ExecutionRunRef[]>;
|
|
43
|
+
find(payload: FindPayload): Promise<ExecutionRun[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Get a run by id
|
|
46
|
+
*
|
|
47
|
+
* @param id
|
|
48
|
+
* @returns InteractionResult
|
|
49
|
+
**/
|
|
50
|
+
retrieve<P = any>(id: string): Promise<ExecutionRun<P>>;
|
|
51
|
+
/**
|
|
52
|
+
* Get filter options for a field
|
|
53
|
+
* return FilterOption[]
|
|
54
|
+
*/
|
|
55
|
+
filterOptions(field: string, filters: RunListingFilters): Promise<FilterOption[]>;
|
|
56
|
+
create(payload: RunCreatePayload): Promise<ExecutionRun>;
|
|
57
|
+
/**
|
|
58
|
+
* Send tool results and continues the conversation
|
|
59
|
+
* @param payload
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
sendToolResults(payload: ToolResultsPayload): Promise<ExecutionResponse>;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param payload
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
sendUserMessage(payload: UserMessagePayload): Promise<ExecutionResponse>;
|
|
69
|
+
createCheckpoint(payload: CheckpointConversationPayload): Promise<ExecutionResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Get the list of all runs facets
|
|
72
|
+
* @param payload query payload to filter facet search
|
|
73
|
+
* @returns ComputeRunFacetsResponse[]
|
|
74
|
+
**/
|
|
75
|
+
computeFacets(query: ComputeRunFacetPayload): Promise<ComputeRunFacetsResponse>;
|
|
76
|
+
search(payload: RunSearchPayload): Promise<ExecutionRunRef[]>;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunsApi.d.ts","sourceRoot":"","sources":["../../src/RunsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,6BAA6B,EAC7B,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACrC,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,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file":"StreamSource.d.ts","sourceRoot":"","sources":["../../src/StreamSource.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACF,MAAM,EAAE,cAAc;IAAS,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC,EAAE,MAAM;IAAS,EAAE,CAAC,EAAE,MAAM;gBAArF,MAAM,EAAE,cAAc,EAAS,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,EAAE,MAAM,YAAA,EAAS,EAAE,CAAC,EAAE,MAAM,YAAA;CAC3G"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
export default class TrainingApi extends ApiTopic {
|
|
5
|
+
constructor(parent: ClientBase);
|
|
6
|
+
listSessions(query?: ListTrainingSessionsQuery): Promise<TrainingSessionRef[]>;
|
|
7
|
+
listSessionNames(query?: ListTrainingSessionsQuery): Promise<{
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[]>;
|
|
11
|
+
createSession(payload: TrainingSessionCreatePayload): Promise<TrainingSession>;
|
|
12
|
+
getSession(sessionId: string): Promise<TrainingSession>;
|
|
13
|
+
addToSession(sessionId: string, runs: string[]): Promise<any>;
|
|
14
|
+
listSessionRuns(sessionId: string, limit?: number, offset?: number): Promise<ExecutionRunRef[]>;
|
|
15
|
+
buildSession(sessionId: string): Promise<any>;
|
|
16
|
+
getDataUrl(sessionId: string): Promise<{
|
|
17
|
+
url: string;
|
|
18
|
+
}>;
|
|
19
|
+
getDataUploadUrl(sessionId: string, isResumable?: boolean): Promise<{
|
|
20
|
+
url: string;
|
|
21
|
+
}>;
|
|
22
|
+
startTraining(sessionId: string): Promise<TrainingJob>;
|
|
23
|
+
cancelTraining(sessionId: string): Promise<TrainingJob>;
|
|
24
|
+
getTrainingJob(jobId: string): Promise<TrainingJob>;
|
|
25
|
+
getAndSyncTrainingJob(jobId: string): Promise<TrainingJob>;
|
|
26
|
+
setDataset(sessionId: string, name?: string): Promise<any>;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrainingApi.d.ts","sourceRoot":"","sources":["../../src/TrainingApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,eAAe,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjJ,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;gBAEjC,MAAM,EAAE,UAAU;IAI9B,YAAY,CAAC,KAAK,GAAE,yBAA8B,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIlF,gBAAgB,CAAC,KAAK,GAAE,yBAA8B,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAIhG,aAAa,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9E,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIvD,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7D,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIvF,YAAY,CAAC,SAAS,EAAE,MAAM;IAI9B,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAIvD,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAKlF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAItD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIvD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAInD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM1D,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;CAIxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsersApi.d.ts","sourceRoot":"","sources":["../../src/UsersApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,QAAQ;gBAE9B,MAAM,EAAE,UAAU;IAI9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK1C"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { AbstractFetchClient } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { AuthTokenPayload, AuthTokenResponse } from "@vertesia/common";
|
|
3
|
+
import AccountApi from "./AccountApi.js";
|
|
4
|
+
import AccountsApi from "./AccountsApi.js";
|
|
5
|
+
import AnalyticsApi from "./AnalyticsApi.js";
|
|
6
|
+
import { ApiKeysApi } from "./ApiKeysApi.js";
|
|
7
|
+
import AppsApi from "./AppsApi.js";
|
|
8
|
+
import CommandsApi from "./CommandsApi.js";
|
|
9
|
+
import EnvironmentsApi from "./EnvironmentsApi.js";
|
|
10
|
+
import { IamApi } from "./IamApi.js";
|
|
11
|
+
import InteractionsApi from "./InteractionsApi.js";
|
|
12
|
+
import ProjectsApi from "./ProjectsApi.js";
|
|
13
|
+
import PromptsApi from "./PromptsApi.js";
|
|
14
|
+
import { RefsApi } from "./RefsApi.js";
|
|
15
|
+
import { RunsApi } from "./RunsApi.js";
|
|
16
|
+
import { ZenoClient } from "./store/client.js";
|
|
17
|
+
import TrainingApi from "./TrainingApi.js";
|
|
18
|
+
import UsersApi from "./UsersApi.js";
|
|
19
|
+
export type VertesiaClientProps = {
|
|
20
|
+
/**
|
|
21
|
+
* The site name of Vertesia.
|
|
22
|
+
*
|
|
23
|
+
* This is used to determine the API backend. It should not include the protocol. For more
|
|
24
|
+
* advanced configurations, use `serverUrl` and `storeUrl` instead.
|
|
25
|
+
*
|
|
26
|
+
* @example api.vertesia.io
|
|
27
|
+
* @example api-preview.vertesia.io
|
|
28
|
+
* @example api-staging.vertesia.io
|
|
29
|
+
* @default api.vertesia.io
|
|
30
|
+
* @since 0.52.0
|
|
31
|
+
*/
|
|
32
|
+
site?: 'api.vertesia.io' | 'api-preview.vertesia.io' | 'api-staging.vertesia.io';
|
|
33
|
+
serverUrl?: string;
|
|
34
|
+
storeUrl?: string;
|
|
35
|
+
apikey?: string;
|
|
36
|
+
projectId?: string;
|
|
37
|
+
sessionTags?: string | string[];
|
|
38
|
+
onRequest?: (request: Request) => void;
|
|
39
|
+
onResponse?: (response: Response) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
42
|
+
/**
|
|
43
|
+
* The JWT token linked to the API KEY (sk or pk)
|
|
44
|
+
*/
|
|
45
|
+
_jwt: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* The store client
|
|
48
|
+
*/
|
|
49
|
+
store: ZenoClient;
|
|
50
|
+
/**
|
|
51
|
+
* The session name will be sent when executing an interaction as a tag
|
|
52
|
+
*/
|
|
53
|
+
sessionTags?: string | string[];
|
|
54
|
+
/**
|
|
55
|
+
* Create a client from the given token.
|
|
56
|
+
* If you already have the decoded token you can pass it as the second argument to avoid decodinf it again.
|
|
57
|
+
*
|
|
58
|
+
* @param token the raw JWT token
|
|
59
|
+
* @param payload the decoded JWT token as an AuthTokenPayload - optional
|
|
60
|
+
*/
|
|
61
|
+
static fromAuthToken(token: string, payload?: AuthTokenPayload): Promise<VertesiaClient>;
|
|
62
|
+
static decodeEndpoints(): void;
|
|
63
|
+
constructor(opts?: VertesiaClientProps);
|
|
64
|
+
withApiVersion(version: string | number | null): this;
|
|
65
|
+
/**
|
|
66
|
+
* Overwrite to keep store and composable clients synchronized on the auth callback
|
|
67
|
+
* @param authCb
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
withAuthCallback(authCb?: (() => Promise<string>) | null): this;
|
|
71
|
+
withApiKey(apiKey: string | null): Promise<this>;
|
|
72
|
+
getRawJWT(): Promise<string | null>;
|
|
73
|
+
getDecodedJWT(): Promise<AuthTokenPayload | null>;
|
|
74
|
+
getProject(): Promise<import("@vertesia/common").ProjectRef | null>;
|
|
75
|
+
getAccount(): Promise<import("@vertesia/common").AccountRef | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Alias for store.workflows
|
|
78
|
+
*/
|
|
79
|
+
get workflows(): import("./index.js").WorkflowsApi;
|
|
80
|
+
/**
|
|
81
|
+
* Alias for store.objects
|
|
82
|
+
*/
|
|
83
|
+
get objects(): import("./index.js").ObjectsApi;
|
|
84
|
+
get files(): import("./store/FilesApi.js").FilesApi;
|
|
85
|
+
/**
|
|
86
|
+
* Alias for store.types
|
|
87
|
+
*/
|
|
88
|
+
get types(): import("./index.js").TypesApi;
|
|
89
|
+
get storeUrl(): string;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* Generate a token for use with other Composable's services
|
|
93
|
+
*
|
|
94
|
+
* @param accountId: selected account to generate the token for
|
|
95
|
+
* @returns AuthTokenResponse
|
|
96
|
+
*/
|
|
97
|
+
getAuthToken(token?: string, accountId?: string): Promise<AuthTokenResponse>;
|
|
98
|
+
get initialHeaders(): {
|
|
99
|
+
"x-api-version": string;
|
|
100
|
+
accept: string;
|
|
101
|
+
};
|
|
102
|
+
projects: ProjectsApi;
|
|
103
|
+
environments: EnvironmentsApi;
|
|
104
|
+
interactions: InteractionsApi;
|
|
105
|
+
prompts: PromptsApi;
|
|
106
|
+
runs: RunsApi;
|
|
107
|
+
account: AccountApi;
|
|
108
|
+
accounts: AccountsApi;
|
|
109
|
+
apikeys: ApiKeysApi;
|
|
110
|
+
analytics: AnalyticsApi;
|
|
111
|
+
training: TrainingApi;
|
|
112
|
+
users: UsersApi;
|
|
113
|
+
iam: IamApi;
|
|
114
|
+
refs: RefsApi;
|
|
115
|
+
commands: CommandsApi;
|
|
116
|
+
apps: AppsApi;
|
|
117
|
+
}
|
|
118
|
+
export declare function decodeJWT(jwt: string): AuthTokenPayload;
|
|
119
|
+
export declare function decodeEndpoints(endpoints: string | Record<string, string> | undefined): Record<string, string>;
|