@vertesia/common 0.67.0 → 0.68.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/access-control.js +7 -5
- package/lib/cjs/access-control.js.map +1 -1
- package/lib/cjs/apikey.js +0 -1
- package/lib/cjs/apikey.js.map +1 -1
- package/lib/cjs/environment.js +24 -96
- package/lib/cjs/environment.js.map +1 -1
- package/lib/cjs/group.js +1 -1
- package/lib/cjs/group.js.map +1 -1
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/store/workflow.js +1 -0
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/esm/access-control.js +7 -5
- package/lib/esm/access-control.js.map +1 -1
- package/lib/esm/apikey.js +0 -1
- package/lib/esm/apikey.js.map +1 -1
- package/lib/esm/environment.js +23 -95
- package/lib/esm/environment.js.map +1 -1
- package/lib/esm/group.js +1 -1
- package/lib/esm/group.js.map +1 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/store/workflow.js +1 -0
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/access-control.d.ts +9 -7
- package/lib/types/access-control.d.ts.map +1 -1
- package/lib/types/apikey.d.ts +0 -1
- package/lib/types/apikey.d.ts.map +1 -1
- package/lib/types/environment.d.ts +22 -18
- package/lib/types/environment.d.ts.map +1 -1
- package/lib/types/group.d.ts +1 -1
- package/lib/types/group.d.ts.map +1 -1
- package/lib/types/interaction.d.ts +5 -33
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/payload.d.ts +4 -1
- package/lib/types/payload.d.ts.map +1 -1
- package/lib/types/query.d.ts +6 -0
- package/lib/types/query.d.ts.map +1 -1
- package/lib/types/refs.d.ts +1 -0
- package/lib/types/refs.d.ts.map +1 -1
- package/lib/types/store/collections.d.ts +1 -0
- package/lib/types/store/collections.d.ts.map +1 -1
- package/lib/types/store/workflow.d.ts +2 -1
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/package.json +1 -1
- package/src/access-control.ts +8 -6
- package/src/apikey.ts +0 -1
- package/src/environment.ts +24 -103
- package/src/group.ts +1 -1
- package/src/interaction.ts +5 -40
- package/src/payload.ts +5 -0
- package/src/query.ts +7 -0
- package/src/refs.ts +1 -0
- package/src/store/collections.ts +1 -0
- package/src/store/workflow.ts +3 -2
package/package.json
CHANGED
package/src/access-control.ts
CHANGED
|
@@ -15,9 +15,11 @@ export enum Permission {
|
|
|
15
15
|
run_read = "run:read",
|
|
16
16
|
run_write = "run:write",
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
env_admin = "environment:admin",
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
project_admin = "project:admin",
|
|
21
|
+
project_integration_read = "project:integration_read",
|
|
22
|
+
project_settings_write = "project:settings_write",
|
|
21
23
|
|
|
22
24
|
api_key_create = "api_key:create",
|
|
23
25
|
api_key_read = "api_key:read",
|
|
@@ -25,19 +27,19 @@ export enum Permission {
|
|
|
25
27
|
api_key_delete = "api_key:delete",
|
|
26
28
|
|
|
27
29
|
account_read = "account:read",
|
|
28
|
-
|
|
30
|
+
account_admin = "account:admin",
|
|
29
31
|
manage_billing = "account:billing",
|
|
30
32
|
account_member = "account:member",
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
content_read = "content:read",
|
|
34
|
-
|
|
35
|
-
content_update = "content:update",
|
|
36
|
+
content_write = "content:write",
|
|
36
37
|
content_delete = "content:delete",
|
|
37
38
|
|
|
38
|
-
content_admin = "content:admin", //manage schemas
|
|
39
|
+
content_admin = "content:admin", //manage schemas
|
|
39
40
|
|
|
40
41
|
workflow_run = "workflow:run",
|
|
42
|
+
workflow_admin = "workflow:admin",
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export enum AccessControlResourceType {
|
package/src/apikey.ts
CHANGED
package/src/environment.ts
CHANGED
|
@@ -1,127 +1,43 @@
|
|
|
1
|
-
import type { AIModel, TextFallbackOptions } from "@llumiverse/common";
|
|
1
|
+
import type { AIModel, ProviderParams, TextFallbackOptions } from "@llumiverse/common";
|
|
2
|
+
import { ProviderList, Providers } from "@llumiverse/common";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
export enum
|
|
5
|
-
// from llumiverse
|
|
6
|
-
openai = 'openai',
|
|
7
|
-
azure_openai = 'azure_openai',
|
|
8
|
-
huggingface_ie = 'huggingface_ie',
|
|
9
|
-
replicate = 'replicate',
|
|
10
|
-
bedrock = 'bedrock',
|
|
11
|
-
vertexai = 'vertexai',
|
|
12
|
-
togetherai = 'togetherai',
|
|
13
|
-
mistralai = 'mistralai',
|
|
14
|
-
groq = 'groq',
|
|
15
|
-
watsonx = 'watsonx',
|
|
16
|
-
// from studio
|
|
4
|
+
// Virtual providers from studio
|
|
5
|
+
export enum CustomProviders {
|
|
17
6
|
virtual_lb = 'virtual_lb',
|
|
18
7
|
virtual_mediator = 'virtual_mediator',
|
|
19
8
|
test = 'test'
|
|
20
9
|
}
|
|
21
10
|
|
|
22
|
-
export
|
|
11
|
+
export type SupportedProviders = Providers | CustomProviders;
|
|
12
|
+
|
|
13
|
+
export const SupportedProviders = {
|
|
14
|
+
...Providers,
|
|
15
|
+
...CustomProviders
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export interface SupportedProviderParams extends Omit<ProviderParams, 'id'> {
|
|
23
19
|
id: SupportedProviders;
|
|
24
|
-
name: string;
|
|
25
|
-
requiresApiKey: boolean;
|
|
26
|
-
requiresEndpointUrl: boolean;
|
|
27
|
-
endpointPlaceholder?: string;
|
|
28
|
-
supportSearch?: boolean;
|
|
29
20
|
}
|
|
30
21
|
|
|
31
|
-
export const
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
id: SupportedProviders.openai,
|
|
35
|
-
name: "OpenAI",
|
|
36
|
-
requiresApiKey: true,
|
|
37
|
-
requiresEndpointUrl: false,
|
|
38
|
-
supportSearch: false,
|
|
39
|
-
},
|
|
40
|
-
'azure_openai':
|
|
41
|
-
{
|
|
42
|
-
id: SupportedProviders.azure_openai,
|
|
43
|
-
name: "Azure OpenAI",
|
|
44
|
-
requiresApiKey: false,
|
|
45
|
-
requiresEndpointUrl: true,
|
|
46
|
-
supportSearch: false,
|
|
47
|
-
},
|
|
48
|
-
'huggingface_ie':
|
|
49
|
-
{
|
|
50
|
-
id: SupportedProviders.huggingface_ie,
|
|
51
|
-
name: "HuggingFace Inference Endpoint",
|
|
52
|
-
requiresApiKey: true,
|
|
53
|
-
requiresEndpointUrl: true,
|
|
54
|
-
},
|
|
55
|
-
'replicate':
|
|
56
|
-
{
|
|
57
|
-
id: SupportedProviders.replicate,
|
|
58
|
-
name: "Repicate",
|
|
59
|
-
requiresApiKey: true,
|
|
60
|
-
requiresEndpointUrl: false,
|
|
61
|
-
supportSearch: true,
|
|
62
|
-
},
|
|
63
|
-
'bedrock':
|
|
64
|
-
{
|
|
65
|
-
id: SupportedProviders.bedrock,
|
|
66
|
-
name: "AWS Bedrock",
|
|
67
|
-
requiresApiKey: false,
|
|
68
|
-
requiresEndpointUrl: false,
|
|
69
|
-
endpointPlaceholder: "region name (eg. us-east-1)",
|
|
70
|
-
supportSearch: false,
|
|
71
|
-
},
|
|
72
|
-
vertexai: {
|
|
73
|
-
id: SupportedProviders.vertexai,
|
|
74
|
-
name: "Google Vertex AI",
|
|
75
|
-
requiresApiKey: false,
|
|
76
|
-
requiresEndpointUrl: false,
|
|
77
|
-
supportSearch: false,
|
|
78
|
-
},
|
|
79
|
-
togetherai: {
|
|
80
|
-
id: SupportedProviders.togetherai,
|
|
81
|
-
name: "Together AI",
|
|
82
|
-
requiresApiKey: false,
|
|
83
|
-
requiresEndpointUrl: false,
|
|
84
|
-
supportSearch: false,
|
|
85
|
-
},
|
|
86
|
-
mistralai: {
|
|
87
|
-
id: SupportedProviders.mistralai,
|
|
88
|
-
name: "Mistral AI",
|
|
89
|
-
requiresApiKey: false,
|
|
90
|
-
requiresEndpointUrl: false,
|
|
91
|
-
supportSearch: false,
|
|
92
|
-
},
|
|
93
|
-
groq: {
|
|
94
|
-
id: SupportedProviders.groq,
|
|
95
|
-
name: "Groq Cloud",
|
|
96
|
-
requiresApiKey: false,
|
|
97
|
-
requiresEndpointUrl: false,
|
|
98
|
-
supportSearch: false,
|
|
99
|
-
},
|
|
100
|
-
watsonx: {
|
|
101
|
-
id: SupportedProviders.watsonx,
|
|
102
|
-
name: "IBM WatsonX",
|
|
103
|
-
requiresApiKey: true,
|
|
104
|
-
requiresEndpointUrl: true,
|
|
105
|
-
supportSearch: false
|
|
106
|
-
},
|
|
107
|
-
'virtual_lb':
|
|
22
|
+
export const CustomProvidersList: Record<CustomProviders, SupportedProviderParams> = {
|
|
23
|
+
virtual_lb:
|
|
108
24
|
{
|
|
109
|
-
id:
|
|
25
|
+
id: CustomProviders.virtual_lb,
|
|
110
26
|
name: "Virtual - Load Balancer",
|
|
111
27
|
requiresApiKey: false,
|
|
112
28
|
requiresEndpointUrl: false,
|
|
113
29
|
supportSearch: false,
|
|
114
30
|
},
|
|
115
|
-
|
|
31
|
+
virtual_mediator:
|
|
116
32
|
{
|
|
117
|
-
id:
|
|
33
|
+
id: CustomProviders.virtual_mediator,
|
|
118
34
|
name: "Virtual - Mediator",
|
|
119
35
|
requiresApiKey: false,
|
|
120
36
|
requiresEndpointUrl: false,
|
|
121
37
|
supportSearch: false,
|
|
122
38
|
},
|
|
123
|
-
|
|
124
|
-
id:
|
|
39
|
+
test: {
|
|
40
|
+
id: CustomProviders.test,
|
|
125
41
|
name: "Test LLM",
|
|
126
42
|
requiresApiKey: false,
|
|
127
43
|
requiresEndpointUrl: false,
|
|
@@ -129,6 +45,11 @@ export const SupportedProvidersList: Record<SupportedProviders, SupportedProvide
|
|
|
129
45
|
},
|
|
130
46
|
};
|
|
131
47
|
|
|
48
|
+
export const SupportedProvidersList: Record<SupportedProviders, SupportedProviderParams> = {
|
|
49
|
+
...ProviderList,
|
|
50
|
+
...CustomProvidersList
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
132
53
|
|
|
133
54
|
export interface VirtualEnvEntry {
|
|
134
55
|
model: string;
|
package/src/group.ts
CHANGED
package/src/interaction.ts
CHANGED
|
@@ -263,7 +263,7 @@ export interface InteractionExecutionPayload {
|
|
|
263
263
|
/**
|
|
264
264
|
* The tools to be used in the execution
|
|
265
265
|
*/
|
|
266
|
-
|
|
266
|
+
tool_definitions?: ToolDefinition[];
|
|
267
267
|
|
|
268
268
|
/**
|
|
269
269
|
* The workflow related to this Interaction Run.
|
|
@@ -283,43 +283,13 @@ export interface NamedInteractionExecutionPayload extends InteractionExecutionPa
|
|
|
283
283
|
// ================= async execution payloads ====================
|
|
284
284
|
export type ToolRef = string | { name: string; description: string };
|
|
285
285
|
|
|
286
|
-
interface AsyncExecutionPayloadBase {
|
|
286
|
+
interface AsyncExecutionPayloadBase extends Omit<NamedInteractionExecutionPayload,"toolDefinitions" | "stream"> {
|
|
287
287
|
type: "conversation" | "interaction";
|
|
288
288
|
|
|
289
289
|
/**
|
|
290
|
-
*
|
|
290
|
+
* An array of endpoint URLs to be notified upon execution
|
|
291
291
|
*/
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* The environment ID to use.
|
|
296
|
-
*/
|
|
297
|
-
environment?: string;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* The model to use
|
|
301
|
-
*/
|
|
302
|
-
model?: string;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* The options to use on the first execution
|
|
306
|
-
*/
|
|
307
|
-
model_options?: ModelOptions;
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* The initial prompt input data
|
|
311
|
-
*/
|
|
312
|
-
prompt_data?: Record<string, any>;
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Optional result schema
|
|
316
|
-
*/
|
|
317
|
-
result_schema?: JSONSchema;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Optional tags to add to the execution run
|
|
321
|
-
*/
|
|
322
|
-
tags?: string[];
|
|
292
|
+
notify_endpoints?: string[];
|
|
323
293
|
}
|
|
324
294
|
|
|
325
295
|
export type ConversationVisibility = 'private' | 'project';
|
|
@@ -337,7 +307,7 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
|
|
|
337
307
|
* The tools to use, list of tool or function names.
|
|
338
308
|
* You can use + and - to add or remove from default, if no sign, then list replaces default
|
|
339
309
|
*/
|
|
340
|
-
|
|
310
|
+
tool_names?: string[];
|
|
341
311
|
|
|
342
312
|
/**
|
|
343
313
|
* The maximum number of iterations in case of a conversation. If <=0 the default of 20 will be used.
|
|
@@ -383,11 +353,6 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
|
|
|
383
353
|
export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
|
|
384
354
|
type: "interaction";
|
|
385
355
|
|
|
386
|
-
/**
|
|
387
|
-
* The tools to use
|
|
388
|
-
*/
|
|
389
|
-
tools?: ToolDefinition[];
|
|
390
|
-
|
|
391
356
|
/**
|
|
392
357
|
* Only used for non conversation workflows to include the error on next retry.
|
|
393
358
|
* If tools is defined this is not used
|
package/src/payload.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FacetSpec } from "./facets.js";
|
|
2
2
|
import {
|
|
3
|
+
ComplexCollectionSearchQuery,
|
|
3
4
|
ComplexSearchQuery,
|
|
4
5
|
InteractionSearchQuery,
|
|
5
6
|
ObjectSearchQuery,
|
|
@@ -43,6 +44,10 @@ export interface RunSearchPayload extends SearchPayload {
|
|
|
43
44
|
query?: RunSearchQuery;
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
export interface ComputeCollectionFacetPayload extends Omit<ComputeFacetPayload, 'query'> {
|
|
48
|
+
query?: ComplexCollectionSearchQuery;
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
export interface ComputeInteractionFacetPayload extends ComputeFacetPayload {
|
|
47
52
|
query?: InteractionSearchQuery;
|
|
48
53
|
}
|
package/src/query.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExecutionRunStatus } from './interaction.js';
|
|
2
2
|
import { SupportedEmbeddingTypes } from './project.js';
|
|
3
|
+
import { CollectionSearchPayload } from './store/collections.js';
|
|
3
4
|
|
|
4
5
|
export interface RunListingQueryOptions {
|
|
5
6
|
project?: string;
|
|
@@ -18,6 +19,7 @@ export interface RunListingFilters {
|
|
|
18
19
|
fromDate?: string,
|
|
19
20
|
toDate?: string,
|
|
20
21
|
parent?: string | false,
|
|
22
|
+
workflow_run_ids?: string[],
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface VectorSearchQuery {
|
|
@@ -77,6 +79,7 @@ export interface RunSearchQuery extends SimpleSearchQuery {
|
|
|
77
79
|
end?: string;
|
|
78
80
|
finish_reason?: string;
|
|
79
81
|
created_by?: string;
|
|
82
|
+
workflow_run_ids?: string[];
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
|
|
@@ -91,4 +94,8 @@ export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
|
|
|
91
94
|
export interface ComplexSearchQuery extends ObjectSearchQuery {
|
|
92
95
|
vector?: VectorSearchQuery;
|
|
93
96
|
match?: Record<string, any>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ComplexCollectionSearchQuery extends CollectionSearchPayload {
|
|
100
|
+
match?: Record<string, any>;
|
|
94
101
|
}
|
package/src/refs.ts
CHANGED
package/src/store/collections.ts
CHANGED
package/src/store/workflow.ts
CHANGED
|
@@ -228,7 +228,7 @@ interface WorkflowRunEvent {
|
|
|
228
228
|
}
|
|
229
229
|
recipient?: {
|
|
230
230
|
workflowId?: string,
|
|
231
|
-
runId?: string
|
|
231
|
+
runId?: string
|
|
232
232
|
},
|
|
233
233
|
initiatedEventId?: string,
|
|
234
234
|
}
|
|
@@ -260,7 +260,7 @@ export interface WorkflowRun {
|
|
|
260
260
|
interaction_name?: string;
|
|
261
261
|
input?: any;
|
|
262
262
|
result?: any;
|
|
263
|
-
error?:any,
|
|
263
|
+
error?: any,
|
|
264
264
|
raw?: any;
|
|
265
265
|
/**
|
|
266
266
|
* The Vertesia Workflow Type of this Workflow Run.
|
|
@@ -376,6 +376,7 @@ export enum AgentMessageType {
|
|
|
376
376
|
QUESTION = "question",
|
|
377
377
|
REQUEST_INPUT = "request_input",
|
|
378
378
|
IDLE = "idle",
|
|
379
|
+
TERMINATED = "terminated",
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
export interface PlanTask {
|