@vertesia/common 0.80.1 → 0.81.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/Progress.js +61 -0
- package/lib/cjs/Progress.js.map +1 -0
- package/lib/cjs/access-control.js +56 -0
- package/lib/cjs/access-control.js.map +1 -0
- package/lib/cjs/analytics.js +3 -0
- package/lib/cjs/analytics.js.map +1 -0
- package/lib/cjs/apikey.js +16 -0
- package/lib/cjs/apikey.js.map +1 -0
- package/lib/cjs/apps.js +3 -0
- package/lib/cjs/apps.js.map +1 -0
- package/lib/cjs/common.js +3 -0
- package/lib/cjs/common.js.map +1 -0
- package/lib/cjs/environment.js +44 -0
- package/lib/cjs/environment.js.map +1 -0
- package/lib/cjs/facets.js +3 -0
- package/lib/cjs/facets.js.map +1 -0
- package/lib/cjs/group.js +5 -0
- package/lib/cjs/group.js.map +1 -0
- package/lib/cjs/index.js +49 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/integrations.js +12 -0
- package/lib/cjs/integrations.js.map +1 -0
- package/lib/cjs/interaction.js +74 -0
- package/lib/cjs/interaction.js.map +1 -0
- package/lib/cjs/json-schema.js +3 -0
- package/lib/cjs/json-schema.js.map +1 -0
- package/lib/cjs/json.js +3 -0
- package/lib/cjs/json.js.map +1 -0
- package/lib/cjs/meters.js +13 -0
- package/lib/cjs/meters.js.map +1 -0
- package/lib/cjs/model_utility.js +6 -0
- package/lib/cjs/model_utility.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/payload.js +3 -0
- package/lib/cjs/payload.js.map +1 -0
- package/lib/cjs/project.js +107 -0
- package/lib/cjs/project.js.map +1 -0
- package/lib/cjs/prompt.js +20 -0
- package/lib/cjs/prompt.js.map +1 -0
- package/lib/cjs/query.js +3 -0
- package/lib/cjs/query.js.map +1 -0
- package/lib/cjs/rate-limiter.js +6 -0
- package/lib/cjs/rate-limiter.js.map +1 -0
- package/lib/cjs/refs.js +14 -0
- package/lib/cjs/refs.js.map +1 -0
- package/lib/cjs/runs.js +3 -0
- package/lib/cjs/runs.js.map +1 -0
- package/lib/cjs/skill.js +14 -0
- package/lib/cjs/skill.js.map +1 -0
- package/lib/cjs/store/activity-catalog.js +3 -0
- package/lib/cjs/store/activity-catalog.js.map +1 -0
- package/lib/cjs/store/collections.js +9 -0
- package/lib/cjs/store/collections.js.map +1 -0
- package/lib/cjs/store/common.js +3 -0
- package/lib/cjs/store/common.js.map +1 -0
- package/lib/cjs/store/doc-analyzer.js +3 -0
- package/lib/cjs/store/doc-analyzer.js.map +1 -0
- package/lib/cjs/store/dsl-workflow.js +5 -0
- package/lib/cjs/store/dsl-workflow.js.map +1 -0
- package/lib/cjs/store/index.js +28 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/object-types.js +98 -0
- package/lib/cjs/store/object-types.js.map +1 -0
- package/lib/cjs/store/signals.js +3 -0
- package/lib/cjs/store/signals.js.map +1 -0
- package/lib/cjs/store/store.js +55 -0
- package/lib/cjs/store/store.js.map +1 -0
- package/lib/cjs/store/temporalio.js +44 -0
- package/lib/cjs/store/temporalio.js.map +1 -0
- package/lib/cjs/store/worker.js +3 -0
- package/lib/cjs/store/worker.js.map +1 -0
- package/lib/cjs/store/workflow.js +49 -0
- package/lib/cjs/store/workflow.js.map +1 -0
- package/lib/cjs/sts-token-types.js +32 -0
- package/lib/cjs/sts-token-types.js.map +1 -0
- package/lib/cjs/tenant.js +3 -0
- package/lib/cjs/tenant.js.map +1 -0
- package/lib/cjs/training.js +14 -0
- package/lib/cjs/training.js.map +1 -0
- package/lib/cjs/transient-tokens.js +9 -0
- package/lib/cjs/transient-tokens.js.map +1 -0
- package/lib/cjs/user.js +17 -0
- package/lib/cjs/user.js.map +1 -0
- package/lib/cjs/utils/auth.js +15 -0
- package/lib/cjs/utils/auth.js.map +1 -0
- package/lib/cjs/utils/schemas.js +114 -0
- package/lib/cjs/utils/schemas.js.map +1 -0
- package/lib/cjs/utils/type-helpers.js +3 -0
- package/lib/cjs/utils/type-helpers.js.map +1 -0
- package/lib/cjs/versions.js +8 -0
- package/lib/cjs/versions.js.map +1 -0
- package/lib/esm/Progress.js +57 -0
- package/lib/esm/Progress.js.map +1 -0
- package/lib/esm/access-control.js +53 -0
- package/lib/esm/access-control.js.map +1 -0
- package/lib/esm/analytics.js +2 -0
- package/lib/esm/analytics.js.map +1 -0
- package/lib/esm/apikey.js +13 -0
- package/lib/esm/apikey.js.map +1 -0
- package/lib/esm/apps.js +2 -0
- package/lib/esm/apps.js.map +1 -0
- package/lib/esm/common.js +2 -0
- package/lib/esm/common.js.map +1 -0
- package/lib/esm/environment.js +41 -0
- package/lib/esm/environment.js.map +1 -0
- package/lib/esm/facets.js +2 -0
- package/lib/esm/facets.js.map +1 -0
- package/lib/esm/group.js +2 -0
- package/lib/esm/group.js.map +1 -0
- package/lib/esm/index.js +33 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/integrations.js +9 -0
- package/lib/esm/integrations.js.map +1 -0
- package/lib/esm/interaction.js +71 -0
- package/lib/esm/interaction.js.map +1 -0
- package/lib/esm/json-schema.js +2 -0
- package/lib/esm/json-schema.js.map +1 -0
- package/lib/esm/json.js +2 -0
- package/lib/esm/json.js.map +1 -0
- package/lib/esm/meters.js +10 -0
- package/lib/esm/meters.js.map +1 -0
- package/lib/esm/model_utility.js +2 -0
- package/lib/esm/model_utility.js.map +1 -0
- package/lib/esm/payload.js +2 -0
- package/lib/esm/payload.js.map +1 -0
- package/lib/esm/project.js +102 -0
- package/lib/esm/project.js.map +1 -0
- package/lib/esm/prompt.js +17 -0
- package/lib/esm/prompt.js.map +1 -0
- package/lib/esm/query.js +2 -0
- package/lib/esm/query.js.map +1 -0
- package/lib/esm/rate-limiter.js +5 -0
- package/lib/esm/rate-limiter.js.map +1 -0
- package/lib/esm/refs.js +11 -0
- package/lib/esm/refs.js.map +1 -0
- package/lib/esm/runs.js +2 -0
- package/lib/esm/runs.js.map +1 -0
- package/lib/esm/skill.js +13 -0
- package/lib/esm/skill.js.map +1 -0
- package/lib/esm/store/activity-catalog.js +2 -0
- package/lib/esm/store/activity-catalog.js.map +1 -0
- package/lib/esm/store/collections.js +6 -0
- package/lib/esm/store/collections.js.map +1 -0
- package/lib/esm/store/common.js +2 -0
- package/lib/esm/store/common.js.map +1 -0
- package/lib/esm/store/doc-analyzer.js +2 -0
- package/lib/esm/store/doc-analyzer.js.map +1 -0
- package/lib/esm/store/dsl-workflow.js +2 -0
- package/lib/esm/store/dsl-workflow.js.map +1 -0
- package/lib/esm/store/index.js +12 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/object-types.js +95 -0
- package/lib/esm/store/object-types.js.map +1 -0
- package/lib/esm/store/signals.js +2 -0
- package/lib/esm/store/signals.js.map +1 -0
- package/lib/esm/store/store.js +52 -0
- package/lib/esm/store/store.js.map +1 -0
- package/lib/esm/store/temporalio.js +41 -0
- package/lib/esm/store/temporalio.js.map +1 -0
- package/lib/esm/store/worker.js +2 -0
- package/lib/esm/store/worker.js.map +1 -0
- package/lib/esm/store/workflow.js +45 -0
- package/lib/esm/store/workflow.js.map +1 -0
- package/lib/esm/sts-token-types.js +24 -0
- package/lib/esm/sts-token-types.js.map +1 -0
- package/lib/esm/tenant.js +2 -0
- package/lib/esm/tenant.js.map +1 -0
- package/lib/esm/training.js +11 -0
- package/lib/esm/training.js.map +1 -0
- package/lib/esm/transient-tokens.js +6 -0
- package/lib/esm/transient-tokens.js.map +1 -0
- package/lib/esm/user.js +14 -0
- package/lib/esm/user.js.map +1 -0
- package/lib/esm/utils/auth.js +11 -0
- package/lib/esm/utils/auth.js.map +1 -0
- package/lib/esm/utils/schemas.js +107 -0
- package/lib/esm/utils/schemas.js.map +1 -0
- package/lib/esm/utils/type-helpers.js +2 -0
- package/lib/esm/utils/type-helpers.js.map +1 -0
- package/lib/esm/versions.js +5 -0
- package/lib/esm/versions.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/Progress.d.ts +21 -0
- package/lib/types/Progress.d.ts.map +1 -0
- package/lib/types/access-control.d.ts +73 -0
- package/lib/types/access-control.d.ts.map +1 -0
- package/lib/types/analytics.d.ts +36 -0
- package/lib/types/analytics.d.ts.map +1 -0
- package/lib/types/apikey.d.ts +80 -0
- package/lib/types/apikey.d.ts.map +1 -0
- package/lib/types/apps.d.ts +102 -0
- package/lib/types/apps.d.ts.map +1 -0
- package/lib/types/common.d.ts +31 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/environment.d.ts +86 -0
- package/lib/types/environment.d.ts.map +1 -0
- package/lib/types/facets.d.ts +34 -0
- package/lib/types/facets.d.ts.map +1 -0
- package/lib/types/group.d.ts +21 -0
- package/lib/types/group.d.ts.map +1 -0
- package/lib/types/index.d.ts +33 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/integrations.d.ts +28 -0
- package/lib/types/integrations.d.ts.map +1 -0
- package/lib/types/interaction.d.ts +726 -0
- package/lib/types/interaction.d.ts.map +1 -0
- package/lib/types/json-schema.d.ts +1 -0
- package/lib/types/json-schema.d.ts.map +1 -0
- package/lib/types/json.d.ts +1 -0
- package/lib/types/json.d.ts.map +1 -0
- package/lib/types/meters.d.ts +23 -0
- package/lib/types/meters.d.ts.map +1 -0
- package/lib/types/model_utility.d.ts +1 -0
- package/lib/types/model_utility.d.ts.map +1 -0
- package/lib/types/payload.d.ts +60 -0
- package/lib/types/payload.d.ts.map +1 -0
- package/lib/types/project.d.ts +173 -0
- package/lib/types/project.d.ts.map +1 -0
- package/lib/types/prompt.d.ts +77 -0
- package/lib/types/prompt.d.ts.map +1 -0
- package/lib/types/query.d.ts +118 -0
- package/lib/types/query.d.ts.map +1 -0
- package/lib/types/rate-limiter.d.ts +28 -0
- package/lib/types/rate-limiter.d.ts.map +1 -0
- package/lib/types/refs.d.ts +22 -0
- package/lib/types/refs.d.ts.map +1 -0
- package/lib/types/runs.d.ts +32 -0
- package/lib/types/runs.d.ts.map +1 -0
- package/lib/types/skill.d.ts +78 -0
- package/lib/types/skill.d.ts.map +1 -0
- package/lib/types/store/activity-catalog.d.ts +26 -0
- package/lib/types/store/activity-catalog.d.ts.map +1 -0
- package/lib/types/store/collections.d.ts +78 -0
- package/lib/types/store/collections.d.ts.map +1 -0
- package/lib/types/store/common.d.ts +22 -0
- package/lib/types/store/common.d.ts.map +1 -0
- package/lib/types/store/doc-analyzer.d.ts +140 -0
- package/lib/types/store/doc-analyzer.d.ts.map +1 -0
- package/lib/types/store/dsl-workflow.d.ts +238 -0
- package/lib/types/store/dsl-workflow.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +11 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/object-types.d.ts +23 -0
- package/lib/types/store/object-types.d.ts.map +1 -0
- package/lib/types/store/signals.d.ts +5 -0
- package/lib/types/store/signals.d.ts.map +1 -0
- package/lib/types/store/store.d.ts +358 -0
- package/lib/types/store/store.d.ts.map +1 -0
- package/lib/types/store/temporalio.d.ts +16 -0
- package/lib/types/store/temporalio.d.ts.map +1 -0
- package/lib/types/store/worker.d.ts +18 -0
- package/lib/types/store/worker.d.ts.map +1 -0
- package/lib/types/store/workflow.d.ts +412 -0
- package/lib/types/store/workflow.d.ts.map +1 -0
- package/lib/types/sts-token-types.d.ts +72 -0
- package/lib/types/sts-token-types.d.ts.map +1 -0
- package/lib/types/tenant.d.ts +10 -0
- package/lib/types/tenant.d.ts.map +1 -0
- package/lib/types/training.d.ts +38 -0
- package/lib/types/training.d.ts.map +1 -0
- package/lib/types/transient-tokens.d.ts +24 -0
- package/lib/types/transient-tokens.d.ts.map +1 -0
- package/lib/types/user.d.ts +108 -0
- package/lib/types/user.d.ts.map +1 -0
- package/lib/types/utils/auth.d.ts +3 -0
- package/lib/types/utils/auth.d.ts.map +1 -0
- package/lib/types/utils/schemas.d.ts +9 -0
- package/lib/types/utils/schemas.d.ts.map +1 -0
- package/lib/types/utils/type-helpers.d.ts +3 -0
- package/lib/types/utils/type-helpers.d.ts.map +1 -0
- package/lib/types/versions.d.ts +3 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/vertesia-common.js +2 -0
- package/lib/vertesia-common.js.map +1 -0
- package/package.json +2 -2
- package/src/apps.ts +5 -3
|
@@ -0,0 +1,726 @@
|
|
|
1
|
+
import type { CompletionResult, JSONObject, JSONSchema, Modalities, ModelOptions, PromptRole, StatelessExecutionOptions, ToolDefinition, ToolUse } from "@llumiverse/common";
|
|
2
|
+
import type { JSONSchema4 } from "json-schema";
|
|
3
|
+
import { ExecutionTokenUsage } from "@llumiverse/common";
|
|
4
|
+
import { ExecutionEnvironmentRef } from "./environment.js";
|
|
5
|
+
import { ProjectRef } from "./project.js";
|
|
6
|
+
import { ExecutablePromptSegmentDef, PopulatedPromptSegmentDef, PromptSegmentDef, PromptTemplateRef, PromptTemplateRefWithSchema, TemplateType } from "./prompt.js";
|
|
7
|
+
import { ExecutionRunDocRef } from "./runs.js";
|
|
8
|
+
import { AccountRef } from "./user.js";
|
|
9
|
+
export interface InteractionExecutionError {
|
|
10
|
+
code: string;
|
|
11
|
+
message: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reference to an interaction in the catalog.
|
|
16
|
+
* Used in catalog listing. The id is composed of the namespace and the interaction name.
|
|
17
|
+
* Stored interactions can use `oid:` prefix.
|
|
18
|
+
* If no prefix is used it fallback on `oid:`.
|
|
19
|
+
*/
|
|
20
|
+
export interface CatalogInteractionRef {
|
|
21
|
+
/**
|
|
22
|
+
* The type of interaction
|
|
23
|
+
*/
|
|
24
|
+
type: "sys" | "app" | "stored" | "draft";
|
|
25
|
+
/**
|
|
26
|
+
* the interaction id that can be used to execute the interaction.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* The interaction name which identify the interaction in the provider interaction list.
|
|
31
|
+
* For the stored interactions this is the same as the endpoint property.
|
|
32
|
+
* For other types of interactions this is the local name of the interaction.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* Only applies for stored interactions. The version of the interaction.
|
|
37
|
+
* Undefined for non stored interactions
|
|
38
|
+
*/
|
|
39
|
+
version?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Only applies for stored interactions. Whether the interaction is published or not.
|
|
42
|
+
*/
|
|
43
|
+
published?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The tags associated with the interaction.
|
|
46
|
+
*/
|
|
47
|
+
tags: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Agent Runner configuration options.
|
|
50
|
+
*/
|
|
51
|
+
agent_runner_options?: AgentRunnerOptions;
|
|
52
|
+
/**
|
|
53
|
+
* The name of the interaction. For display purposes only.
|
|
54
|
+
*/
|
|
55
|
+
title: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional description of the interaction.
|
|
58
|
+
*/
|
|
59
|
+
description?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface InCodePrompt {
|
|
62
|
+
role: PromptRole;
|
|
63
|
+
content: string;
|
|
64
|
+
content_type: TemplateType;
|
|
65
|
+
schema?: JSONSchema;
|
|
66
|
+
/**
|
|
67
|
+
* optional name of the prompt segment. Use kebab case for prompt names
|
|
68
|
+
*/
|
|
69
|
+
name?: string;
|
|
70
|
+
/**
|
|
71
|
+
* optional reference to an external resource if any.
|
|
72
|
+
* Used internally by the system to synchronize stored prompts with in-code prompts.
|
|
73
|
+
*/
|
|
74
|
+
externalId?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface InCodeInteraction {
|
|
77
|
+
/**
|
|
78
|
+
* The interaction type.
|
|
79
|
+
*/
|
|
80
|
+
type: "sys" | "app" | "stored" | "draft";
|
|
81
|
+
/**
|
|
82
|
+
* The id of the interaction. Required.
|
|
83
|
+
* The id is a unique identifier for the interaction.
|
|
84
|
+
* It is recommended to use a URL safe string and not include spaces.
|
|
85
|
+
* The id composaed by some namespace or prefix and the interaction name.
|
|
86
|
+
* Example: sys:generic_question, app:review_contract, tmp:my_temp_interaction
|
|
87
|
+
*/
|
|
88
|
+
id: string;
|
|
89
|
+
/**
|
|
90
|
+
* The interaction code name. Required.
|
|
91
|
+
* Should be a URL safe string and not include spaces. It is recommended to use kebab-case or camel-case.
|
|
92
|
+
* The endpoints must satisfy the following regexp: /^[a-zA-Z0-9-_]+$/. No whitespaces or special characters are allowed.
|
|
93
|
+
*/
|
|
94
|
+
name: string;
|
|
95
|
+
/**
|
|
96
|
+
* Only applies for stored interactions. The version of the interaction.
|
|
97
|
+
* Undefined for non stored interactions
|
|
98
|
+
*/
|
|
99
|
+
version?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Only applies for stored interactions. Whether the interaction is published or not.
|
|
102
|
+
*/
|
|
103
|
+
published?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* A title for the interaction. If not provided, the endpoint will be used.
|
|
106
|
+
*/
|
|
107
|
+
title?: string;
|
|
108
|
+
/**
|
|
109
|
+
* An optional description of the interaction.
|
|
110
|
+
*/
|
|
111
|
+
description?: string;
|
|
112
|
+
/**
|
|
113
|
+
* The JSON schema to be used for the result if any.
|
|
114
|
+
*/
|
|
115
|
+
result_schema?: JSONSchema | SchemaRef;
|
|
116
|
+
/**
|
|
117
|
+
* The modality of the interaction output.
|
|
118
|
+
* If not specified Modalities.Text is assumed.
|
|
119
|
+
*/
|
|
120
|
+
output_modality?: Modalities;
|
|
121
|
+
/**
|
|
122
|
+
* How to store the run data for executions of this interaction.
|
|
123
|
+
* Defaults to STANDARD.
|
|
124
|
+
*/
|
|
125
|
+
storage?: RunDataStorageLevel;
|
|
126
|
+
/**
|
|
127
|
+
* Optional tags for the interaction.
|
|
128
|
+
*/
|
|
129
|
+
tags?: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Agent Runner configuration options.
|
|
132
|
+
*/
|
|
133
|
+
agent_runner_options?: AgentRunnerOptions;
|
|
134
|
+
/**
|
|
135
|
+
* Default options for the model to be used when executing this interaction.
|
|
136
|
+
* (like temperature etc)
|
|
137
|
+
*/
|
|
138
|
+
model_options?: ModelOptions;
|
|
139
|
+
/**
|
|
140
|
+
* The prompts composing the interaction. Required.
|
|
141
|
+
*/
|
|
142
|
+
prompts: InCodePrompt[];
|
|
143
|
+
/**
|
|
144
|
+
* Optional reference to an external resource if any.
|
|
145
|
+
* Used internally by the system to synchronize stored interactions with in-code interactions.
|
|
146
|
+
*/
|
|
147
|
+
externalId?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Runtime configuration (system use only)
|
|
150
|
+
*
|
|
151
|
+
* This field is populated by the system when converting stored interactions
|
|
152
|
+
* and contains runtime-specific defaults like target model/environment IDs.
|
|
153
|
+
*
|
|
154
|
+
* DO NOT set this field manually when writing interaction definitions.
|
|
155
|
+
* These values are environment-specific and not portable.
|
|
156
|
+
*
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
runtime?: {
|
|
160
|
+
/**
|
|
161
|
+
* Default target environment for the interaction execution
|
|
162
|
+
*/
|
|
163
|
+
environment?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Default (recommended) target model for the interaction execution
|
|
166
|
+
*/
|
|
167
|
+
model?: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export interface InteractionSpec extends Omit<InCodeInteraction, 'id' | 'runtime' | 'type' | 'published' | 'version'> {
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The payload to query the interaction endpoints
|
|
174
|
+
*/
|
|
175
|
+
export interface InteractionEndpointQuery {
|
|
176
|
+
limit?: number;
|
|
177
|
+
offset?: number;
|
|
178
|
+
status?: InteractionStatus;
|
|
179
|
+
visibility?: InteractionVisibility;
|
|
180
|
+
version?: number;
|
|
181
|
+
tags?: string[];
|
|
182
|
+
/**
|
|
183
|
+
* Filter by interaction endpoint name to include only the specified endpoints
|
|
184
|
+
* * If both includes and excludes are specified then only the includes filter will be used.
|
|
185
|
+
*/
|
|
186
|
+
includes?: string[];
|
|
187
|
+
/**
|
|
188
|
+
* Filter by interaction endpoint name to excludes the specified endpoints.
|
|
189
|
+
* If both includes and excludes are specified then only the includes filter will be used.
|
|
190
|
+
*/
|
|
191
|
+
excludes?: string[];
|
|
192
|
+
/**
|
|
193
|
+
* Whether or not to return the parameters schema.
|
|
194
|
+
* The parameters schema is an array of JSON schemas.
|
|
195
|
+
* Each schema is a JSON schema that describes the parameters of an interaction prompt.
|
|
196
|
+
*/
|
|
197
|
+
include_params_schema?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Whether or not to return the result schema
|
|
200
|
+
*/
|
|
201
|
+
include_result_schema?: boolean;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* A description of an interaction endpoint.
|
|
205
|
+
*/
|
|
206
|
+
export interface InteractionEndpoint {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
endpoint: string;
|
|
210
|
+
description?: string;
|
|
211
|
+
status: InteractionStatus;
|
|
212
|
+
visibility?: InteractionVisibility;
|
|
213
|
+
version: number;
|
|
214
|
+
tags: string[];
|
|
215
|
+
agent_runner_options?: AgentRunnerOptions;
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
218
|
+
*/
|
|
219
|
+
output_modality?: Modalities;
|
|
220
|
+
result_schema?: JSONSchema;
|
|
221
|
+
params_schema?: JSONSchema;
|
|
222
|
+
}
|
|
223
|
+
export interface InteractionTags {
|
|
224
|
+
tag: string;
|
|
225
|
+
count: number;
|
|
226
|
+
interactions: InteractionRef[];
|
|
227
|
+
}
|
|
228
|
+
export interface InteractionRef {
|
|
229
|
+
id: string;
|
|
230
|
+
name: string;
|
|
231
|
+
endpoint: string;
|
|
232
|
+
parent?: string;
|
|
233
|
+
description?: string;
|
|
234
|
+
status: InteractionStatus;
|
|
235
|
+
visibility?: InteractionVisibility;
|
|
236
|
+
version: number;
|
|
237
|
+
tags: string[];
|
|
238
|
+
agent_runner_options?: AgentRunnerOptions;
|
|
239
|
+
prompts?: PromptSegmentDef<PromptTemplateRef>[];
|
|
240
|
+
updated_at: Date;
|
|
241
|
+
}
|
|
242
|
+
export declare const InteractionRefPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts";
|
|
243
|
+
export declare const InteractionRefWithSchemaPopulate = "id name endpoint parent description status version visibility tags agent_runner_options updated_at prompts result_schema";
|
|
244
|
+
export interface InteractionRefWithSchema extends Omit<InteractionRef, "prompts"> {
|
|
245
|
+
result_schema?: JSONSchema4;
|
|
246
|
+
prompts?: PromptSegmentDef<PromptTemplateRefWithSchema>[];
|
|
247
|
+
}
|
|
248
|
+
export interface InteractionsExportPayload {
|
|
249
|
+
/**
|
|
250
|
+
* The name of the interaction. If not specified all the interactions in the current project will be exported
|
|
251
|
+
*/
|
|
252
|
+
name?: string;
|
|
253
|
+
tags?: string[];
|
|
254
|
+
versions?: (number | "draft" | "latest")[];
|
|
255
|
+
}
|
|
256
|
+
export declare enum InteractionStatus {
|
|
257
|
+
draft = "draft",
|
|
258
|
+
published = "published",
|
|
259
|
+
archived = "archived"
|
|
260
|
+
}
|
|
261
|
+
export declare enum ExecutionRunStatus {
|
|
262
|
+
created = "created",
|
|
263
|
+
processing = "processing",
|
|
264
|
+
completed = "completed",
|
|
265
|
+
failed = "failed"
|
|
266
|
+
}
|
|
267
|
+
export declare enum RunDataStorageLevel {
|
|
268
|
+
STANDARD = "STANDARD",
|
|
269
|
+
RESTRICTED = "RESTRICTED",
|
|
270
|
+
DEBUG = "DEBUG"
|
|
271
|
+
}
|
|
272
|
+
export declare enum RunDataStorageDescription {
|
|
273
|
+
STANDARD = "Run data is stored for both the model inputs and output.",
|
|
274
|
+
RESTRICTED = "No run data is stored for the model inputs \u2014 only the model output.",
|
|
275
|
+
DEBUG = "Run data is stored for the model inputs and output, schema, and final prompt."
|
|
276
|
+
}
|
|
277
|
+
export declare const RunDataStorageOptions: Record<RunDataStorageLevel, RunDataStorageDescription>;
|
|
278
|
+
/**
|
|
279
|
+
* Schema can be stored or specified as a reference to an external schema.
|
|
280
|
+
* We only support "store:" references for now
|
|
281
|
+
*/
|
|
282
|
+
export interface SchemaRef {
|
|
283
|
+
$uri: string;
|
|
284
|
+
}
|
|
285
|
+
export interface CachePolicy {
|
|
286
|
+
type: "cache" | "no_cache" | "cache_and_refresh";
|
|
287
|
+
refresh_probability: number;
|
|
288
|
+
varies_on: string[];
|
|
289
|
+
ttl: number;
|
|
290
|
+
}
|
|
291
|
+
export type InteractionVisibility = "public" | "private";
|
|
292
|
+
export interface InteractionData {
|
|
293
|
+
readonly id: string;
|
|
294
|
+
name: string;
|
|
295
|
+
endpoint: string;
|
|
296
|
+
description?: string;
|
|
297
|
+
project: string | ProjectRef;
|
|
298
|
+
tags: string[];
|
|
299
|
+
agent_runner_options?: AgentRunnerOptions;
|
|
300
|
+
result_schema?: JSONSchema4 | SchemaRef;
|
|
301
|
+
environment?: string | ExecutionEnvironmentRef;
|
|
302
|
+
model?: string;
|
|
303
|
+
model_options?: ModelOptions;
|
|
304
|
+
restriction?: RunDataStorageLevel;
|
|
305
|
+
/**
|
|
306
|
+
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
307
|
+
*/
|
|
308
|
+
output_modality?: Modalities;
|
|
309
|
+
}
|
|
310
|
+
export interface Interaction extends InteractionData {
|
|
311
|
+
status: InteractionStatus;
|
|
312
|
+
parent?: string;
|
|
313
|
+
visibility: InteractionVisibility;
|
|
314
|
+
version: number;
|
|
315
|
+
test_data?: JSONObject;
|
|
316
|
+
interaction_schema?: JSONSchema4 | SchemaRef;
|
|
317
|
+
cache_policy?: CachePolicy;
|
|
318
|
+
prompts: PromptSegmentDef[];
|
|
319
|
+
last_published_at?: Date;
|
|
320
|
+
created_by: string;
|
|
321
|
+
updated_by: string;
|
|
322
|
+
created_at: Date;
|
|
323
|
+
updated_at: Date;
|
|
324
|
+
}
|
|
325
|
+
export interface PopulatedInteraction extends Omit<Interaction, "prompts"> {
|
|
326
|
+
prompts: PopulatedPromptSegmentDef[];
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Used to describe an interaction that can be executed. Contains only the interaction data useful
|
|
330
|
+
* to execute the interaction plus the prompt templates
|
|
331
|
+
*/
|
|
332
|
+
export interface ExecutableInteraction extends InteractionData {
|
|
333
|
+
prompts: ExecutablePromptSegmentDef[];
|
|
334
|
+
}
|
|
335
|
+
export interface InteractionCreatePayload extends Omit<Interaction, "id" | "created_at" | "updated_at" | "created_by" | "updated_by" | "project" | "formatter" | "tags" | "parent" | "version" | "visibility" | "endpoint"> {
|
|
336
|
+
visibility?: InteractionVisibility;
|
|
337
|
+
tags?: string[];
|
|
338
|
+
}
|
|
339
|
+
export interface InteractionUpdatePayload extends Partial<Omit<Interaction, "result_schema" | "id" | "created_at" | "updated_at" | "created_by" | "updated_by" | "project">> {
|
|
340
|
+
result_schema?: JSONSchema4 | null;
|
|
341
|
+
}
|
|
342
|
+
export interface InteractionPublishPayload {
|
|
343
|
+
visibility?: InteractionVisibility;
|
|
344
|
+
tags?: string[];
|
|
345
|
+
}
|
|
346
|
+
export interface InteractionForkPayload {
|
|
347
|
+
keepTags?: boolean;
|
|
348
|
+
forkPrompts?: boolean;
|
|
349
|
+
targetProject?: string;
|
|
350
|
+
}
|
|
351
|
+
export interface InteractionExecutionPayload {
|
|
352
|
+
/**
|
|
353
|
+
* If a `@memory` property exists on the input data then the value will be used as the value of a memory pack location.
|
|
354
|
+
* and the other properties of the data will contain the memory pack mapping.
|
|
355
|
+
*/
|
|
356
|
+
data?: Record<string, any> | `memory:${string}`;
|
|
357
|
+
config?: InteractionExecutionConfiguration;
|
|
358
|
+
result_schema?: JSONSchema4 | null;
|
|
359
|
+
stream?: boolean;
|
|
360
|
+
do_validate?: boolean;
|
|
361
|
+
tags?: string | string[];
|
|
362
|
+
/**
|
|
363
|
+
* The conversation state to be used in the execution if any.
|
|
364
|
+
* If the `true` is passed then the conversation will be returned in the result.
|
|
365
|
+
* The true value must be used for the first execution that starts the conversation.
|
|
366
|
+
* If conversation is falsy then no conversation is returned back.
|
|
367
|
+
* For regular executions the conversation is not returned back to save memory.
|
|
368
|
+
*/
|
|
369
|
+
conversation?: true | unknown;
|
|
370
|
+
/**
|
|
371
|
+
* The tools to be used in the execution
|
|
372
|
+
*/
|
|
373
|
+
tool_definitions?: ToolDefinition[];
|
|
374
|
+
/**
|
|
375
|
+
* The workflow related to this Interaction Run.
|
|
376
|
+
*/
|
|
377
|
+
workflow?: ExecutionRunWorkflow;
|
|
378
|
+
/**
|
|
379
|
+
* Only used by ad-hoc interactions which defines the prompt in the execution payload itself
|
|
380
|
+
* These are temporary interactions using "tmp:" suffix.
|
|
381
|
+
*/
|
|
382
|
+
prompts?: InCodePrompt[];
|
|
383
|
+
}
|
|
384
|
+
export interface NamedInteractionExecutionPayload extends InteractionExecutionPayload {
|
|
385
|
+
/**
|
|
386
|
+
* The interaction name and suffixed by an optional tag or version separated from the name using a @ character
|
|
387
|
+
* If no version/tag part is specified then the latest version is used.
|
|
388
|
+
* Example: ReviewContract, ReviewContract@draft, ReviewContract@1, ReviewContract@some-tag
|
|
389
|
+
*/
|
|
390
|
+
interaction: string;
|
|
391
|
+
}
|
|
392
|
+
export type ToolRef = string | {
|
|
393
|
+
name: string;
|
|
394
|
+
description: string;
|
|
395
|
+
};
|
|
396
|
+
interface AsyncExecutionPayloadBase extends Omit<NamedInteractionExecutionPayload, "toolDefinitions" | "stream"> {
|
|
397
|
+
type: "conversation" | "interaction";
|
|
398
|
+
/**
|
|
399
|
+
* An array of endpoint URLs to be notified upon execution
|
|
400
|
+
*/
|
|
401
|
+
notify_endpoints?: string[];
|
|
402
|
+
task_queue?: string;
|
|
403
|
+
}
|
|
404
|
+
export type ConversationVisibility = 'private' | 'project';
|
|
405
|
+
/**
|
|
406
|
+
* Defines the scope for agent search operations.
|
|
407
|
+
*/
|
|
408
|
+
export declare enum AgentSearchScope {
|
|
409
|
+
/**
|
|
410
|
+
* Search is scoped to a specific collection.
|
|
411
|
+
*/
|
|
412
|
+
Collection = "collection"
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Context triggers for auto-injection of skills.
|
|
416
|
+
* When these conditions match, the skill is automatically injected into the agent context.
|
|
417
|
+
*/
|
|
418
|
+
export interface SkillContextTriggers {
|
|
419
|
+
/**
|
|
420
|
+
* Keywords in user input that should trigger this skill
|
|
421
|
+
*/
|
|
422
|
+
keywords?: string[];
|
|
423
|
+
/**
|
|
424
|
+
* If these tools are being used, suggest this skill
|
|
425
|
+
*/
|
|
426
|
+
tool_names?: string[];
|
|
427
|
+
/**
|
|
428
|
+
* Regex patterns to match against input data
|
|
429
|
+
*/
|
|
430
|
+
data_patterns?: string[];
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Configuration options for Agent Runner functionality.
|
|
434
|
+
* These options control how interactions are exposed and executed in the Agent Runner.
|
|
435
|
+
*/
|
|
436
|
+
export interface AgentRunnerOptions {
|
|
437
|
+
/**
|
|
438
|
+
* Whether this interaction is an agent (executable in Agent Runner).
|
|
439
|
+
*/
|
|
440
|
+
is_agent?: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Whether this interaction is available as a tool (sub-agent).
|
|
443
|
+
*/
|
|
444
|
+
is_tool?: boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Whether this interaction is a skill (provides instructions without execution).
|
|
447
|
+
* Skills are injected into the agent's context based on context_triggers.
|
|
448
|
+
*/
|
|
449
|
+
is_skill?: boolean;
|
|
450
|
+
/**
|
|
451
|
+
* Context triggers for auto-injection of this skill.
|
|
452
|
+
* Only used when is_skill is true.
|
|
453
|
+
*/
|
|
454
|
+
context_triggers?: SkillContextTriggers;
|
|
455
|
+
/**
|
|
456
|
+
* Injection priority for skills (higher = more likely to be selected when multiple match).
|
|
457
|
+
* Only used when is_skill is true.
|
|
458
|
+
*/
|
|
459
|
+
skill_priority?: number;
|
|
460
|
+
/**
|
|
461
|
+
* Array of default tool names available to this agent.
|
|
462
|
+
* For interactions: defines default tools.
|
|
463
|
+
* For execution payloads: you can use + and - to add or remove from default,
|
|
464
|
+
* if no sign, then list replaces default.
|
|
465
|
+
*/
|
|
466
|
+
tool_names?: string[];
|
|
467
|
+
/**
|
|
468
|
+
* On which scope should the search be applied by the search_tool.
|
|
469
|
+
* Only supports 'collection' scope or undefined for now.
|
|
470
|
+
*/
|
|
471
|
+
search_scope?: AgentSearchScope;
|
|
472
|
+
/**
|
|
473
|
+
* The ID of the collection to restrict agent operations to.
|
|
474
|
+
* When specified, the agent's search and retrieval operations are limited to documents
|
|
475
|
+
* within this collection'.
|
|
476
|
+
*/
|
|
477
|
+
collection_id?: string;
|
|
478
|
+
}
|
|
479
|
+
export interface AsyncConversationExecutionPayload extends AsyncExecutionPayloadBase {
|
|
480
|
+
type: "conversation";
|
|
481
|
+
/**
|
|
482
|
+
* Visibility determine if the conversation should be seen by the user only or by anyone with access to the project
|
|
483
|
+
* If not specified, the default is project
|
|
484
|
+
**/
|
|
485
|
+
visibility?: ConversationVisibility;
|
|
486
|
+
/**
|
|
487
|
+
* The tools to use, list of tool or function names.
|
|
488
|
+
* You can use + and - to add or remove from default, if no sign, then list replaces default
|
|
489
|
+
*/
|
|
490
|
+
tool_names?: string[];
|
|
491
|
+
/**
|
|
492
|
+
* The maximum number of iterations in case of a conversation. If <=0 the default of 20 will be used.
|
|
493
|
+
*/
|
|
494
|
+
max_iterations?: number;
|
|
495
|
+
/**
|
|
496
|
+
* Whether the conversation should be interactive or not
|
|
497
|
+
*/
|
|
498
|
+
interactive?: boolean;
|
|
499
|
+
/**
|
|
500
|
+
* Whether to disable the generation of interaction tools or not.
|
|
501
|
+
*/
|
|
502
|
+
disable_interaction_tools?: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* On which scope should the searched by applied, by the search_tool.
|
|
505
|
+
* Only supports collection scope or null for now.
|
|
506
|
+
*/
|
|
507
|
+
search_scope?: AgentSearchScope.Collection;
|
|
508
|
+
/**
|
|
509
|
+
* The collection in which this workflow is executing
|
|
510
|
+
*/
|
|
511
|
+
collection_id?: string;
|
|
512
|
+
/**
|
|
513
|
+
* The token threshold in thousands (K) for creating checkpoints.
|
|
514
|
+
* If total tokens exceed this value, a checkpoint will be created.
|
|
515
|
+
* If not specified, default value of 150K tokens will be used.
|
|
516
|
+
*/
|
|
517
|
+
checkpoint_tokens?: number;
|
|
518
|
+
/** In child execution workflow, this is the curent task_id */
|
|
519
|
+
task_id?: string;
|
|
520
|
+
/** Whether to enable debug mode */
|
|
521
|
+
debug_mode?: boolean;
|
|
522
|
+
/** Maximum depth for nested conversations to prevent infinite recursion (default: 5) */
|
|
523
|
+
max_nested_conversation_depth?: number;
|
|
524
|
+
}
|
|
525
|
+
export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
|
|
526
|
+
type: "interaction";
|
|
527
|
+
/**
|
|
528
|
+
* Only used for non conversation workflows to include the error on next retry.
|
|
529
|
+
* If tools is defined this is not used
|
|
530
|
+
*/
|
|
531
|
+
include_previous_error?: boolean;
|
|
532
|
+
}
|
|
533
|
+
export type AsyncExecutionPayload = AsyncConversationExecutionPayload | AsyncInteractionExecutionPayload;
|
|
534
|
+
interface ResumeConversationPayload {
|
|
535
|
+
run: ExecutionRunDocRef;
|
|
536
|
+
environment: string;
|
|
537
|
+
options: StatelessExecutionOptions;
|
|
538
|
+
conversation: unknown;
|
|
539
|
+
tools: ToolDefinition[];
|
|
540
|
+
}
|
|
541
|
+
export interface ToolResultContent {
|
|
542
|
+
content: string;
|
|
543
|
+
is_error: boolean;
|
|
544
|
+
files?: string[];
|
|
545
|
+
/**
|
|
546
|
+
* Can contain metadata returned by the tool executor.
|
|
547
|
+
*/
|
|
548
|
+
meta?: Record<string, any>;
|
|
549
|
+
}
|
|
550
|
+
export interface ToolResult extends ToolResultContent {
|
|
551
|
+
tool_use_id: string;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* The payload to sent the tool responses back to the target LLM
|
|
555
|
+
*/
|
|
556
|
+
export interface ToolResultsPayload extends ResumeConversationPayload {
|
|
557
|
+
results: ToolResult[];
|
|
558
|
+
}
|
|
559
|
+
export interface UserMessagePayload extends ResumeConversationPayload {
|
|
560
|
+
message: string;
|
|
561
|
+
}
|
|
562
|
+
export type CheckpointConversationPayload = Omit<ToolResultsPayload, "results" | "tools">;
|
|
563
|
+
export declare enum RunSourceTypes {
|
|
564
|
+
api = "api",
|
|
565
|
+
cli = "cli",
|
|
566
|
+
ui = "ui",
|
|
567
|
+
webhook = "webhook",
|
|
568
|
+
test = "test-data",
|
|
569
|
+
system = "system"
|
|
570
|
+
}
|
|
571
|
+
export interface RunSource {
|
|
572
|
+
type: RunSourceTypes;
|
|
573
|
+
label: string;
|
|
574
|
+
principal_type: "user" | "apikey";
|
|
575
|
+
principal_id: string;
|
|
576
|
+
client_ip: string;
|
|
577
|
+
}
|
|
578
|
+
export interface BaseExecutionRun<P = any> {
|
|
579
|
+
readonly id: string;
|
|
580
|
+
/**
|
|
581
|
+
* Only used by runs that were created by a virtual run to point toward the virtual run parent
|
|
582
|
+
*/
|
|
583
|
+
parent?: string | ExecutionRun;
|
|
584
|
+
evaluation?: {
|
|
585
|
+
score?: number;
|
|
586
|
+
selected?: boolean;
|
|
587
|
+
scores?: Record<string, number>;
|
|
588
|
+
};
|
|
589
|
+
result: CompletionResult[];
|
|
590
|
+
/**
|
|
591
|
+
* The parameters used to create the interaction.
|
|
592
|
+
* If the parameters contains the special property "@memory" it will be used
|
|
593
|
+
* to locate a memory pack and the other properties will be used as the memory pack mapping.
|
|
594
|
+
*/
|
|
595
|
+
parameters: P;
|
|
596
|
+
tags?: string[];
|
|
597
|
+
interaction?: string | Interaction;
|
|
598
|
+
interaction_code?: string;
|
|
599
|
+
environment: ExecutionEnvironmentRef;
|
|
600
|
+
modelId: string;
|
|
601
|
+
result_schema: JSONSchema4;
|
|
602
|
+
ttl: number;
|
|
603
|
+
status: ExecutionRunStatus;
|
|
604
|
+
finish_reason?: string;
|
|
605
|
+
prompt: any;
|
|
606
|
+
token_use?: ExecutionTokenUsage;
|
|
607
|
+
chunks?: number;
|
|
608
|
+
execution_time?: number;
|
|
609
|
+
created_at: Date;
|
|
610
|
+
updated_at: Date;
|
|
611
|
+
account: AccountRef;
|
|
612
|
+
project: ProjectRef;
|
|
613
|
+
config: InteractionExecutionConfiguration;
|
|
614
|
+
error?: InteractionExecutionError;
|
|
615
|
+
source: RunSource;
|
|
616
|
+
/**
|
|
617
|
+
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
618
|
+
*/
|
|
619
|
+
output_modality?: Modalities;
|
|
620
|
+
created_by: string;
|
|
621
|
+
updated_by: string;
|
|
622
|
+
/**
|
|
623
|
+
* The Vertesia Workflow related to this Interaction Run.
|
|
624
|
+
*
|
|
625
|
+
* This is only set when the interaction is executed as part of a workflow.
|
|
626
|
+
*
|
|
627
|
+
* @since 0.60.0
|
|
628
|
+
*/
|
|
629
|
+
workflow?: ExecutionRunWorkflow;
|
|
630
|
+
}
|
|
631
|
+
export interface ExecutionRun<P = any> extends BaseExecutionRun<P> {
|
|
632
|
+
interaction?: Interaction;
|
|
633
|
+
}
|
|
634
|
+
export interface PopulatedExecutionRun<P = any> extends BaseExecutionRun<P> {
|
|
635
|
+
interaction?: Interaction;
|
|
636
|
+
}
|
|
637
|
+
export interface ExecutionRunWorkflow {
|
|
638
|
+
/**
|
|
639
|
+
* The Temporal Workflow Run ID related to this Interaction Run.
|
|
640
|
+
*
|
|
641
|
+
* A Run ID is a globally unique, platform-level identifier for a Workflow Execution.
|
|
642
|
+
*
|
|
643
|
+
* @example 01970d37-a890-70c0-9f44-1256d063e69a
|
|
644
|
+
* @see https://docs.temporal.io/workflow-execution/workflowid-runid
|
|
645
|
+
*/
|
|
646
|
+
run_id: string;
|
|
647
|
+
/**
|
|
648
|
+
* The Temporal Workflow ID related to this Interaction Run.
|
|
649
|
+
*
|
|
650
|
+
* @example Standard Document Intake:6834841e4f828d4e36192796
|
|
651
|
+
* @see https://docs.temporal.io/workflow-execution/workflowid-runid
|
|
652
|
+
*/
|
|
653
|
+
workflow_id: string;
|
|
654
|
+
/**
|
|
655
|
+
* The Temporal Activity Type used for executing this Interaction. Undefined if the interaction
|
|
656
|
+
* was not executed as part of a workflow (such as Agent Runner).
|
|
657
|
+
*
|
|
658
|
+
* @example generateDocumentProperties
|
|
659
|
+
*/
|
|
660
|
+
activity_type?: string;
|
|
661
|
+
}
|
|
662
|
+
export interface PromptModalities {
|
|
663
|
+
hasVideo: boolean;
|
|
664
|
+
hasImage: boolean;
|
|
665
|
+
}
|
|
666
|
+
export interface InteractionExecutionResult<P = any> extends ExecutionRun<P> {
|
|
667
|
+
tool_use?: ToolUse[];
|
|
668
|
+
conversation?: unknown;
|
|
669
|
+
options?: StatelessExecutionOptions;
|
|
670
|
+
}
|
|
671
|
+
export interface ExecutionRunRef extends Omit<ExecutionRun, "result" | "parameters" | "interaction"> {
|
|
672
|
+
interaction?: InteractionRef;
|
|
673
|
+
interaction_code?: string;
|
|
674
|
+
}
|
|
675
|
+
export declare const ExecutionRunRefSelect = "-result -parameters -result_schema -prompt";
|
|
676
|
+
export declare enum ConfigModes {
|
|
677
|
+
RUN_AND_INTERACTION_CONFIG = "RUN_AND_INTERACTION_CONFIG",
|
|
678
|
+
RUN_CONFIG_ONLY = "RUN_CONFIG_ONLY",
|
|
679
|
+
INTERACTION_CONFIG_ONLY = "INTERACTION_CONFIG_ONLY"
|
|
680
|
+
}
|
|
681
|
+
export declare enum ConfigModesDescription {
|
|
682
|
+
RUN_AND_INTERACTION_CONFIG = "This run configuration is used. Undefined options are filled with interaction configuration.",
|
|
683
|
+
RUN_CONFIG_ONLY = "Only this run configuration is used. Undefined options remain undefined.",
|
|
684
|
+
INTERACTION_CONFIG_ONLY = "Only interaction configuration is used."
|
|
685
|
+
}
|
|
686
|
+
export declare const ConfigModesOptions: Record<ConfigModes, ConfigModesDescription>;
|
|
687
|
+
export interface InteractionExecutionConfiguration {
|
|
688
|
+
environment?: string;
|
|
689
|
+
model?: string;
|
|
690
|
+
do_validate?: boolean;
|
|
691
|
+
run_data?: RunDataStorageLevel;
|
|
692
|
+
configMode?: ConfigModes;
|
|
693
|
+
model_options?: ModelOptions;
|
|
694
|
+
}
|
|
695
|
+
export interface GenerateInteractionPayload {
|
|
696
|
+
description: string;
|
|
697
|
+
config: InteractionExecutionConfiguration;
|
|
698
|
+
}
|
|
699
|
+
export interface GenerateTestDataPayload {
|
|
700
|
+
message?: string;
|
|
701
|
+
count?: number;
|
|
702
|
+
config: InteractionExecutionConfiguration;
|
|
703
|
+
}
|
|
704
|
+
export interface ImprovePromptPayloadConfig {
|
|
705
|
+
config: InteractionExecutionConfiguration;
|
|
706
|
+
}
|
|
707
|
+
export interface ImprovePromptPayload extends ImprovePromptPayloadConfig {
|
|
708
|
+
interaction_name: string;
|
|
709
|
+
context?: string;
|
|
710
|
+
prompt: {
|
|
711
|
+
name: string;
|
|
712
|
+
content: string;
|
|
713
|
+
}[];
|
|
714
|
+
result_schema?: JSONSchema;
|
|
715
|
+
}
|
|
716
|
+
export interface RateLimitRequestPayload {
|
|
717
|
+
interaction: string;
|
|
718
|
+
environment_id?: string;
|
|
719
|
+
model_id?: string;
|
|
720
|
+
workflow_run_id?: string;
|
|
721
|
+
modalities?: PromptModalities;
|
|
722
|
+
}
|
|
723
|
+
export interface RateLimitRequestResponse {
|
|
724
|
+
delay_ms: number;
|
|
725
|
+
}
|
|
726
|
+
export {};
|