@wix/auto_sdk_forms_interactive-form-sessions 1.0.2 → 1.0.4
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/build/cjs/index.d.ts +18 -9
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +274 -162
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +202 -117
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +18 -9
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +274 -162
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +202 -117
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +18 -9
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +274 -162
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +202 -117
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +18 -9
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +274 -162
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +202 -117
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/meta.d.mts
CHANGED
|
@@ -1,446 +1,531 @@
|
|
|
1
1
|
import { CreateInteractiveFormSessionRequest as CreateInteractiveFormSessionRequest$1, CreateInteractiveFormSessionResponse as CreateInteractiveFormSessionResponse$1, CreateInteractiveFormSessionStreamedRequest as CreateInteractiveFormSessionStreamedRequest$1, CreateInteractiveFormSessionStreamedResponse as CreateInteractiveFormSessionStreamedResponse$1, SendUserMessageRequest as SendUserMessageRequest$1, SendUserMessageResponse as SendUserMessageResponse$1, SendUserMessageStreamedRequest as SendUserMessageStreamedRequest$1, SendUserMessageStreamedResponse as SendUserMessageStreamedResponse$1 } from './index.typings.mjs';
|
|
2
2
|
import '@wix/sdk-types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* An interactive form session enables AI-powered conversational form completion.
|
|
6
|
+
* The session maintains conversation context and tracks form data extraction throughout
|
|
7
|
+
* the user's interaction with the AI assistant.
|
|
8
|
+
*/
|
|
4
9
|
interface InteractiveFormSession {
|
|
5
10
|
/**
|
|
6
|
-
*
|
|
11
|
+
* Interactive form session ID.
|
|
7
12
|
* @format GUID
|
|
8
13
|
* @readonly
|
|
9
14
|
*/
|
|
10
15
|
id?: string;
|
|
11
16
|
/**
|
|
12
|
-
* Form
|
|
17
|
+
* Form ID.
|
|
13
18
|
* @format GUID
|
|
14
19
|
*/
|
|
15
20
|
formId?: string;
|
|
16
21
|
}
|
|
17
22
|
interface CreateInteractiveFormSessionRequest {
|
|
18
23
|
/**
|
|
19
|
-
*
|
|
24
|
+
* Form ID to create an interactive session for.
|
|
20
25
|
* @format GUID
|
|
21
26
|
*/
|
|
22
27
|
formId: string;
|
|
23
28
|
/**
|
|
24
|
-
* ID
|
|
29
|
+
* Custom prompt ID to use for the AI assistant's conversation style and behavior.
|
|
30
|
+
* When not provided, uses the form's default chat settings configured in the Chat Settings API.
|
|
25
31
|
* @format GUID
|
|
26
32
|
*/
|
|
27
33
|
promptId?: string | null;
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* For example
|
|
32
|
-
*
|
|
33
|
-
* it will override the existing value.
|
|
35
|
+
* Pre-filled values to apply to the form, to initialize the session with existing data.
|
|
36
|
+
* Field keys must match the form schema field names.
|
|
37
|
+
* For example: `{"firstName": "John", "email": "john@example.com", "age": 25}`.
|
|
38
|
+
* These values are merged with any data extracted during the conversation.
|
|
34
39
|
*/
|
|
35
40
|
currentValues?: Record<string, any> | null;
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
42
|
+
* Whether the session should run in dry run mode for testing and preview purposes.
|
|
43
|
+
* In dry run mode, the full conversational flow works normally and form data is extracted,
|
|
44
|
+
* but no actual form submission occurs.
|
|
38
45
|
* @immutable
|
|
39
46
|
*/
|
|
40
47
|
dryRun?: boolean;
|
|
41
48
|
/**
|
|
42
|
-
*
|
|
49
|
+
* Deprecated, use `clientTime` instead.
|
|
43
50
|
* @minLength 1
|
|
44
51
|
* @maxLength 200
|
|
45
52
|
*/
|
|
46
53
|
currentTime?: string | null;
|
|
47
|
-
/** Current date-time of api client */
|
|
54
|
+
/** Current date-time of api client. */
|
|
48
55
|
clientTime?: ClientTime;
|
|
49
56
|
}
|
|
50
57
|
interface ClientTime {
|
|
51
58
|
/**
|
|
52
|
-
* Current date
|
|
59
|
+
* Current date and time in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) UTC format.
|
|
60
|
+
* For example, `2023-10-01T12:00:00Z`.
|
|
53
61
|
* @minLength 1
|
|
54
62
|
* @maxLength 200
|
|
55
63
|
*/
|
|
56
64
|
currentTime?: string | null;
|
|
57
65
|
/**
|
|
58
|
-
*
|
|
66
|
+
* Caller's timezone identifier for localizing date and time values in IANA timezone format (for example, `Europe/Vilnius`, `America/New_York`).
|
|
59
67
|
* @minLength 1
|
|
60
68
|
* @maxLength 50
|
|
61
69
|
*/
|
|
62
70
|
timeZone?: string | null;
|
|
63
71
|
}
|
|
64
72
|
interface CreateInteractiveFormSessionResponse {
|
|
65
|
-
/**
|
|
73
|
+
/** Created interactive form session. */
|
|
66
74
|
interactiveFormSession?: InteractiveFormSession;
|
|
67
|
-
/**
|
|
75
|
+
/** AI assistant response chunks for the interactive form session. */
|
|
68
76
|
responseChunks?: InteractiveFormSessionResponseChunk[];
|
|
69
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* AI assistant response chunk, containing different types of conversational content.
|
|
80
|
+
* Chunks are delivered sequentially and must be processed in order to build the complete
|
|
81
|
+
* conversation interface. Each chunk type requires different UI handling.
|
|
82
|
+
*/
|
|
70
83
|
interface InteractiveFormSessionResponseChunk extends InteractiveFormSessionResponseChunkOfOneOf {
|
|
71
|
-
/**
|
|
84
|
+
/** Conversational text message for display to the user. */
|
|
72
85
|
textDetails?: TextDetails;
|
|
73
|
-
/**
|
|
86
|
+
/** Structured data extracted from user input and mapped to specific form fields. */
|
|
74
87
|
textDataDetails?: TextDataDetails;
|
|
75
|
-
/**
|
|
88
|
+
/** Selector for selecting multiple options from a predefined list. */
|
|
76
89
|
multiSelectInputDetails?: MultiSelectInputDetails;
|
|
77
|
-
/**
|
|
90
|
+
/** Selector for numeric input with optional range and validation constraints. */
|
|
78
91
|
numberInputDetails?: NumberInputDetails;
|
|
79
|
-
/**
|
|
92
|
+
/** Visual separator element for organizing conversation flow. */
|
|
80
93
|
separatorDetails?: SeparatorDetails;
|
|
81
|
-
/**
|
|
94
|
+
/** Selector for selecting a single option from a predefined list. */
|
|
82
95
|
singleSelectInputDetails?: SingleSelectInputDetails;
|
|
83
|
-
/**
|
|
96
|
+
/** Error information when processing fails or validation errors occur. */
|
|
84
97
|
errorDetails?: ErrorDetails;
|
|
85
|
-
/** Form submission
|
|
98
|
+
/** Form submission confirmation containing form submission ID and ecom checkout ID, if relevant. */
|
|
86
99
|
submissionDetails?: SubmissionDetails;
|
|
87
|
-
/** Important information
|
|
100
|
+
/** Important contextual information that may influence data extraction or user decisions. */
|
|
88
101
|
importantTextDetails?: ImportantTextDetails;
|
|
89
|
-
/**
|
|
102
|
+
/** Diagnostic information for development, debugging, and performance monitoring. */
|
|
90
103
|
debugDetails?: DebugDetails;
|
|
91
|
-
/**
|
|
104
|
+
/** Stream completion signal indicating no more chunks will be sent in this response. */
|
|
92
105
|
endOfResponseDetails?: EndOfResponseDetails;
|
|
93
|
-
/**
|
|
106
|
+
/** Input for file upload with field targeting. Not supported. */
|
|
94
107
|
fileUploadDetails?: FileUploadDetails;
|
|
95
|
-
/**
|
|
108
|
+
/** Input for digital signature capture with field targeting. Not supported. */
|
|
96
109
|
signatureDetails?: SignatureDetails;
|
|
97
|
-
/**
|
|
110
|
+
/** Response chunk type, that determines how the content should be processed and displayed. */
|
|
98
111
|
chunkType?: ChunkTypeWithLiterals;
|
|
99
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Indicates which portion of the original user input was meaningful for data extraction.
|
|
114
|
+
* Can be used to highlight relevant parts of the user's message in the UI.
|
|
115
|
+
*/
|
|
100
116
|
meaningfulInput?: MeaningfulInput;
|
|
101
117
|
}
|
|
102
118
|
/** @oneof */
|
|
103
119
|
interface InteractiveFormSessionResponseChunkOfOneOf {
|
|
104
|
-
/**
|
|
120
|
+
/** Conversational text message for display to the user. */
|
|
105
121
|
textDetails?: TextDetails;
|
|
106
|
-
/**
|
|
122
|
+
/** Structured data extracted from user input and mapped to specific form fields. */
|
|
107
123
|
textDataDetails?: TextDataDetails;
|
|
108
|
-
/**
|
|
124
|
+
/** Selector for selecting multiple options from a predefined list. */
|
|
109
125
|
multiSelectInputDetails?: MultiSelectInputDetails;
|
|
110
|
-
/**
|
|
126
|
+
/** Selector for numeric input with optional range and validation constraints. */
|
|
111
127
|
numberInputDetails?: NumberInputDetails;
|
|
112
|
-
/**
|
|
128
|
+
/** Visual separator element for organizing conversation flow. */
|
|
113
129
|
separatorDetails?: SeparatorDetails;
|
|
114
|
-
/**
|
|
130
|
+
/** Selector for selecting a single option from a predefined list. */
|
|
115
131
|
singleSelectInputDetails?: SingleSelectInputDetails;
|
|
116
|
-
/**
|
|
132
|
+
/** Error information when processing fails or validation errors occur. */
|
|
117
133
|
errorDetails?: ErrorDetails;
|
|
118
|
-
/** Form submission
|
|
134
|
+
/** Form submission confirmation containing form submission ID and ecom checkout ID, if relevant. */
|
|
119
135
|
submissionDetails?: SubmissionDetails;
|
|
120
|
-
/** Important information
|
|
136
|
+
/** Important contextual information that may influence data extraction or user decisions. */
|
|
121
137
|
importantTextDetails?: ImportantTextDetails;
|
|
122
|
-
/**
|
|
138
|
+
/** Diagnostic information for development, debugging, and performance monitoring. */
|
|
123
139
|
debugDetails?: DebugDetails;
|
|
124
|
-
/**
|
|
140
|
+
/** Stream completion signal indicating no more chunks will be sent in this response. */
|
|
125
141
|
endOfResponseDetails?: EndOfResponseDetails;
|
|
126
|
-
/**
|
|
142
|
+
/** Input for file upload with field targeting. Not supported. */
|
|
127
143
|
fileUploadDetails?: FileUploadDetails;
|
|
128
|
-
/**
|
|
144
|
+
/** Input for digital signature capture with field targeting. Not supported. */
|
|
129
145
|
signatureDetails?: SignatureDetails;
|
|
130
146
|
}
|
|
131
147
|
declare enum ChunkType {
|
|
148
|
+
/** Unknown chunk type. */
|
|
132
149
|
UNKNOWN_CHUNK_TYPE = "UNKNOWN_CHUNK_TYPE",
|
|
133
|
-
/** Text
|
|
150
|
+
/** Text message for display to the user. */
|
|
134
151
|
TEXT = "TEXT",
|
|
135
|
-
/**
|
|
152
|
+
/** Structured data extracted from user input and mapped to form fields. */
|
|
136
153
|
TEXT_DATA = "TEXT_DATA",
|
|
137
|
-
/**
|
|
154
|
+
/** Selector for selecting multiple options from a list. */
|
|
138
155
|
MULTI_SELECT_INPUT = "MULTI_SELECT_INPUT",
|
|
139
|
-
/**
|
|
156
|
+
/** Selector for numeric input with optional validation. */
|
|
140
157
|
NUMBER_INPUT = "NUMBER_INPUT",
|
|
158
|
+
/** Visual separator element such as paragraph breaks. */
|
|
141
159
|
SEPARATOR = "SEPARATOR",
|
|
142
|
-
/**
|
|
160
|
+
/** Selector for selecting one option from a list. */
|
|
143
161
|
SINGLE_SELECT_INPUT = "SINGLE_SELECT_INPUT",
|
|
144
|
-
/**
|
|
162
|
+
/** Error message when processing fails or validation errors occur. */
|
|
145
163
|
ERROR = "ERROR",
|
|
146
|
-
/** Form submission
|
|
164
|
+
/** Form submission confirmation with submission ID and checkout ID, if relevant. */
|
|
147
165
|
SUBMISSION = "SUBMISSION",
|
|
148
|
-
/**
|
|
166
|
+
/** Highlighted information that may influence form data extraction. */
|
|
149
167
|
IMPORTANT_TEXT = "IMPORTANT_TEXT",
|
|
150
|
-
/**
|
|
168
|
+
/** Diagnostic information for troubleshooting and development. */
|
|
151
169
|
DEBUG = "DEBUG",
|
|
152
|
-
/**
|
|
170
|
+
/** Signals the completion of a response stream. */
|
|
153
171
|
END_OF_RESPONSE = "END_OF_RESPONSE",
|
|
154
|
-
/**
|
|
172
|
+
/** Input for file upload. Not supported. */
|
|
155
173
|
FILE_UPLOAD = "FILE_UPLOAD",
|
|
156
|
-
/**
|
|
174
|
+
/** Input for digital signature capture. Not supported. */
|
|
157
175
|
SIGNATURE = "SIGNATURE"
|
|
158
176
|
}
|
|
159
177
|
/** @enumType */
|
|
160
178
|
type ChunkTypeWithLiterals = ChunkType | 'UNKNOWN_CHUNK_TYPE' | 'TEXT' | 'TEXT_DATA' | 'MULTI_SELECT_INPUT' | 'NUMBER_INPUT' | 'SEPARATOR' | 'SINGLE_SELECT_INPUT' | 'ERROR' | 'SUBMISSION' | 'IMPORTANT_TEXT' | 'DEBUG' | 'END_OF_RESPONSE' | 'FILE_UPLOAD' | 'SIGNATURE';
|
|
179
|
+
/** Conversational text content from the AI assistant. */
|
|
161
180
|
interface TextDetails {
|
|
162
181
|
/**
|
|
163
|
-
* Text content to display
|
|
182
|
+
* Text content to display to the user.
|
|
164
183
|
* @minLength 1
|
|
165
184
|
* @maxLength 10000
|
|
166
185
|
*/
|
|
167
186
|
text?: string;
|
|
168
|
-
/**
|
|
187
|
+
/** Text formatting style for visual presentation. */
|
|
169
188
|
style?: StyleWithLiterals;
|
|
170
189
|
}
|
|
171
190
|
declare enum Style {
|
|
191
|
+
/** Unknown text style. */
|
|
172
192
|
UNKNOWN_STYLE = "UNKNOWN_STYLE",
|
|
193
|
+
/** Regular conversational text. */
|
|
173
194
|
NORMAL = "NORMAL",
|
|
195
|
+
/** Bold text for emphasis. */
|
|
174
196
|
BOLD = "BOLD"
|
|
175
197
|
}
|
|
176
198
|
/** @enumType */
|
|
177
199
|
type StyleWithLiterals = Style | 'UNKNOWN_STYLE' | 'NORMAL' | 'BOLD';
|
|
200
|
+
/** Structured data extracted from user input and mapped to form fields. */
|
|
178
201
|
interface TextDataDetails {
|
|
179
202
|
/**
|
|
180
|
-
*
|
|
203
|
+
* Form field identifier that this extracted data maps to.
|
|
204
|
+
* Matches a field name in the form schema.
|
|
181
205
|
* @minLength 1
|
|
182
206
|
* @maxLength 200
|
|
183
207
|
*/
|
|
184
208
|
fieldTarget?: string;
|
|
185
209
|
/**
|
|
186
|
-
*
|
|
210
|
+
* Human-readable text representation of the extracted data to display to the user.
|
|
187
211
|
* @minLength 1
|
|
188
212
|
* @maxLength 10000
|
|
189
213
|
*/
|
|
190
214
|
text?: string;
|
|
191
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* Structured value for form submission (for example, boolean `true`/`false`, number, or string).
|
|
217
|
+
* This is the actual data value that will be submitted with the form.
|
|
218
|
+
*/
|
|
192
219
|
value?: any;
|
|
193
220
|
/**
|
|
194
|
-
* User
|
|
221
|
+
* User-friendly display representation of the value (for example, "Yes"/"No" for boolean, "25 years old" for age).
|
|
222
|
+
* Use this to display confirmation of what was extracted from the user's input.
|
|
195
223
|
* @minLength 1
|
|
196
224
|
* @maxLength 10000
|
|
197
225
|
*/
|
|
198
226
|
displayValue?: string;
|
|
199
227
|
}
|
|
228
|
+
/** Interactive prompt for selecting multiple options from a predefined list. */
|
|
200
229
|
interface MultiSelectInputDetails {
|
|
201
230
|
/**
|
|
202
|
-
*
|
|
231
|
+
* Form field identifier for the multi-select input.
|
|
203
232
|
* @minLength 1
|
|
204
233
|
* @maxLength 200
|
|
205
234
|
*/
|
|
206
235
|
fieldTarget?: string;
|
|
207
236
|
/**
|
|
208
|
-
* Options available for selection
|
|
237
|
+
* Options available for selection, when relevant. Users can choose multiple options from this list.
|
|
209
238
|
* @minSize 1
|
|
210
239
|
* @maxSize 100
|
|
211
240
|
*/
|
|
212
241
|
options?: Option[];
|
|
213
|
-
/**
|
|
242
|
+
/** When present, allows users to provide custom values not in the predefined options list. */
|
|
214
243
|
allowedCustomValue?: CustomValue;
|
|
215
244
|
}
|
|
245
|
+
/** Selection option for input prompts. */
|
|
216
246
|
interface Option {
|
|
217
247
|
/**
|
|
218
|
-
* Value to be submitted
|
|
248
|
+
* Value to be submitted when this option is selected.
|
|
249
|
+
* This is the technical value used in form processing and submission.
|
|
219
250
|
* @minLength 1
|
|
220
251
|
* @maxLength 10000
|
|
221
252
|
*/
|
|
222
253
|
value?: string;
|
|
223
254
|
/**
|
|
224
|
-
*
|
|
255
|
+
* Human-readable label displayed to the user for this option.
|
|
225
256
|
* @minLength 1
|
|
226
257
|
* @maxLength 10000
|
|
227
258
|
*/
|
|
228
259
|
label?: string;
|
|
229
260
|
}
|
|
261
|
+
/** Custom value configuration for input prompts. */
|
|
230
262
|
interface CustomValue {
|
|
231
263
|
/**
|
|
232
|
-
* Description of expected custom value
|
|
264
|
+
* Description of the expected custom value format or content.
|
|
265
|
+
* Displayed to guide users when they choose to provide a custom option.
|
|
233
266
|
* @maxLength 10000
|
|
234
267
|
*/
|
|
235
268
|
description?: string;
|
|
236
269
|
}
|
|
270
|
+
/** Interactive prompt for numeric input with validation constraints. */
|
|
237
271
|
interface NumberInputDetails {
|
|
238
272
|
/**
|
|
239
|
-
*
|
|
273
|
+
* Form field identifier for the numeric input.
|
|
240
274
|
* @minLength 1
|
|
241
275
|
* @maxLength 200
|
|
242
276
|
*/
|
|
243
277
|
fieldTarget?: string;
|
|
244
|
-
/**
|
|
278
|
+
/** Minimum and maximum value constraints for the numeric input. */
|
|
245
279
|
rangeLimit?: NumberRangeLimit;
|
|
246
|
-
/**
|
|
280
|
+
/**
|
|
281
|
+
* When provided, restricts input to multiples of this value.
|
|
282
|
+
* For example, `2.5` would allow 2.5, 5.0, 7.5, and so on.
|
|
283
|
+
*/
|
|
247
284
|
multipleOf?: number | null;
|
|
248
285
|
}
|
|
286
|
+
/** Numeric range constraints for number input validation. */
|
|
249
287
|
interface NumberRangeLimit extends NumberRangeLimitEndOneOf {
|
|
250
|
-
/** Maximum value
|
|
288
|
+
/** Maximum allowed value (inclusive). */
|
|
251
289
|
maxInclusiveValue?: number | null;
|
|
252
|
-
/** Maximum value
|
|
290
|
+
/** Maximum allowed value (exclusive). */
|
|
253
291
|
maxExclusiveValue?: number | null;
|
|
254
|
-
/** Minimum value
|
|
292
|
+
/** Minimum allowed value (inclusive). */
|
|
255
293
|
minInclusiveValue?: number | null;
|
|
256
294
|
}
|
|
257
295
|
/** @oneof */
|
|
258
296
|
interface NumberRangeLimitEndOneOf {
|
|
259
|
-
/** Maximum value
|
|
297
|
+
/** Maximum allowed value (inclusive). */
|
|
260
298
|
maxInclusiveValue?: number | null;
|
|
261
|
-
/** Maximum value
|
|
299
|
+
/** Maximum allowed value (exclusive). */
|
|
262
300
|
maxExclusiveValue?: number | null;
|
|
263
301
|
}
|
|
302
|
+
/** Visual separator element for organizing conversation flow. */
|
|
264
303
|
interface SeparatorDetails {
|
|
265
|
-
/** Type of separator
|
|
304
|
+
/** Type of visual separator to display in the conversation flow. */
|
|
266
305
|
type?: TypeWithLiterals;
|
|
267
306
|
}
|
|
268
307
|
declare enum Type {
|
|
308
|
+
/** Unknown separator type. */
|
|
269
309
|
UNKNOWN_TYPE = "UNKNOWN_TYPE",
|
|
310
|
+
/** Paragraph break for visual content separation. */
|
|
270
311
|
PARAGRAPH = "PARAGRAPH"
|
|
271
312
|
}
|
|
272
313
|
/** @enumType */
|
|
273
314
|
type TypeWithLiterals = Type | 'UNKNOWN_TYPE' | 'PARAGRAPH';
|
|
315
|
+
/** Selector for selecting a single option from a predefined list. */
|
|
274
316
|
interface SingleSelectInputDetails {
|
|
275
317
|
/**
|
|
276
|
-
*
|
|
318
|
+
* Form field identifier for the single-select input.
|
|
277
319
|
* @minLength 1
|
|
278
320
|
* @maxLength 200
|
|
279
321
|
*/
|
|
280
322
|
fieldTarget?: string;
|
|
281
323
|
/**
|
|
282
|
-
* Options available for selection
|
|
324
|
+
* Options available for selection. Users can choose only one option from this list.
|
|
283
325
|
* @minSize 1
|
|
284
326
|
* @maxSize 100
|
|
285
327
|
*/
|
|
286
328
|
options?: Option[];
|
|
287
|
-
/**
|
|
329
|
+
/** When present, allows users to provide a custom value not in the predefined options list. */
|
|
288
330
|
allowedCustomValue?: CustomValue;
|
|
289
331
|
}
|
|
332
|
+
/** Error information when processing fails or validation errors occur. */
|
|
290
333
|
interface ErrorDetails {
|
|
291
334
|
/**
|
|
292
|
-
* Error message
|
|
335
|
+
* Error message detailing what went wrong during processing.
|
|
336
|
+
* For display to the user when the AI cannot process their input or when validation fails.
|
|
293
337
|
* @minLength 1
|
|
294
338
|
* @maxLength 1000
|
|
295
339
|
*/
|
|
296
340
|
messageText?: string;
|
|
297
341
|
}
|
|
342
|
+
/** Form submission confirmation containing submission and checkout information. */
|
|
298
343
|
interface SubmissionDetails {
|
|
299
344
|
/**
|
|
300
|
-
*
|
|
345
|
+
* Form submission ID created when the form is successfully completed and submitted.
|
|
301
346
|
* @format GUID
|
|
302
347
|
*/
|
|
303
348
|
submissionId?: string;
|
|
304
349
|
/**
|
|
305
|
-
*
|
|
350
|
+
* Wix eCommerce checkout ID when the form includes payment processing.
|
|
351
|
+
* Only present for forms that have payment fields or are connected to eCommerce flows.
|
|
306
352
|
* @format GUID
|
|
307
353
|
* @readonly
|
|
308
354
|
*/
|
|
309
355
|
checkoutId?: string | null;
|
|
310
356
|
}
|
|
357
|
+
/** Important contextual information that may influence data extraction or user decisions. */
|
|
311
358
|
interface ImportantTextDetails {
|
|
312
359
|
/**
|
|
313
|
-
*
|
|
360
|
+
* Form field identifier that this important information relates to.
|
|
314
361
|
* @minLength 1
|
|
315
362
|
* @maxLength 200
|
|
316
363
|
*/
|
|
317
364
|
fieldTarget?: string;
|
|
318
365
|
/**
|
|
319
|
-
* Important
|
|
366
|
+
* Important contextual information to highlight for the user.
|
|
367
|
+
* This might include validation requirements, format expectations, or clarifying questions.
|
|
320
368
|
* @minLength 1
|
|
321
369
|
* @maxLength 10000
|
|
322
370
|
*/
|
|
323
371
|
text?: string;
|
|
324
372
|
}
|
|
373
|
+
/** Diagnostic information for development and troubleshooting. */
|
|
325
374
|
interface DebugDetails {
|
|
326
|
-
/**
|
|
375
|
+
/**
|
|
376
|
+
* Diagnostic data for development and troubleshooting.
|
|
377
|
+
* Contains information such as AI tools called, processing times, and internal state.
|
|
378
|
+
*/
|
|
327
379
|
data?: Record<string, any> | null;
|
|
328
380
|
}
|
|
381
|
+
/** Stream completion signal indicating the end of a response stream. */
|
|
329
382
|
interface EndOfResponseDetails {
|
|
330
|
-
/**
|
|
383
|
+
/**
|
|
384
|
+
* Whether the response stream completed successfully.
|
|
385
|
+
* When `false`, there may have been processing errors or interruptions.
|
|
386
|
+
*/
|
|
331
387
|
success?: boolean;
|
|
332
388
|
}
|
|
389
|
+
/** Interactive prompt for file upload input. */
|
|
333
390
|
interface FileUploadDetails {
|
|
334
391
|
/**
|
|
335
|
-
*
|
|
392
|
+
* Form field identifier for the file upload input.
|
|
336
393
|
* @minLength 1
|
|
337
394
|
* @maxLength 200
|
|
338
395
|
*/
|
|
339
396
|
fieldTarget?: string;
|
|
340
397
|
}
|
|
398
|
+
/** Interactive prompt for digital signature capture. */
|
|
341
399
|
interface SignatureDetails {
|
|
342
400
|
/**
|
|
343
|
-
*
|
|
401
|
+
* Form field identifier for the digital signature input.
|
|
344
402
|
* @minLength 1
|
|
345
403
|
* @maxLength 200
|
|
346
404
|
*/
|
|
347
405
|
fieldTarget?: string;
|
|
348
406
|
}
|
|
407
|
+
/** Indicates which portion of user input was meaningful for data extraction. */
|
|
349
408
|
interface MeaningfulInput {
|
|
350
409
|
/**
|
|
351
|
-
* Character
|
|
410
|
+
* Character position (0-indexed) where the meaningful portion of user input begins.
|
|
352
411
|
* @max 10000
|
|
353
412
|
*/
|
|
354
413
|
startOffset?: number;
|
|
355
414
|
/**
|
|
356
|
-
* Length of the meaningful
|
|
415
|
+
* Length in characters of the meaningful portion of user input.
|
|
416
|
+
* Use this with `startOffset` to highlight the relevant text that was processed for data extraction.
|
|
357
417
|
* @max 10000
|
|
358
418
|
*/
|
|
359
419
|
length?: number;
|
|
360
420
|
}
|
|
361
421
|
interface CreateInteractiveFormSessionStreamedRequest {
|
|
362
422
|
/**
|
|
363
|
-
*
|
|
423
|
+
* Form ID to create an interactive session for.
|
|
364
424
|
* @format GUID
|
|
365
425
|
*/
|
|
366
426
|
formId: string;
|
|
367
427
|
/**
|
|
368
|
-
* ID
|
|
428
|
+
* Custom prompt ID to use for the AI assistant's conversation style and behavior.
|
|
429
|
+
* When not provided, uses the form's default chat settings configured in the Chat Settings API.
|
|
369
430
|
* @format GUID
|
|
370
431
|
*/
|
|
371
432
|
promptId?: string | null;
|
|
372
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Pre-filled values to apply to the form, to initialize the session with existing data.
|
|
435
|
+
* Field keys must match the form schema field names.
|
|
436
|
+
* For example: `{"firstName": "John", "email": "john@example.com", "age": 25}`.
|
|
437
|
+
* These values are merged with any data extracted during the conversation.
|
|
438
|
+
*/
|
|
373
439
|
currentValues?: Record<string, any> | null;
|
|
374
440
|
/**
|
|
375
|
-
*
|
|
441
|
+
* Whether the session should run in dry run mode when no actual form submission occurs.
|
|
442
|
+
* In dry run mode, the full conversational flow works normally and form data is extracted,
|
|
443
|
+
* but no actual form submission occurs.
|
|
444
|
+
*
|
|
445
|
+
* Default: `false`
|
|
376
446
|
* @immutable
|
|
377
447
|
*/
|
|
378
448
|
dryRun?: boolean;
|
|
379
449
|
/**
|
|
380
|
-
* Current date
|
|
450
|
+
* Current date and time in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) UTC format.
|
|
451
|
+
* For example, `2023-10-01T12:00:00Z`.
|
|
452
|
+
* If not provided, server time is used.
|
|
381
453
|
* @minLength 1
|
|
382
454
|
* @maxLength 200
|
|
383
455
|
*/
|
|
384
456
|
currentTime?: string | null;
|
|
385
|
-
/**
|
|
457
|
+
/** Caller's local date and time. */
|
|
386
458
|
clientTime?: ClientTime;
|
|
387
459
|
}
|
|
388
460
|
interface CreateInteractiveFormSessionStreamedResponse {
|
|
389
|
-
/**
|
|
461
|
+
/**
|
|
462
|
+
* AI assistant response chunk, streamed in real-time.
|
|
463
|
+
* Process each chunk as it arrives to provide progressive user feedback.
|
|
464
|
+
*/
|
|
390
465
|
responseChunk?: InteractiveFormSessionResponseChunk;
|
|
391
|
-
/**
|
|
466
|
+
/**
|
|
467
|
+
* Information about the created interactive form session.
|
|
468
|
+
* Only included in the first chunk of the stream to provide session details immediately.
|
|
469
|
+
*/
|
|
392
470
|
interactiveFormSession?: InteractiveFormSession;
|
|
393
471
|
}
|
|
394
472
|
interface SendUserMessageRequest {
|
|
395
473
|
/**
|
|
396
|
-
* Interactive form session
|
|
474
|
+
* Interactive form session ID to send the message to.
|
|
397
475
|
* @format GUID
|
|
398
476
|
*/
|
|
399
477
|
interactiveFormSessionId: string;
|
|
400
478
|
/**
|
|
401
|
-
* User
|
|
479
|
+
* User's natural language input.
|
|
480
|
+
* The AI assistant analyzes this text to extract form field data and determine the next conversation step.
|
|
481
|
+
* Maximum length: 10,000 characters.
|
|
402
482
|
* @maxLength 10000
|
|
403
483
|
*/
|
|
404
484
|
input?: string | null;
|
|
405
485
|
/**
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
* "
|
|
410
|
-
* it will override the existing value.
|
|
486
|
+
* Form field values to apply to the session.
|
|
487
|
+
* Use this to update form data from other sources while the conversation is ongoing.
|
|
488
|
+
* These values override any existing data for the same field keys.
|
|
489
|
+
* For example: `{"lastName": "Smith", "phoneNumber": "+1234567890"}`.
|
|
411
490
|
*/
|
|
412
491
|
currentValues?: Record<string, any> | null;
|
|
413
492
|
}
|
|
414
493
|
interface SendUserMessageResponse {
|
|
415
|
-
/**
|
|
494
|
+
/** Updated interactive form session after the user input is processed. */
|
|
416
495
|
interactiveFormSession?: InteractiveFormSession;
|
|
417
|
-
/**
|
|
496
|
+
/**
|
|
497
|
+
* AI assistant response chunks generated from processing the user's message.
|
|
498
|
+
* These can include extracted data, follow-up questions, input prompts, or submission confirmation.
|
|
499
|
+
*/
|
|
418
500
|
responseChunks?: InteractiveFormSessionResponseChunk[];
|
|
419
501
|
}
|
|
420
502
|
interface SendUserMessageStreamedRequest {
|
|
421
503
|
/**
|
|
422
|
-
* Interactive form session
|
|
504
|
+
* Interactive form session ID to send the message to.
|
|
423
505
|
* @format GUID
|
|
424
506
|
*/
|
|
425
507
|
interactiveFormSessionId: string;
|
|
426
508
|
/**
|
|
427
|
-
* User
|
|
509
|
+
* User's natural language input to process.
|
|
510
|
+
* The AI assistant analyzes this text to extract form field data and determine the next conversation step.
|
|
428
511
|
* @maxLength 10000
|
|
429
512
|
*/
|
|
430
513
|
input?: string | null;
|
|
431
514
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* "
|
|
436
|
-
* it will override the existing value.
|
|
515
|
+
* Form field values to apply to the session.
|
|
516
|
+
* Use this to update form data from other sources while the conversation is ongoing.
|
|
517
|
+
* These values override any existing data for the same field keys.
|
|
518
|
+
* For example: `{"lastName": "Smith", "phoneNumber": "+1234567890"}`.
|
|
437
519
|
*/
|
|
438
520
|
currentValues?: Record<string, any> | null;
|
|
439
521
|
}
|
|
440
522
|
interface SendUserMessageStreamedResponse {
|
|
441
|
-
/**
|
|
523
|
+
/** AI assistant response chunk streamed in real-time as the message is processed. */
|
|
442
524
|
responseChunk?: InteractiveFormSessionResponseChunk;
|
|
443
|
-
/**
|
|
525
|
+
/**
|
|
526
|
+
* Updated interactive form session information.
|
|
527
|
+
* Included in response chunks to provide current session state.
|
|
528
|
+
*/
|
|
444
529
|
interactiveFormSession?: InteractiveFormSession;
|
|
445
530
|
}
|
|
446
531
|
|