@scout9/app 1.0.0-alpha.0.1.95 → 1.0.0-alpha.0.1.97

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.
Files changed (45) hide show
  1. package/dist/{dev-ecdbe765.cjs → dev-1afc1e7b.cjs} +3788 -3684
  2. package/dist/{index-ea1273a0.cjs → index-2aedbf12.cjs} +150 -55
  3. package/dist/index.cjs +6 -47
  4. package/dist/{multipart-parser-26f98006.cjs → multipart-parser-51d88fc4.cjs} +9 -7
  5. package/dist/{spirits-32395ac4.cjs → spirits-43ce19cf.cjs} +19 -19
  6. package/dist/spirits.cjs +1 -1
  7. package/dist/testing-tools.cjs +7 -6
  8. package/package.json +4 -3
  9. package/src/core/config/agents.js +2 -2
  10. package/src/core/config/entities.js +10 -10
  11. package/src/core/config/index.js +2 -2
  12. package/src/core/config/project.js +1 -1
  13. package/src/core/config/workflow.js +2 -2
  14. package/src/core/index.js +7 -7
  15. package/src/core/sync.js +2 -2
  16. package/src/core/templates/app.js +7 -3
  17. package/src/core/templates/project-files.js +1 -1
  18. package/src/exports.js +8 -7
  19. package/src/platform.js +7 -7
  20. package/src/public.d.ts +3383 -0
  21. package/src/runtime/client/api.js +0 -22
  22. package/src/runtime/client/index.js +0 -6
  23. package/src/runtime/index.js +1 -0
  24. package/src/runtime/macros/builder.js +25 -4
  25. package/src/runtime/macros/event.js +139 -35
  26. package/src/runtime/macros/index.js +0 -1
  27. package/src/runtime/schemas/api.js +21 -0
  28. package/src/runtime/{client → schemas}/config.js +13 -17
  29. package/src/runtime/{client → schemas}/entity.js +16 -29
  30. package/src/runtime/schemas/index.js +9 -0
  31. package/src/runtime/{client → schemas}/message.js +0 -3
  32. package/src/runtime/{client → schemas}/platform.js +1 -1
  33. package/src/runtime/{client → schemas}/users.js +32 -26
  34. package/src/runtime/{client → schemas}/workflow.js +7 -59
  35. package/src/testing-tools/dev.js +15 -17
  36. package/src/testing-tools/mocks.js +6 -6
  37. package/src/testing-tools/spirits.js +19 -19
  38. package/src/utils/configs/agents.js +2 -2
  39. package/src/utils/configs/entities.js +8 -8
  40. package/src/utils/project-templates.js +3 -3
  41. package/types/index.d.ts +2899 -25181
  42. package/types/index.d.ts.map +67 -108
  43. package/src/public.d.ts.text +0 -330
  44. /package/src/runtime/{macros/schemas.js → schemas/macros.js} +0 -0
  45. /package/src/runtime/{client → schemas}/utils.js +0 -0
@@ -0,0 +1,3383 @@
1
+
2
+ /**
3
+ * Scout9 App
4
+ * Application platform for managing auto reply workflows from personal communication methods
5
+ *
6
+ *
7
+ * NOTE: This file was auto generated 7/10/2024, 2:42:04 PM
8
+ * Do not edit the file manually.
9
+ */
10
+
11
+
12
+ /**
13
+ * @param {WorkflowEvent} event - every workflow receives an event object
14
+ * @param {Object} options
15
+ * @param {string} [options.cwd=process.cwd()] - the working directory
16
+ * @param {string} [options.mode='production'] - the build mode
17
+ * @param {string} [options.src='./src'] - the source directory
18
+ * @param {string} options.eventSource - the source of the workflow event
19
+ * @returns {WorkflowResponse}
20
+ */
21
+ export function run(event: WorkflowEvent, options: {
22
+ cwd?: string;
23
+ mode?: string;
24
+ src?: string;
25
+ eventSource: string;
26
+ }): WorkflowResponse;
27
+ /**
28
+ * @template T
29
+ * @param {T} data
30
+ * @param {ResponseInit | undefined} [init]
31
+ * @returns {EventResponse<T>}
32
+ */
33
+ export function json<T>(data: T, init?: ResponseInit | undefined): EventResponse<T>;
34
+ /**
35
+ * @param {WorkflowEvent} event - every workflow receives an event object
36
+ * @param {Object} options
37
+ * @param {string} [options.cwd=process.cwd()] - the working directory
38
+ * @param {string} [options.mode='production'] - the build mode
39
+ * @param {string} [options.src='./src'] - the source directory
40
+ * @param {string} options.eventSource - the source of the workflow event
41
+ * @returns {WorkflowResponse}
42
+ */
43
+ export function sendEvent(event: WorkflowEvent, options: {
44
+ cwd?: string;
45
+ mode?: string;
46
+ src?: string;
47
+ eventSource: string;
48
+ }): WorkflowResponse;
49
+
50
+
51
+ /**
52
+ * Utility runtime class used to guide event output
53
+ * @template T
54
+ */
55
+ export class EventResponse<T> {
56
+ /**
57
+ * Create a new EventResponse instance with a JSON body.
58
+ * @template T
59
+ * @param {T} body - The body of the response.
60
+ * @param {ResponseInit} [options] - Additional options for the response.
61
+ * @returns {EventResponse<T>} A new EventResponse instance.
62
+ */
63
+ static json<T_1>(body: T_1, options?: ResponseInit): EventResponse<T_1>;
64
+ /**
65
+ * Create an EventResponse.
66
+ * @param {T} body - The body of the response.
67
+ * @param {ResponseInit} [init] - Additional options for the response.
68
+ * @throws {Error} If the body is not a valid object.
69
+ */
70
+ constructor(body: T, init?: ResponseInit);
71
+ /**
72
+ * @type {T}
73
+ * @private
74
+ */
75
+ private body;
76
+ /**
77
+ * @type {ResponseInit}
78
+ * @private
79
+ */
80
+ private init;
81
+ /**
82
+ * Get the response object.
83
+ * @returns {Response} The response object.
84
+ */
85
+ get response(): Response;
86
+ /**
87
+ * Get the data of the response.
88
+ * @returns {T} The body of the response.
89
+ */
90
+ get data(): T;
91
+ }
92
+
93
+
94
+ /**
95
+ * Return instructions to guide next auto reply response
96
+ * @param {string} instruction - the instruction to send to the
97
+ * @param {OptionsInstruct} [options]
98
+ * @return {EventMacros}
99
+ *
100
+ * @example instruct("Ask user if they are looking to order a pizza");
101
+ *
102
+ * @type {(message: string, options?: OptionsInstruct) => EventMacros}
103
+ */
104
+ export const instruct: (message: string, options?: OptionsInstruct) => EventMacros;
105
+ /**
106
+ * Forwards conversation back to you or owner of workflow.
107
+ *
108
+ * Typically used when the conversation is over or user is stuck in the workflow and needs manual intervention.
109
+ *
110
+ * The provided message input gets sent to you in a sms text with some information why conversation was forwarded.
111
+ *
112
+ * Calling this method will lock the conversation and prevent auto replies from being sent to the user.
113
+ *
114
+ * @example - end of workflow
115
+ * forward("User wants 1 cheese pizza ready for pick");
116
+ *
117
+ * @example - broken step in workflow
118
+ * forward("Cannot determine what the user wants");
119
+ *
120
+ * @example - forward if user sends a message
121
+ * reply("Let me know if you're looking for a gutter cleaning").forward("User responded to gutter cleaning request", {mode: 'after-reply'});
122
+ *
123
+ * @type {(message: string, options?: OptionsForward) => EventMacros}
124
+ */
125
+ export const forward: (message: string, options?: OptionsForward) => EventMacros;
126
+ /**
127
+ * Manual message to send to the customer from the workflow.
128
+ *
129
+ * Typically used to return specific information to the user
130
+ *
131
+ * @example - confirming invoice
132
+ * reply(`So I got...\n${invoiceItems.map((item) => `${}`)}`)
133
+ * const msg = [
134
+ * 'So I got...',
135
+ * invoice.items.map((item) => `${item.quantity} ${item.name}`),
136
+ * `Total: ${invoice.totalStr}`,
137
+ * `\nThis look right?`
138
+ * ].join('\n');
139
+ * return reply(msg).instruct("If user confirms ask if they prefer to pay cash or credit");
140
+ *
141
+ * @type {(message: string, options?: OptionsReply) => EventMacros}
142
+ */
143
+ export const reply: (message: string, options?: OptionsReply) => EventMacros;
144
+ /**
145
+ * followup macro options
146
+ */
147
+ export type OptionsFollowup = {
148
+ scheduled: Date | string;
149
+ cancelIf?: Record<string, any>;
150
+ literal?: boolean;
151
+ overrideLock?: boolean;
152
+ };
153
+ /**
154
+ * instruct macro options
155
+ */
156
+ export type OptionsInstruct = {
157
+ /**
158
+ * - Unique ID for the instruction, this is used to remove the instruction later
159
+ */
160
+ id?: string;
161
+ /**
162
+ * - if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply
163
+ */
164
+ persist?: boolean;
165
+ };
166
+ /**
167
+ * reply macro options
168
+ */
169
+ export type OptionsReply = {
170
+ scheduled?: Date | string;
171
+ delay?: number;
172
+ };
173
+ /**
174
+ * forward macro options
175
+ */
176
+ export type OptionsForward = {
177
+ /**
178
+ * - sets forward mode, defaults to "immediately". If "after-reply", the forward will be on hold until the customer responds. We recommend using "immediately" for most cases.
179
+ */
180
+ mode?: 'after-reply' | 'immediately';
181
+ /**
182
+ * - another phone or email to forward to instead of owner
183
+ */
184
+ to?: string;
185
+ };
186
+ /**
187
+ * - Extends `WorkflowResponseSlotBase` to include keywords.
188
+ */
189
+ export type WorkflowResponseSlotBaseWithKeywords = WorkflowResponseSlotBase & {
190
+ keywords: string[];
191
+ };
192
+ /**
193
+ * - Defines the overloads for the `anticipate` function.
194
+ */
195
+ export type AnticipateFunction = (instruction: string, yes: WorkflowResponseSlotBase, no: WorkflowResponseSlotBase) => EventMacros | ((instruction: WorkflowResponseSlotBaseWithKeywords[]) => EventMacros);
196
+ /**
197
+ * Event macros to be used inside your scout9 auto reply workflows
198
+ */
199
+ export type EventMacros = {
200
+ upsert: (arg0: Record<string, any>) => EventMacros;
201
+ followup: (arg0: string, arg1: (Date | string | OptionsFollowup)) => EventMacros;
202
+ anticipate: AnticipateFunction;
203
+ instruct: (arg0: string, arg1: OptionsInstruct | null) => EventMacros;
204
+ reply: (arg0: string, arg1: OptionsReply | null) => EventMacros;
205
+ forward: (arg0: string | null, arg1: OptionsForward | null) => EventMacros;
206
+ toJSON: (arg0: boolean | null) => Array<WorkflowResponseSlot>;
207
+ };
208
+
209
+
210
+ /**
211
+ * The `did` macro takes a given prompt and infers a binary `true` or `false` result in relation to the prompt's subject actor and the prompt's inquiry.
212
+ * @param {string} prompt
213
+ * @return {Promise<boolean>}
214
+ */
215
+ export function did(prompt: string): Promise<boolean>;
216
+ /**
217
+ * @typedef {import('@scout9/admin').MacroContextInputExamples} ContextExamples
218
+ * @typedef {import('@scout9/admin').MacroContextValue} ContextOutput
219
+ */
220
+ /**
221
+ * The `context` macro, similar to the `did` macro, takes a natural statement and checks the entire conversation state and extracts or infers a metadata composition result.
222
+ *
223
+ * @example - inferring what a user requested
224
+ * const response = await context(`What pizzas did the user want to order?`);
225
+ * {
226
+ * "order": {
227
+ * "pizzas": [
228
+ * {"size": "small", "toppings": ["cheese"], quantity: 1}
229
+ * ]
230
+ * }
231
+ * }
232
+ *
233
+ * @param {string} prompt - Prompt to infer a context data set to use in your workflow code.
234
+ * @param {ContextExamples} [examples] - Examples to the macro to ensure a consistent data structure.
235
+ * @return {Promise<ContextOutput>}
236
+ */
237
+ export function context(prompt: string, examples?: any): Promise<any>;
238
+ export type ContextExamples = any;
239
+ export type ContextOutput = any;
240
+
241
+
242
+ export type AgentConfiguration = {
243
+ deployed?: {
244
+ /** Web URL for agent */
245
+ web?: string | undefined;
246
+ /** Phone number for agent */
247
+ phone?: string | undefined;
248
+ /** Email address for agent */
249
+ email?: string | undefined;
250
+ } | undefined;
251
+ img?: (string | null) | undefined;
252
+ /** Agent first name */
253
+ firstName?: string | undefined;
254
+ /** Agent last name */
255
+ lastName?: string | undefined;
256
+ /** Agent is inactive */
257
+ inactive?: boolean | undefined;
258
+ /** Programmable phone number */
259
+ programmablePhoneNumber?: string | undefined;
260
+ /** Programmable phone number SID */
261
+ programmablePhoneNumberSid?: string | undefined;
262
+ /** Email address from Scout9 gmail subdomain */
263
+ programmableEmail?: string | undefined;
264
+ /** Email address to forward to */
265
+ forwardEmail?: string | undefined;
266
+ /** Phone number to forward to */
267
+ forwardPhone?: string | undefined;
268
+ /** Agent title */
269
+ title?: string;
270
+ /** Context of the agent */
271
+ context?: string;
272
+ includedLocations?: string[] | undefined;
273
+ excludedLocations?: string[] | undefined;
274
+ model?: ("Scout9" | "bard" | "openai");
275
+ transcripts?: {
276
+ /** Unique ID for the message */
277
+ id: string;
278
+ role: "agent" | "customer" | "system";
279
+ content: string;
280
+ /** Datetime ISO 8601 timestamp */
281
+ time: string;
282
+ name?: string | undefined;
283
+ /** Datetime ISO 8601 timestamp */
284
+ scheduled?: string | undefined;
285
+ /** The context generated from the message */
286
+ context?: any | undefined;
287
+ /** Detected intent */
288
+ intent?: (string | undefined) | null;
289
+ /** Confidence score of the assigned intent */
290
+ intentScore?: (number | null) | undefined;
291
+ /** How long to delay the message manually in seconds */
292
+ delayInSeconds?: (number | null) | undefined;
293
+ }[][] | undefined;
294
+ audios?: any[] | undefined;
295
+ /** Unique ID for agent */
296
+ id: string;
297
+ };
298
+
299
+ export type Agent = {
300
+ deployed?: {
301
+ /** Web URL for agent */
302
+ web?: string | undefined;
303
+ /** Phone number for agent */
304
+ phone?: string | undefined;
305
+ /** Email address for agent */
306
+ email?: string | undefined;
307
+ } | undefined;
308
+ img?: (string | null) | undefined;
309
+ /** Agent first name */
310
+ firstName?: string | undefined;
311
+ /** Agent last name */
312
+ lastName?: string | undefined;
313
+ /** Agent is inactive */
314
+ inactive?: boolean | undefined;
315
+ /** Programmable phone number */
316
+ programmablePhoneNumber?: string | undefined;
317
+ /** Programmable phone number SID */
318
+ programmablePhoneNumberSid?: string | undefined;
319
+ /** Email address from Scout9 gmail subdomain */
320
+ programmableEmail?: string | undefined;
321
+ /** Email address to forward to */
322
+ forwardEmail?: string | undefined;
323
+ /** Phone number to forward to */
324
+ forwardPhone?: string | undefined;
325
+ /** Agent title */
326
+ title?: string;
327
+ /** Context of the agent */
328
+ context?: string;
329
+ includedLocations?: string[] | undefined;
330
+ excludedLocations?: string[] | undefined;
331
+ model?: ("Scout9" | "bard" | "openai");
332
+ transcripts?: {
333
+ /** Unique ID for the message */
334
+ id: string;
335
+ role: "agent" | "customer" | "system";
336
+ content: string;
337
+ /** Datetime ISO 8601 timestamp */
338
+ time: string;
339
+ name?: string | undefined;
340
+ /** Datetime ISO 8601 timestamp */
341
+ scheduled?: string | undefined;
342
+ /** The context generated from the message */
343
+ context?: any | undefined;
344
+ /** Detected intent */
345
+ intent?: (string | undefined) | null;
346
+ /** Confidence score of the assigned intent */
347
+ intentScore?: (number | null) | undefined;
348
+ /** How long to delay the message manually in seconds */
349
+ delayInSeconds?: (number | null) | undefined;
350
+ }[][] | undefined;
351
+ audios?: any[] | undefined;
352
+ };
353
+
354
+ export type AgentsConfiguration = {
355
+ deployed?: {
356
+ /** Web URL for agent */
357
+ web?: string | undefined;
358
+ /** Phone number for agent */
359
+ phone?: string | undefined;
360
+ /** Email address for agent */
361
+ email?: string | undefined;
362
+ } | undefined;
363
+ img?: (string | null) | undefined;
364
+ /** Agent first name */
365
+ firstName?: string | undefined;
366
+ /** Agent last name */
367
+ lastName?: string | undefined;
368
+ /** Agent is inactive */
369
+ inactive?: boolean | undefined;
370
+ /** Programmable phone number */
371
+ programmablePhoneNumber?: string | undefined;
372
+ /** Programmable phone number SID */
373
+ programmablePhoneNumberSid?: string | undefined;
374
+ /** Email address from Scout9 gmail subdomain */
375
+ programmableEmail?: string | undefined;
376
+ /** Email address to forward to */
377
+ forwardEmail?: string | undefined;
378
+ /** Phone number to forward to */
379
+ forwardPhone?: string | undefined;
380
+ /** Agent title */
381
+ title?: string;
382
+ /** Context of the agent */
383
+ context?: string;
384
+ includedLocations?: string[] | undefined;
385
+ excludedLocations?: string[] | undefined;
386
+ model?: ("Scout9" | "bard" | "openai");
387
+ transcripts?: {
388
+ /** Unique ID for the message */
389
+ id: string;
390
+ role: "agent" | "customer" | "system";
391
+ content: string;
392
+ /** Datetime ISO 8601 timestamp */
393
+ time: string;
394
+ name?: string | undefined;
395
+ /** Datetime ISO 8601 timestamp */
396
+ scheduled?: string | undefined;
397
+ /** The context generated from the message */
398
+ context?: any | undefined;
399
+ /** Detected intent */
400
+ intent?: (string | undefined) | null;
401
+ /** Confidence score of the assigned intent */
402
+ intentScore?: (number | null) | undefined;
403
+ /** How long to delay the message manually in seconds */
404
+ delayInSeconds?: (number | null) | undefined;
405
+ }[][] | undefined;
406
+ audios?: any[] | undefined;
407
+ /** Unique ID for agent */
408
+ id: string;
409
+ }[];
410
+
411
+ export type Agents = {
412
+ deployed?: {
413
+ /** Web URL for agent */
414
+ web?: string | undefined;
415
+ /** Phone number for agent */
416
+ phone?: string | undefined;
417
+ /** Email address for agent */
418
+ email?: string | undefined;
419
+ } | undefined;
420
+ img?: (string | null) | undefined;
421
+ /** Agent first name */
422
+ firstName?: string | undefined;
423
+ /** Agent last name */
424
+ lastName?: string | undefined;
425
+ /** Agent is inactive */
426
+ inactive?: boolean | undefined;
427
+ /** Programmable phone number */
428
+ programmablePhoneNumber?: string | undefined;
429
+ /** Programmable phone number SID */
430
+ programmablePhoneNumberSid?: string | undefined;
431
+ /** Email address from Scout9 gmail subdomain */
432
+ programmableEmail?: string | undefined;
433
+ /** Email address to forward to */
434
+ forwardEmail?: string | undefined;
435
+ /** Phone number to forward to */
436
+ forwardPhone?: string | undefined;
437
+ /** Agent title */
438
+ title?: string;
439
+ /** Context of the agent */
440
+ context?: string;
441
+ includedLocations?: string[] | undefined;
442
+ excludedLocations?: string[] | undefined;
443
+ model?: ("Scout9" | "bard" | "openai");
444
+ transcripts?: {
445
+ /** Unique ID for the message */
446
+ id: string;
447
+ role: "agent" | "customer" | "system";
448
+ content: string;
449
+ /** Datetime ISO 8601 timestamp */
450
+ time: string;
451
+ name?: string | undefined;
452
+ /** Datetime ISO 8601 timestamp */
453
+ scheduled?: string | undefined;
454
+ /** The context generated from the message */
455
+ context?: any | undefined;
456
+ /** Detected intent */
457
+ intent?: (string | undefined) | null;
458
+ /** Confidence score of the assigned intent */
459
+ intentScore?: (number | null) | undefined;
460
+ /** How long to delay the message manually in seconds */
461
+ delayInSeconds?: (number | null) | undefined;
462
+ }[][] | undefined;
463
+ audios?: any[] | undefined;
464
+ }[];
465
+
466
+ export type Baz = {
467
+ boo: {
468
+ one: number;
469
+ two?: number | undefined;
470
+ };
471
+ };
472
+
473
+ export type Bus = {
474
+ foo: string;
475
+ bar?: boolean | undefined;
476
+ };
477
+
478
+ export type ContextExample = {
479
+ input: string;
480
+ output: {
481
+ [x: string]: any;
482
+ }[];
483
+ }[] | {
484
+ [x: string]: any;
485
+ }[];
486
+
487
+ export type ContextExampleWithTrainingData = {
488
+ input: string;
489
+ output: {
490
+ [x: string]: any;
491
+ }[];
492
+ };
493
+
494
+ export type ConversationContext = {
495
+ [x: string]: any;
496
+ };
497
+
498
+ export type Conversation = {
499
+ /** Default agent assigned to the conversation(s) */
500
+ $agent: string;
501
+ /** Customer this conversation is with */
502
+ $customer: string;
503
+ /** Initial contexts to load when starting the conversation */
504
+ initialContexts?: string[] | undefined;
505
+ environment: "phone" | "email" | "web";
506
+ environmentProps?: {
507
+ /** HTML Subject of the conversation */
508
+ subject?: string | undefined;
509
+ /** Used to sync email messages with the conversation */
510
+ platformEmailThreadId?: string | undefined;
511
+ } | undefined;
512
+ /** Whether the conversation is locked or not */
513
+ locked?: (boolean | undefined) | null;
514
+ /** Why this conversation was locked */
515
+ lockedReason?: (string | undefined) | null;
516
+ /** Number attempts made until conversation is locked */
517
+ lockAttempts?: (number | undefined) | null;
518
+ /** What personaId/phone/email was forwarded */
519
+ forwardedTo?: (string | undefined) | null;
520
+ /** Datetime ISO 8601 timestamp when persona was forwarded */
521
+ forwarded?: (string | undefined) | null;
522
+ forwardNote?: (string | undefined) | null;
523
+ /** Detected intent of conversation */
524
+ intent?: (string | undefined) | null;
525
+ /** Confidence score of the assigned intent */
526
+ intentScore?: (number | undefined) | null;
527
+ };
528
+
529
+ export type Customer = {
530
+ firstName?: string | undefined;
531
+ lastName?: string | undefined;
532
+ name: string;
533
+ email?: (string | null) | undefined;
534
+ phone?: (string | null) | undefined;
535
+ img?: (string | null) | undefined;
536
+ neighborhood?: (string | null) | undefined;
537
+ city?: (string | null) | undefined;
538
+ country?: (string | null) | undefined;
539
+ line1?: (string | null) | undefined;
540
+ line2?: (string | null) | undefined;
541
+ postal_code?: (string | null) | undefined;
542
+ state?: (string | null) | undefined;
543
+ town?: (string | null) | undefined;
544
+ joined?: (string | null) | undefined;
545
+ stripe?: (string | null) | undefined;
546
+ stripeDev?: (string | null) | undefined;
547
+ };
548
+
549
+ export type CustomerValue = boolean | number | string;
550
+
551
+ export type EntitiesRootConfiguration = {
552
+ /** If not provided, the id will default to the route (folder) name */
553
+ id?: string | undefined;
554
+ definitions?: {
555
+ /** What entity utterance this represents, if not provided, it will default to the entity id */
556
+ utterance?: string | undefined;
557
+ /** The value of this entity variance */
558
+ value: string;
559
+ /** Text representing the entity variance */
560
+ text: string[];
561
+ }[] | undefined;
562
+ training?: {
563
+ /** The assigned intent id of the given text, e.g. "I love %pizza%" could have an intent id "feedback" and "Can I purchase a %pizza%?" could have an intent id "purchase" */
564
+ intent: string;
565
+ /** Text to train the intent field and entities in or entity variances in example sentences or phrase. Ex: "I love %pizza%" and "Can I purchase a %pizza%?" */
566
+ text: string;
567
+ }[] | undefined;
568
+ tests?: {
569
+ /** Text to test the entity detection */
570
+ text: string;
571
+ expected: {
572
+ /** The expected intent id */
573
+ intent: string;
574
+ context?: any;
575
+ };
576
+ }[] | undefined;
577
+ }[];
578
+
579
+ export type EntitiesRootProjectConfiguration = {
580
+ /** If not provided, the id will default to the route (folder) name */
581
+ id?: string | undefined;
582
+ definitions?: {
583
+ /** What entity utterance this represents, if not provided, it will default to the entity id */
584
+ utterance?: string | undefined;
585
+ /** The value of this entity variance */
586
+ value: string;
587
+ /** Text representing the entity variance */
588
+ text: string[];
589
+ }[] | undefined;
590
+ training?: {
591
+ /** The assigned intent id of the given text, e.g. "I love %pizza%" could have an intent id "feedback" and "Can I purchase a %pizza%?" could have an intent id "purchase" */
592
+ intent: string;
593
+ /** Text to train the intent field and entities in or entity variances in example sentences or phrase. Ex: "I love %pizza%" and "Can I purchase a %pizza%?" */
594
+ text: string;
595
+ }[] | undefined;
596
+ tests?: {
597
+ /** Text to test the entity detection */
598
+ text: string;
599
+ expected: {
600
+ /** The expected intent id */
601
+ intent: string;
602
+ context?: any;
603
+ };
604
+ }[] | undefined;
605
+ /** Entity id association, used to handle route params */
606
+ entities: string[];
607
+ entity: string;
608
+ api: {
609
+ GET?: boolean | undefined;
610
+ UPDATE?: boolean | undefined;
611
+ QUERY?: boolean | undefined;
612
+ PUT?: boolean | undefined;
613
+ PATCH?: boolean | undefined;
614
+ DELETE?: boolean | undefined;
615
+ } | null;
616
+ }[];
617
+
618
+ export type EntityApiConfiguration = {
619
+ GET?: boolean | undefined;
620
+ UPDATE?: boolean | undefined;
621
+ QUERY?: boolean | undefined;
622
+ PUT?: boolean | undefined;
623
+ PATCH?: boolean | undefined;
624
+ DELETE?: boolean | undefined;
625
+ } | null;
626
+
627
+ export type EntityConfiguration = {
628
+ /** If not provided, the id will default to the route (folder) name */
629
+ id?: string | undefined;
630
+ definitions?: {
631
+ /** What entity utterance this represents, if not provided, it will default to the entity id */
632
+ utterance?: string | undefined;
633
+ /** The value of this entity variance */
634
+ value: string;
635
+ /** Text representing the entity variance */
636
+ text: string[];
637
+ }[] | undefined;
638
+ training?: {
639
+ /** The assigned intent id of the given text, e.g. "I love %pizza%" could have an intent id "feedback" and "Can I purchase a %pizza%?" could have an intent id "purchase" */
640
+ intent: string;
641
+ /** Text to train the intent field and entities in or entity variances in example sentences or phrase. Ex: "I love %pizza%" and "Can I purchase a %pizza%?" */
642
+ text: string;
643
+ }[] | undefined;
644
+ tests?: {
645
+ /** Text to test the entity detection */
646
+ text: string;
647
+ expected: {
648
+ /** The expected intent id */
649
+ intent: string;
650
+ context?: any;
651
+ };
652
+ }[] | undefined;
653
+ };
654
+
655
+ export type EntityRootProjectConfiguration = {
656
+ /** If not provided, the id will default to the route (folder) name */
657
+ id?: string | undefined;
658
+ definitions?: {
659
+ /** What entity utterance this represents, if not provided, it will default to the entity id */
660
+ utterance?: string | undefined;
661
+ /** The value of this entity variance */
662
+ value: string;
663
+ /** Text representing the entity variance */
664
+ text: string[];
665
+ }[] | undefined;
666
+ training?: {
667
+ /** The assigned intent id of the given text, e.g. "I love %pizza%" could have an intent id "feedback" and "Can I purchase a %pizza%?" could have an intent id "purchase" */
668
+ intent: string;
669
+ /** Text to train the intent field and entities in or entity variances in example sentences or phrase. Ex: "I love %pizza%" and "Can I purchase a %pizza%?" */
670
+ text: string;
671
+ }[] | undefined;
672
+ tests?: {
673
+ /** Text to test the entity detection */
674
+ text: string;
675
+ expected: {
676
+ /** The expected intent id */
677
+ intent: string;
678
+ context?: any;
679
+ };
680
+ }[] | undefined;
681
+ /** Entity id association, used to handle route params */
682
+ entities: string[];
683
+ entity: string;
684
+ api: {
685
+ GET?: boolean | undefined;
686
+ UPDATE?: boolean | undefined;
687
+ QUERY?: boolean | undefined;
688
+ PUT?: boolean | undefined;
689
+ PATCH?: boolean | undefined;
690
+ DELETE?: boolean | undefined;
691
+ } | null;
692
+ };
693
+
694
+ export type FollowupBase = {
695
+ scheduled: number;
696
+ cancelIf?: {
697
+ [x: string]: any;
698
+ } | undefined;
699
+ /** This will still run even if the conversation is locked, defaults to false */
700
+ overrideLock?: boolean | undefined;
701
+ };
702
+
703
+ export type Followup = {
704
+ scheduled: number;
705
+ cancelIf?: {
706
+ [x: string]: any;
707
+ } | undefined;
708
+ /** This will still run even if the conversation is locked, defaults to false */
709
+ overrideLock?: boolean | undefined;
710
+ /** Manual message sent to client */
711
+ message: string;
712
+ } | {
713
+ scheduled: number;
714
+ cancelIf?: {
715
+ [x: string]: any;
716
+ } | undefined;
717
+ /** This will still run even if the conversation is locked, defaults to false */
718
+ overrideLock?: boolean | undefined;
719
+ instructions: string | {
720
+ /** Unique ID for the instruction, this is used to remove the instruction later */
721
+ id?: string | undefined;
722
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
723
+ persist?: boolean | undefined;
724
+ content: string;
725
+ } | string[] | {
726
+ /** Unique ID for the instruction, this is used to remove the instruction later */
727
+ id?: string | undefined;
728
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
729
+ persist?: boolean | undefined;
730
+ content: string;
731
+ }[];
732
+ };
733
+
734
+ export type Forward = boolean | string | {
735
+ to?: string | undefined;
736
+ mode?: ("after-reply" | "immediately") | undefined;
737
+ /** Note to provide to the agent */
738
+ note?: string | undefined;
739
+ };
740
+
741
+ export type InstructionObject = {
742
+ /** Unique ID for the instruction, this is used to remove the instruction later */
743
+ id?: string | undefined;
744
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
745
+ persist?: boolean | undefined;
746
+ content: string;
747
+ };
748
+
749
+ export type Instruction = string | {
750
+ /** Unique ID for the instruction, this is used to remove the instruction later */
751
+ id?: string | undefined;
752
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
753
+ persist?: boolean | undefined;
754
+ content: string;
755
+ } | string[] | {
756
+ /** Unique ID for the instruction, this is used to remove the instruction later */
757
+ id?: string | undefined;
758
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
759
+ persist?: boolean | undefined;
760
+ content: string;
761
+ }[];
762
+
763
+ export type IntentWorkflowEvent = {
764
+ current: string | null;
765
+ flow: string[];
766
+ initial: string | null;
767
+ };
768
+
769
+ export type Message = {
770
+ /** Unique ID for the message */
771
+ id: string;
772
+ role: "agent" | "customer" | "system";
773
+ content: string;
774
+ /** Datetime ISO 8601 timestamp */
775
+ time: string;
776
+ name?: string | undefined;
777
+ /** Datetime ISO 8601 timestamp */
778
+ scheduled?: string | undefined;
779
+ /** The context generated from the message */
780
+ context?: any | undefined;
781
+ /** Detected intent */
782
+ intent?: (string | undefined) | null;
783
+ /** Confidence score of the assigned intent */
784
+ intentScore?: (number | null) | undefined;
785
+ /** How long to delay the message manually in seconds */
786
+ delayInSeconds?: (number | null) | undefined;
787
+ };
788
+
789
+ export type PersonaConfiguration = {
790
+ deployed?: {
791
+ /** Web URL for agent */
792
+ web?: string | undefined;
793
+ /** Phone number for agent */
794
+ phone?: string | undefined;
795
+ /** Email address for agent */
796
+ email?: string | undefined;
797
+ } | undefined;
798
+ img?: (string | null) | undefined;
799
+ /** Agent first name */
800
+ firstName?: string | undefined;
801
+ /** Agent last name */
802
+ lastName?: string | undefined;
803
+ /** Agent is inactive */
804
+ inactive?: boolean | undefined;
805
+ /** Programmable phone number */
806
+ programmablePhoneNumber?: string | undefined;
807
+ /** Programmable phone number SID */
808
+ programmablePhoneNumberSid?: string | undefined;
809
+ /** Email address from Scout9 gmail subdomain */
810
+ programmableEmail?: string | undefined;
811
+ /** Email address to forward to */
812
+ forwardEmail?: string | undefined;
813
+ /** Phone number to forward to */
814
+ forwardPhone?: string | undefined;
815
+ /** Agent title */
816
+ title?: string;
817
+ /** Context of the agent */
818
+ context?: string;
819
+ includedLocations?: string[] | undefined;
820
+ excludedLocations?: string[] | undefined;
821
+ model?: ("Scout9" | "bard" | "openai");
822
+ transcripts?: {
823
+ /** Unique ID for the message */
824
+ id: string;
825
+ role: "agent" | "customer" | "system";
826
+ content: string;
827
+ /** Datetime ISO 8601 timestamp */
828
+ time: string;
829
+ name?: string | undefined;
830
+ /** Datetime ISO 8601 timestamp */
831
+ scheduled?: string | undefined;
832
+ /** The context generated from the message */
833
+ context?: any | undefined;
834
+ /** Detected intent */
835
+ intent?: (string | undefined) | null;
836
+ /** Confidence score of the assigned intent */
837
+ intentScore?: (number | null) | undefined;
838
+ /** How long to delay the message manually in seconds */
839
+ delayInSeconds?: (number | null) | undefined;
840
+ }[][] | undefined;
841
+ audios?: any[] | undefined;
842
+ /** Unique ID for agent */
843
+ id: string;
844
+ };
845
+
846
+ export type Persona = {
847
+ deployed?: {
848
+ /** Web URL for agent */
849
+ web?: string | undefined;
850
+ /** Phone number for agent */
851
+ phone?: string | undefined;
852
+ /** Email address for agent */
853
+ email?: string | undefined;
854
+ } | undefined;
855
+ img?: (string | null) | undefined;
856
+ /** Agent first name */
857
+ firstName?: string | undefined;
858
+ /** Agent last name */
859
+ lastName?: string | undefined;
860
+ /** Agent is inactive */
861
+ inactive?: boolean | undefined;
862
+ /** Programmable phone number */
863
+ programmablePhoneNumber?: string | undefined;
864
+ /** Programmable phone number SID */
865
+ programmablePhoneNumberSid?: string | undefined;
866
+ /** Email address from Scout9 gmail subdomain */
867
+ programmableEmail?: string | undefined;
868
+ /** Email address to forward to */
869
+ forwardEmail?: string | undefined;
870
+ /** Phone number to forward to */
871
+ forwardPhone?: string | undefined;
872
+ /** Agent title */
873
+ title?: string;
874
+ /** Context of the agent */
875
+ context?: string;
876
+ includedLocations?: string[] | undefined;
877
+ excludedLocations?: string[] | undefined;
878
+ model?: ("Scout9" | "bard" | "openai");
879
+ transcripts?: {
880
+ /** Unique ID for the message */
881
+ id: string;
882
+ role: "agent" | "customer" | "system";
883
+ content: string;
884
+ /** Datetime ISO 8601 timestamp */
885
+ time: string;
886
+ name?: string | undefined;
887
+ /** Datetime ISO 8601 timestamp */
888
+ scheduled?: string | undefined;
889
+ /** The context generated from the message */
890
+ context?: any | undefined;
891
+ /** Detected intent */
892
+ intent?: (string | undefined) | null;
893
+ /** Confidence score of the assigned intent */
894
+ intentScore?: (number | null) | undefined;
895
+ /** How long to delay the message manually in seconds */
896
+ delayInSeconds?: (number | null) | undefined;
897
+ }[][] | undefined;
898
+ audios?: any[] | undefined;
899
+ };
900
+
901
+ export type PersonasConfiguration = {
902
+ deployed?: {
903
+ /** Web URL for agent */
904
+ web?: string | undefined;
905
+ /** Phone number for agent */
906
+ phone?: string | undefined;
907
+ /** Email address for agent */
908
+ email?: string | undefined;
909
+ } | undefined;
910
+ img?: (string | null) | undefined;
911
+ /** Agent first name */
912
+ firstName?: string | undefined;
913
+ /** Agent last name */
914
+ lastName?: string | undefined;
915
+ /** Agent is inactive */
916
+ inactive?: boolean | undefined;
917
+ /** Programmable phone number */
918
+ programmablePhoneNumber?: string | undefined;
919
+ /** Programmable phone number SID */
920
+ programmablePhoneNumberSid?: string | undefined;
921
+ /** Email address from Scout9 gmail subdomain */
922
+ programmableEmail?: string | undefined;
923
+ /** Email address to forward to */
924
+ forwardEmail?: string | undefined;
925
+ /** Phone number to forward to */
926
+ forwardPhone?: string | undefined;
927
+ /** Agent title */
928
+ title?: string;
929
+ /** Context of the agent */
930
+ context?: string;
931
+ includedLocations?: string[] | undefined;
932
+ excludedLocations?: string[] | undefined;
933
+ model?: ("Scout9" | "bard" | "openai");
934
+ transcripts?: {
935
+ /** Unique ID for the message */
936
+ id: string;
937
+ role: "agent" | "customer" | "system";
938
+ content: string;
939
+ /** Datetime ISO 8601 timestamp */
940
+ time: string;
941
+ name?: string | undefined;
942
+ /** Datetime ISO 8601 timestamp */
943
+ scheduled?: string | undefined;
944
+ /** The context generated from the message */
945
+ context?: any | undefined;
946
+ /** Detected intent */
947
+ intent?: (string | undefined) | null;
948
+ /** Confidence score of the assigned intent */
949
+ intentScore?: (number | null) | undefined;
950
+ /** How long to delay the message manually in seconds */
951
+ delayInSeconds?: (number | null) | undefined;
952
+ }[][] | undefined;
953
+ audios?: any[] | undefined;
954
+ /** Unique ID for agent */
955
+ id: string;
956
+ }[];
957
+
958
+ export type Personas = {
959
+ deployed?: {
960
+ /** Web URL for agent */
961
+ web?: string | undefined;
962
+ /** Phone number for agent */
963
+ phone?: string | undefined;
964
+ /** Email address for agent */
965
+ email?: string | undefined;
966
+ } | undefined;
967
+ img?: (string | null) | undefined;
968
+ /** Agent first name */
969
+ firstName?: string | undefined;
970
+ /** Agent last name */
971
+ lastName?: string | undefined;
972
+ /** Agent is inactive */
973
+ inactive?: boolean | undefined;
974
+ /** Programmable phone number */
975
+ programmablePhoneNumber?: string | undefined;
976
+ /** Programmable phone number SID */
977
+ programmablePhoneNumberSid?: string | undefined;
978
+ /** Email address from Scout9 gmail subdomain */
979
+ programmableEmail?: string | undefined;
980
+ /** Email address to forward to */
981
+ forwardEmail?: string | undefined;
982
+ /** Phone number to forward to */
983
+ forwardPhone?: string | undefined;
984
+ /** Agent title */
985
+ title?: string;
986
+ /** Context of the agent */
987
+ context?: string;
988
+ includedLocations?: string[] | undefined;
989
+ excludedLocations?: string[] | undefined;
990
+ model?: ("Scout9" | "bard" | "openai");
991
+ transcripts?: {
992
+ /** Unique ID for the message */
993
+ id: string;
994
+ role: "agent" | "customer" | "system";
995
+ content: string;
996
+ /** Datetime ISO 8601 timestamp */
997
+ time: string;
998
+ name?: string | undefined;
999
+ /** Datetime ISO 8601 timestamp */
1000
+ scheduled?: string | undefined;
1001
+ /** The context generated from the message */
1002
+ context?: any | undefined;
1003
+ /** Detected intent */
1004
+ intent?: (string | undefined) | null;
1005
+ /** Confidence score of the assigned intent */
1006
+ intentScore?: (number | null) | undefined;
1007
+ /** How long to delay the message manually in seconds */
1008
+ delayInSeconds?: (number | null) | undefined;
1009
+ }[][] | undefined;
1010
+ audios?: any[] | undefined;
1011
+ }[];
1012
+
1013
+ export type Scout9ProjectBuildConfig = {
1014
+ tag?: string | undefined;
1015
+ llm: {
1016
+ engine: "openai";
1017
+ model: "gpt-4-1106-preview" | "gpt-4-vision-preview" | "gpt-4" | "gpt-4-0314" | "gpt-4-0613" | "gpt-4-32k" | "gpt-4-32k-0314" | "gpt-4-32k-0613" | "gpt-3.5-turbo" | "gpt-3.5-turbo-16k" | "gpt-3.5-turbo-0301" | "gpt-3.5-turbo-0613" | "gpt-3.5-turbo-16k-0613" | string;
1018
+ } | {
1019
+ engine: "llama";
1020
+ model: string;
1021
+ } | {
1022
+ engine: "bard";
1023
+ model: string;
1024
+ };
1025
+ /** Configure personal model transformer (PMT) settings to align auto replies the agent's tone */
1026
+ pmt: {
1027
+ engine: "scout9";
1028
+ model: string;
1029
+ };
1030
+ /** Determines the max auto replies without further conversation progression (defined by new context data gathered), before the conversation is locked and requires manual intervention */
1031
+ maxLockAttempts?: number | undefined;
1032
+ /** Configure the initial contexts for every conversation */
1033
+ initialContext: string[];
1034
+ organization?: {
1035
+ name: string;
1036
+ description: string;
1037
+ dashboard?: string | undefined;
1038
+ logo?: string | undefined;
1039
+ icon?: string | undefined;
1040
+ logos?: string | undefined;
1041
+ website?: string | undefined;
1042
+ email?: string | undefined;
1043
+ phone?: string | undefined;
1044
+ } | undefined;
1045
+ agents: {
1046
+ deployed?: {
1047
+ /** Web URL for agent */
1048
+ web?: string | undefined;
1049
+ /** Phone number for agent */
1050
+ phone?: string | undefined;
1051
+ /** Email address for agent */
1052
+ email?: string | undefined;
1053
+ } | undefined;
1054
+ img?: (string | null) | undefined;
1055
+ /** Agent first name */
1056
+ firstName?: string | undefined;
1057
+ /** Agent last name */
1058
+ lastName?: string | undefined;
1059
+ /** Agent is inactive */
1060
+ inactive?: boolean | undefined;
1061
+ /** Programmable phone number */
1062
+ programmablePhoneNumber?: string | undefined;
1063
+ /** Programmable phone number SID */
1064
+ programmablePhoneNumberSid?: string | undefined;
1065
+ /** Email address from Scout9 gmail subdomain */
1066
+ programmableEmail?: string | undefined;
1067
+ /** Email address to forward to */
1068
+ forwardEmail?: string | undefined;
1069
+ /** Phone number to forward to */
1070
+ forwardPhone?: string | undefined;
1071
+ /** Agent title */
1072
+ title?: string;
1073
+ /** Context of the agent */
1074
+ context?: string;
1075
+ includedLocations?: string[] | undefined;
1076
+ excludedLocations?: string[] | undefined;
1077
+ model?: ("Scout9" | "bard" | "openai");
1078
+ transcripts?: {
1079
+ /** Unique ID for the message */
1080
+ id: string;
1081
+ role: "agent" | "customer" | "system";
1082
+ content: string;
1083
+ /** Datetime ISO 8601 timestamp */
1084
+ time: string;
1085
+ name?: string | undefined;
1086
+ /** Datetime ISO 8601 timestamp */
1087
+ scheduled?: string | undefined;
1088
+ /** The context generated from the message */
1089
+ context?: any | undefined;
1090
+ /** Detected intent */
1091
+ intent?: (string | undefined) | null;
1092
+ /** Confidence score of the assigned intent */
1093
+ intentScore?: (number | null) | undefined;
1094
+ /** How long to delay the message manually in seconds */
1095
+ delayInSeconds?: (number | null) | undefined;
1096
+ }[][] | undefined;
1097
+ audios?: any[] | undefined;
1098
+ }[];
1099
+ entities: {
1100
+ /** If not provided, the id will default to the route (folder) name */
1101
+ id?: string | undefined;
1102
+ definitions?: {
1103
+ /** What entity utterance this represents, if not provided, it will default to the entity id */
1104
+ utterance?: string | undefined;
1105
+ /** The value of this entity variance */
1106
+ value: string;
1107
+ /** Text representing the entity variance */
1108
+ text: string[];
1109
+ }[] | undefined;
1110
+ training?: {
1111
+ /** The assigned intent id of the given text, e.g. "I love %pizza%" could have an intent id "feedback" and "Can I purchase a %pizza%?" could have an intent id "purchase" */
1112
+ intent: string;
1113
+ /** Text to train the intent field and entities in or entity variances in example sentences or phrase. Ex: "I love %pizza%" and "Can I purchase a %pizza%?" */
1114
+ text: string;
1115
+ }[] | undefined;
1116
+ tests?: {
1117
+ /** Text to test the entity detection */
1118
+ text: string;
1119
+ expected: {
1120
+ /** The expected intent id */
1121
+ intent: string;
1122
+ context?: any;
1123
+ };
1124
+ }[] | undefined;
1125
+ /** Entity id association, used to handle route params */
1126
+ entities: string[];
1127
+ entity: string;
1128
+ api: {
1129
+ GET?: boolean | undefined;
1130
+ UPDATE?: boolean | undefined;
1131
+ QUERY?: boolean | undefined;
1132
+ PUT?: boolean | undefined;
1133
+ PATCH?: boolean | undefined;
1134
+ DELETE?: boolean | undefined;
1135
+ } | null;
1136
+ }[];
1137
+ workflows: {
1138
+ /** Workflow id association, used to handle route params */
1139
+ entities: string[];
1140
+ entity: string;
1141
+ }[];
1142
+ };
1143
+
1144
+ export type Scout9ProjectConfig = {
1145
+ tag?: string | undefined;
1146
+ llm: {
1147
+ engine: "openai";
1148
+ model: "gpt-4-1106-preview" | "gpt-4-vision-preview" | "gpt-4" | "gpt-4-0314" | "gpt-4-0613" | "gpt-4-32k" | "gpt-4-32k-0314" | "gpt-4-32k-0613" | "gpt-3.5-turbo" | "gpt-3.5-turbo-16k" | "gpt-3.5-turbo-0301" | "gpt-3.5-turbo-0613" | "gpt-3.5-turbo-16k-0613" | string;
1149
+ } | {
1150
+ engine: "llama";
1151
+ model: string;
1152
+ } | {
1153
+ engine: "bard";
1154
+ model: string;
1155
+ };
1156
+ /** Configure personal model transformer (PMT) settings to align auto replies the agent's tone */
1157
+ pmt: {
1158
+ engine: "scout9";
1159
+ model: string;
1160
+ };
1161
+ /** Determines the max auto replies without further conversation progression (defined by new context data gathered), before the conversation is locked and requires manual intervention */
1162
+ maxLockAttempts?: number | undefined;
1163
+ /** Configure the initial contexts for every conversation */
1164
+ initialContext: string[];
1165
+ organization?: {
1166
+ name: string;
1167
+ description: string;
1168
+ dashboard?: string | undefined;
1169
+ logo?: string | undefined;
1170
+ icon?: string | undefined;
1171
+ logos?: string | undefined;
1172
+ website?: string | undefined;
1173
+ email?: string | undefined;
1174
+ phone?: string | undefined;
1175
+ } | undefined;
1176
+ };
1177
+
1178
+ export type Test = {
1179
+ baz: {
1180
+ boo: {
1181
+ one: number;
1182
+ two?: number | undefined;
1183
+ };
1184
+ };
1185
+ bus: {
1186
+ foo: string;
1187
+ bar?: boolean | undefined;
1188
+ };
1189
+ };
1190
+
1191
+ export type WorkflowConfiguration = {
1192
+ /** Workflow id association, used to handle route params */
1193
+ entities: string[];
1194
+ entity: string;
1195
+ };
1196
+
1197
+ export type WorkflowEvent = {
1198
+ messages: {
1199
+ /** Unique ID for the message */
1200
+ id: string;
1201
+ role: "agent" | "customer" | "system";
1202
+ content: string;
1203
+ /** Datetime ISO 8601 timestamp */
1204
+ time: string;
1205
+ name?: string | undefined;
1206
+ /** Datetime ISO 8601 timestamp */
1207
+ scheduled?: string | undefined;
1208
+ /** The context generated from the message */
1209
+ context?: any | undefined;
1210
+ /** Detected intent */
1211
+ intent?: (string | undefined) | null;
1212
+ /** Confidence score of the assigned intent */
1213
+ intentScore?: (number | null) | undefined;
1214
+ /** How long to delay the message manually in seconds */
1215
+ delayInSeconds?: (number | null) | undefined;
1216
+ }[];
1217
+ conversation: {
1218
+ /** Default agent assigned to the conversation(s) */
1219
+ $agent: string;
1220
+ /** Customer this conversation is with */
1221
+ $customer: string;
1222
+ /** Initial contexts to load when starting the conversation */
1223
+ initialContexts?: string[] | undefined;
1224
+ environment: "phone" | "email" | "web";
1225
+ environmentProps?: {
1226
+ /** HTML Subject of the conversation */
1227
+ subject?: string | undefined;
1228
+ /** Used to sync email messages with the conversation */
1229
+ platformEmailThreadId?: string | undefined;
1230
+ } | undefined;
1231
+ /** Whether the conversation is locked or not */
1232
+ locked?: (boolean | undefined) | null;
1233
+ /** Why this conversation was locked */
1234
+ lockedReason?: (string | undefined) | null;
1235
+ /** Number attempts made until conversation is locked */
1236
+ lockAttempts?: (number | undefined) | null;
1237
+ /** What personaId/phone/email was forwarded */
1238
+ forwardedTo?: (string | undefined) | null;
1239
+ /** Datetime ISO 8601 timestamp when persona was forwarded */
1240
+ forwarded?: (string | undefined) | null;
1241
+ forwardNote?: (string | undefined) | null;
1242
+ /** Detected intent of conversation */
1243
+ intent?: (string | undefined) | null;
1244
+ /** Confidence score of the assigned intent */
1245
+ intentScore?: (number | undefined) | null;
1246
+ };
1247
+ context?: any;
1248
+ message: {
1249
+ /** Unique ID for the message */
1250
+ id: string;
1251
+ role: "agent" | "customer" | "system";
1252
+ content: string;
1253
+ /** Datetime ISO 8601 timestamp */
1254
+ time: string;
1255
+ name?: string | undefined;
1256
+ /** Datetime ISO 8601 timestamp */
1257
+ scheduled?: string | undefined;
1258
+ /** The context generated from the message */
1259
+ context?: any | undefined;
1260
+ /** Detected intent */
1261
+ intent?: (string | undefined) | null;
1262
+ /** Confidence score of the assigned intent */
1263
+ intentScore?: (number | null) | undefined;
1264
+ /** How long to delay the message manually in seconds */
1265
+ delayInSeconds?: (number | null) | undefined;
1266
+ };
1267
+ agent: {
1268
+ deployed?: {
1269
+ /** Web URL for agent */
1270
+ web?: string | undefined;
1271
+ /** Phone number for agent */
1272
+ phone?: string | undefined;
1273
+ /** Email address for agent */
1274
+ email?: string | undefined;
1275
+ } | undefined;
1276
+ img?: (string | null) | undefined;
1277
+ /** Agent first name */
1278
+ firstName?: string | undefined;
1279
+ /** Agent last name */
1280
+ lastName?: string | undefined;
1281
+ /** Agent is inactive */
1282
+ inactive?: boolean | undefined;
1283
+ /** Programmable phone number */
1284
+ programmablePhoneNumber?: string | undefined;
1285
+ /** Programmable phone number SID */
1286
+ programmablePhoneNumberSid?: string | undefined;
1287
+ /** Email address from Scout9 gmail subdomain */
1288
+ programmableEmail?: string | undefined;
1289
+ /** Email address to forward to */
1290
+ forwardEmail?: string | undefined;
1291
+ /** Phone number to forward to */
1292
+ forwardPhone?: string | undefined;
1293
+ /** Agent title */
1294
+ title?: string;
1295
+ /** Unique ID for agent */
1296
+ id: string;
1297
+ };
1298
+ customer: {
1299
+ firstName?: string | undefined;
1300
+ lastName?: string | undefined;
1301
+ name: string;
1302
+ email?: (string | null) | undefined;
1303
+ phone?: (string | null) | undefined;
1304
+ img?: (string | null) | undefined;
1305
+ neighborhood?: (string | null) | undefined;
1306
+ city?: (string | null) | undefined;
1307
+ country?: (string | null) | undefined;
1308
+ line1?: (string | null) | undefined;
1309
+ line2?: (string | null) | undefined;
1310
+ postal_code?: (string | null) | undefined;
1311
+ state?: (string | null) | undefined;
1312
+ town?: (string | null) | undefined;
1313
+ joined?: (string | null) | undefined;
1314
+ stripe?: (string | null) | undefined;
1315
+ stripeDev?: (string | null) | undefined;
1316
+ };
1317
+ intent: {
1318
+ current: string | null;
1319
+ flow: string[];
1320
+ initial: string | null;
1321
+ };
1322
+ stagnationCount: number;
1323
+ /** Any developer notes to provide */
1324
+ note?: string | undefined;
1325
+ };
1326
+
1327
+ export type WorkflowFunction = (args_0: {
1328
+ messages: {
1329
+ /** Unique ID for the message */
1330
+ id: string;
1331
+ role: "agent" | "customer" | "system";
1332
+ content: string;
1333
+ /** Datetime ISO 8601 timestamp */
1334
+ time: string;
1335
+ name?: string | undefined;
1336
+ /** Datetime ISO 8601 timestamp */
1337
+ scheduled?: string | undefined;
1338
+ /** The context generated from the message */
1339
+ context?: any | undefined;
1340
+ /** Detected intent */
1341
+ intent?: (string | undefined) | null;
1342
+ /** Confidence score of the assigned intent */
1343
+ intentScore?: (number | null) | undefined;
1344
+ /** How long to delay the message manually in seconds */
1345
+ delayInSeconds?: (number | null) | undefined;
1346
+ }[];
1347
+ conversation: {
1348
+ /** Default agent assigned to the conversation(s) */
1349
+ $agent: string;
1350
+ /** Customer this conversation is with */
1351
+ $customer: string;
1352
+ /** Initial contexts to load when starting the conversation */
1353
+ initialContexts?: string[] | undefined;
1354
+ environment: "phone" | "email" | "web";
1355
+ environmentProps?: {
1356
+ /** HTML Subject of the conversation */
1357
+ subject?: string | undefined;
1358
+ /** Used to sync email messages with the conversation */
1359
+ platformEmailThreadId?: string | undefined;
1360
+ } | undefined;
1361
+ /** Whether the conversation is locked or not */
1362
+ locked?: (boolean | undefined) | null;
1363
+ /** Why this conversation was locked */
1364
+ lockedReason?: (string | undefined) | null;
1365
+ /** Number attempts made until conversation is locked */
1366
+ lockAttempts?: (number | undefined) | null;
1367
+ /** What personaId/phone/email was forwarded */
1368
+ forwardedTo?: (string | undefined) | null;
1369
+ /** Datetime ISO 8601 timestamp when persona was forwarded */
1370
+ forwarded?: (string | undefined) | null;
1371
+ forwardNote?: (string | undefined) | null;
1372
+ /** Detected intent of conversation */
1373
+ intent?: (string | undefined) | null;
1374
+ /** Confidence score of the assigned intent */
1375
+ intentScore?: (number | undefined) | null;
1376
+ };
1377
+ context?: any;
1378
+ message: {
1379
+ /** Unique ID for the message */
1380
+ id: string;
1381
+ role: "agent" | "customer" | "system";
1382
+ content: string;
1383
+ /** Datetime ISO 8601 timestamp */
1384
+ time: string;
1385
+ name?: string | undefined;
1386
+ /** Datetime ISO 8601 timestamp */
1387
+ scheduled?: string | undefined;
1388
+ /** The context generated from the message */
1389
+ context?: any | undefined;
1390
+ /** Detected intent */
1391
+ intent?: (string | undefined) | null;
1392
+ /** Confidence score of the assigned intent */
1393
+ intentScore?: (number | null) | undefined;
1394
+ /** How long to delay the message manually in seconds */
1395
+ delayInSeconds?: (number | null) | undefined;
1396
+ };
1397
+ agent: {
1398
+ deployed?: {
1399
+ /** Web URL for agent */
1400
+ web?: string | undefined;
1401
+ /** Phone number for agent */
1402
+ phone?: string | undefined;
1403
+ /** Email address for agent */
1404
+ email?: string | undefined;
1405
+ } | undefined;
1406
+ img?: (string | null) | undefined;
1407
+ /** Agent first name */
1408
+ firstName?: string | undefined;
1409
+ /** Agent last name */
1410
+ lastName?: string | undefined;
1411
+ /** Agent is inactive */
1412
+ inactive?: boolean | undefined;
1413
+ /** Programmable phone number */
1414
+ programmablePhoneNumber?: string | undefined;
1415
+ /** Programmable phone number SID */
1416
+ programmablePhoneNumberSid?: string | undefined;
1417
+ /** Email address from Scout9 gmail subdomain */
1418
+ programmableEmail?: string | undefined;
1419
+ /** Email address to forward to */
1420
+ forwardEmail?: string | undefined;
1421
+ /** Phone number to forward to */
1422
+ forwardPhone?: string | undefined;
1423
+ /** Agent title */
1424
+ title?: string;
1425
+ /** Unique ID for agent */
1426
+ id: string;
1427
+ };
1428
+ customer: {
1429
+ firstName?: string | undefined;
1430
+ lastName?: string | undefined;
1431
+ name: string;
1432
+ email?: (string | null) | undefined;
1433
+ phone?: (string | null) | undefined;
1434
+ img?: (string | null) | undefined;
1435
+ neighborhood?: (string | null) | undefined;
1436
+ city?: (string | null) | undefined;
1437
+ country?: (string | null) | undefined;
1438
+ line1?: (string | null) | undefined;
1439
+ line2?: (string | null) | undefined;
1440
+ postal_code?: (string | null) | undefined;
1441
+ state?: (string | null) | undefined;
1442
+ town?: (string | null) | undefined;
1443
+ joined?: (string | null) | undefined;
1444
+ stripe?: (string | null) | undefined;
1445
+ stripeDev?: (string | null) | undefined;
1446
+ };
1447
+ intent: {
1448
+ current: string | null;
1449
+ flow: string[];
1450
+ initial: string | null;
1451
+ };
1452
+ stagnationCount: number;
1453
+ /** Any developer notes to provide */
1454
+ note?: string | undefined;
1455
+ }, ...args_1: unknown[]) => Promise<{
1456
+ /** Forward input information of a conversation */
1457
+ forward?: (boolean | string | {
1458
+ to?: string | undefined;
1459
+ mode?: ("after-reply" | "immediately") | undefined;
1460
+ /** Note to provide to the agent */
1461
+ note?: string | undefined;
1462
+ }) | undefined;
1463
+ /** Note to provide to the agent, recommend using forward object api instead */
1464
+ forwardNote?: string | undefined;
1465
+ instructions?: (string | {
1466
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1467
+ id?: string | undefined;
1468
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1469
+ persist?: boolean | undefined;
1470
+ content: string;
1471
+ } | string[] | {
1472
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1473
+ id?: string | undefined;
1474
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1475
+ persist?: boolean | undefined;
1476
+ content: string;
1477
+ }[]) | undefined;
1478
+ removeInstructions?: string[] | undefined;
1479
+ message?: string | undefined;
1480
+ secondsDelay?: number | undefined;
1481
+ scheduled?: number | undefined;
1482
+ contextUpsert?: {
1483
+ [x: string]: any;
1484
+ } | undefined;
1485
+ resetIntent?: boolean | undefined;
1486
+ followup?: ({
1487
+ scheduled: number;
1488
+ cancelIf?: {
1489
+ [x: string]: any;
1490
+ } | undefined;
1491
+ /** This will still run even if the conversation is locked, defaults to false */
1492
+ overrideLock?: boolean | undefined;
1493
+ /** Manual message sent to client */
1494
+ message: string;
1495
+ } | {
1496
+ scheduled: number;
1497
+ cancelIf?: {
1498
+ [x: string]: any;
1499
+ } | undefined;
1500
+ /** This will still run even if the conversation is locked, defaults to false */
1501
+ overrideLock?: boolean | undefined;
1502
+ instructions: string | {
1503
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1504
+ id?: string | undefined;
1505
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1506
+ persist?: boolean | undefined;
1507
+ content: string;
1508
+ } | string[] | {
1509
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1510
+ id?: string | undefined;
1511
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1512
+ persist?: boolean | undefined;
1513
+ content: string;
1514
+ }[];
1515
+ }) | undefined;
1516
+ anticipate?: ({
1517
+ did: string;
1518
+ yes: {
1519
+ /** Forward input information of a conversation */
1520
+ forward?: (boolean | string | {
1521
+ to?: string | undefined;
1522
+ mode?: ("after-reply" | "immediately") | undefined;
1523
+ /** Note to provide to the agent */
1524
+ note?: string | undefined;
1525
+ }) | undefined;
1526
+ /** Note to provide to the agent, recommend using forward object api instead */
1527
+ forwardNote?: string | undefined;
1528
+ instructions?: (string | {
1529
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1530
+ id?: string | undefined;
1531
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1532
+ persist?: boolean | undefined;
1533
+ content: string;
1534
+ } | string[] | {
1535
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1536
+ id?: string | undefined;
1537
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1538
+ persist?: boolean | undefined;
1539
+ content: string;
1540
+ }[]) | undefined;
1541
+ removeInstructions?: string[] | undefined;
1542
+ message?: string | undefined;
1543
+ secondsDelay?: number | undefined;
1544
+ scheduled?: number | undefined;
1545
+ contextUpsert?: {
1546
+ [x: string]: any;
1547
+ } | undefined;
1548
+ resetIntent?: boolean | undefined;
1549
+ followup?: ({
1550
+ scheduled: number;
1551
+ cancelIf?: {
1552
+ [x: string]: any;
1553
+ } | undefined;
1554
+ /** This will still run even if the conversation is locked, defaults to false */
1555
+ overrideLock?: boolean | undefined;
1556
+ /** Manual message sent to client */
1557
+ message: string;
1558
+ } | {
1559
+ scheduled: number;
1560
+ cancelIf?: {
1561
+ [x: string]: any;
1562
+ } | undefined;
1563
+ /** This will still run even if the conversation is locked, defaults to false */
1564
+ overrideLock?: boolean | undefined;
1565
+ instructions: string | {
1566
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1567
+ id?: string | undefined;
1568
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1569
+ persist?: boolean | undefined;
1570
+ content: string;
1571
+ } | string[] | {
1572
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1573
+ id?: string | undefined;
1574
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1575
+ persist?: boolean | undefined;
1576
+ content: string;
1577
+ }[];
1578
+ }) | undefined;
1579
+ };
1580
+ no: {
1581
+ /** Forward input information of a conversation */
1582
+ forward?: (boolean | string | {
1583
+ to?: string | undefined;
1584
+ mode?: ("after-reply" | "immediately") | undefined;
1585
+ /** Note to provide to the agent */
1586
+ note?: string | undefined;
1587
+ }) | undefined;
1588
+ /** Note to provide to the agent, recommend using forward object api instead */
1589
+ forwardNote?: string | undefined;
1590
+ instructions?: (string | {
1591
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1592
+ id?: string | undefined;
1593
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1594
+ persist?: boolean | undefined;
1595
+ content: string;
1596
+ } | string[] | {
1597
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1598
+ id?: string | undefined;
1599
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1600
+ persist?: boolean | undefined;
1601
+ content: string;
1602
+ }[]) | undefined;
1603
+ removeInstructions?: string[] | undefined;
1604
+ message?: string | undefined;
1605
+ secondsDelay?: number | undefined;
1606
+ scheduled?: number | undefined;
1607
+ contextUpsert?: {
1608
+ [x: string]: any;
1609
+ } | undefined;
1610
+ resetIntent?: boolean | undefined;
1611
+ followup?: ({
1612
+ scheduled: number;
1613
+ cancelIf?: {
1614
+ [x: string]: any;
1615
+ } | undefined;
1616
+ /** This will still run even if the conversation is locked, defaults to false */
1617
+ overrideLock?: boolean | undefined;
1618
+ /** Manual message sent to client */
1619
+ message: string;
1620
+ } | {
1621
+ scheduled: number;
1622
+ cancelIf?: {
1623
+ [x: string]: any;
1624
+ } | undefined;
1625
+ /** This will still run even if the conversation is locked, defaults to false */
1626
+ overrideLock?: boolean | undefined;
1627
+ instructions: string | {
1628
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1629
+ id?: string | undefined;
1630
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1631
+ persist?: boolean | undefined;
1632
+ content: string;
1633
+ } | string[] | {
1634
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1635
+ id?: string | undefined;
1636
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1637
+ persist?: boolean | undefined;
1638
+ content: string;
1639
+ }[];
1640
+ }) | undefined;
1641
+ };
1642
+ } | {
1643
+ /** Forward input information of a conversation */
1644
+ forward?: (boolean | string | {
1645
+ to?: string | undefined;
1646
+ mode?: ("after-reply" | "immediately") | undefined;
1647
+ /** Note to provide to the agent */
1648
+ note?: string | undefined;
1649
+ }) | undefined;
1650
+ /** Note to provide to the agent, recommend using forward object api instead */
1651
+ forwardNote?: string | undefined;
1652
+ instructions?: (string | {
1653
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1654
+ id?: string | undefined;
1655
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1656
+ persist?: boolean | undefined;
1657
+ content: string;
1658
+ } | string[] | {
1659
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1660
+ id?: string | undefined;
1661
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1662
+ persist?: boolean | undefined;
1663
+ content: string;
1664
+ }[]) | undefined;
1665
+ removeInstructions?: string[] | undefined;
1666
+ message?: string | undefined;
1667
+ secondsDelay?: number | undefined;
1668
+ scheduled?: number | undefined;
1669
+ contextUpsert?: {
1670
+ [x: string]: any;
1671
+ } | undefined;
1672
+ resetIntent?: boolean | undefined;
1673
+ followup?: ({
1674
+ scheduled: number;
1675
+ cancelIf?: {
1676
+ [x: string]: any;
1677
+ } | undefined;
1678
+ /** This will still run even if the conversation is locked, defaults to false */
1679
+ overrideLock?: boolean | undefined;
1680
+ /** Manual message sent to client */
1681
+ message: string;
1682
+ } | {
1683
+ scheduled: number;
1684
+ cancelIf?: {
1685
+ [x: string]: any;
1686
+ } | undefined;
1687
+ /** This will still run even if the conversation is locked, defaults to false */
1688
+ overrideLock?: boolean | undefined;
1689
+ instructions: string | {
1690
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1691
+ id?: string | undefined;
1692
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1693
+ persist?: boolean | undefined;
1694
+ content: string;
1695
+ } | string[] | {
1696
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1697
+ id?: string | undefined;
1698
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1699
+ persist?: boolean | undefined;
1700
+ content: string;
1701
+ }[];
1702
+ }) | undefined;
1703
+ keywords: string[];
1704
+ }[]) | undefined;
1705
+ } | {
1706
+ /** Forward input information of a conversation */
1707
+ forward?: (boolean | string | {
1708
+ to?: string | undefined;
1709
+ mode?: ("after-reply" | "immediately") | undefined;
1710
+ /** Note to provide to the agent */
1711
+ note?: string | undefined;
1712
+ }) | undefined;
1713
+ /** Note to provide to the agent, recommend using forward object api instead */
1714
+ forwardNote?: string | undefined;
1715
+ instructions?: (string | {
1716
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1717
+ id?: string | undefined;
1718
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1719
+ persist?: boolean | undefined;
1720
+ content: string;
1721
+ } | string[] | {
1722
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1723
+ id?: string | undefined;
1724
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1725
+ persist?: boolean | undefined;
1726
+ content: string;
1727
+ }[]) | undefined;
1728
+ removeInstructions?: string[] | undefined;
1729
+ message?: string | undefined;
1730
+ secondsDelay?: number | undefined;
1731
+ scheduled?: number | undefined;
1732
+ contextUpsert?: {
1733
+ [x: string]: any;
1734
+ } | undefined;
1735
+ resetIntent?: boolean | undefined;
1736
+ followup?: ({
1737
+ scheduled: number;
1738
+ cancelIf?: {
1739
+ [x: string]: any;
1740
+ } | undefined;
1741
+ /** This will still run even if the conversation is locked, defaults to false */
1742
+ overrideLock?: boolean | undefined;
1743
+ /** Manual message sent to client */
1744
+ message: string;
1745
+ } | {
1746
+ scheduled: number;
1747
+ cancelIf?: {
1748
+ [x: string]: any;
1749
+ } | undefined;
1750
+ /** This will still run even if the conversation is locked, defaults to false */
1751
+ overrideLock?: boolean | undefined;
1752
+ instructions: string | {
1753
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1754
+ id?: string | undefined;
1755
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1756
+ persist?: boolean | undefined;
1757
+ content: string;
1758
+ } | string[] | {
1759
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1760
+ id?: string | undefined;
1761
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1762
+ persist?: boolean | undefined;
1763
+ content: string;
1764
+ }[];
1765
+ }) | undefined;
1766
+ anticipate?: ({
1767
+ did: string;
1768
+ yes: {
1769
+ /** Forward input information of a conversation */
1770
+ forward?: (boolean | string | {
1771
+ to?: string | undefined;
1772
+ mode?: ("after-reply" | "immediately") | undefined;
1773
+ /** Note to provide to the agent */
1774
+ note?: string | undefined;
1775
+ }) | undefined;
1776
+ /** Note to provide to the agent, recommend using forward object api instead */
1777
+ forwardNote?: string | undefined;
1778
+ instructions?: (string | {
1779
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1780
+ id?: string | undefined;
1781
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1782
+ persist?: boolean | undefined;
1783
+ content: string;
1784
+ } | string[] | {
1785
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1786
+ id?: string | undefined;
1787
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1788
+ persist?: boolean | undefined;
1789
+ content: string;
1790
+ }[]) | undefined;
1791
+ removeInstructions?: string[] | undefined;
1792
+ message?: string | undefined;
1793
+ secondsDelay?: number | undefined;
1794
+ scheduled?: number | undefined;
1795
+ contextUpsert?: {
1796
+ [x: string]: any;
1797
+ } | undefined;
1798
+ resetIntent?: boolean | undefined;
1799
+ followup?: ({
1800
+ scheduled: number;
1801
+ cancelIf?: {
1802
+ [x: string]: any;
1803
+ } | undefined;
1804
+ /** This will still run even if the conversation is locked, defaults to false */
1805
+ overrideLock?: boolean | undefined;
1806
+ /** Manual message sent to client */
1807
+ message: string;
1808
+ } | {
1809
+ scheduled: number;
1810
+ cancelIf?: {
1811
+ [x: string]: any;
1812
+ } | undefined;
1813
+ /** This will still run even if the conversation is locked, defaults to false */
1814
+ overrideLock?: boolean | undefined;
1815
+ instructions: string | {
1816
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1817
+ id?: string | undefined;
1818
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1819
+ persist?: boolean | undefined;
1820
+ content: string;
1821
+ } | string[] | {
1822
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1823
+ id?: string | undefined;
1824
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1825
+ persist?: boolean | undefined;
1826
+ content: string;
1827
+ }[];
1828
+ }) | undefined;
1829
+ };
1830
+ no: {
1831
+ /** Forward input information of a conversation */
1832
+ forward?: (boolean | string | {
1833
+ to?: string | undefined;
1834
+ mode?: ("after-reply" | "immediately") | undefined;
1835
+ /** Note to provide to the agent */
1836
+ note?: string | undefined;
1837
+ }) | undefined;
1838
+ /** Note to provide to the agent, recommend using forward object api instead */
1839
+ forwardNote?: string | undefined;
1840
+ instructions?: (string | {
1841
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1842
+ id?: string | undefined;
1843
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1844
+ persist?: boolean | undefined;
1845
+ content: string;
1846
+ } | string[] | {
1847
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1848
+ id?: string | undefined;
1849
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1850
+ persist?: boolean | undefined;
1851
+ content: string;
1852
+ }[]) | undefined;
1853
+ removeInstructions?: string[] | undefined;
1854
+ message?: string | undefined;
1855
+ secondsDelay?: number | undefined;
1856
+ scheduled?: number | undefined;
1857
+ contextUpsert?: {
1858
+ [x: string]: any;
1859
+ } | undefined;
1860
+ resetIntent?: boolean | undefined;
1861
+ followup?: ({
1862
+ scheduled: number;
1863
+ cancelIf?: {
1864
+ [x: string]: any;
1865
+ } | undefined;
1866
+ /** This will still run even if the conversation is locked, defaults to false */
1867
+ overrideLock?: boolean | undefined;
1868
+ /** Manual message sent to client */
1869
+ message: string;
1870
+ } | {
1871
+ scheduled: number;
1872
+ cancelIf?: {
1873
+ [x: string]: any;
1874
+ } | undefined;
1875
+ /** This will still run even if the conversation is locked, defaults to false */
1876
+ overrideLock?: boolean | undefined;
1877
+ instructions: string | {
1878
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1879
+ id?: string | undefined;
1880
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1881
+ persist?: boolean | undefined;
1882
+ content: string;
1883
+ } | string[] | {
1884
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1885
+ id?: string | undefined;
1886
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1887
+ persist?: boolean | undefined;
1888
+ content: string;
1889
+ }[];
1890
+ }) | undefined;
1891
+ };
1892
+ } | {
1893
+ /** Forward input information of a conversation */
1894
+ forward?: (boolean | string | {
1895
+ to?: string | undefined;
1896
+ mode?: ("after-reply" | "immediately") | undefined;
1897
+ /** Note to provide to the agent */
1898
+ note?: string | undefined;
1899
+ }) | undefined;
1900
+ /** Note to provide to the agent, recommend using forward object api instead */
1901
+ forwardNote?: string | undefined;
1902
+ instructions?: (string | {
1903
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1904
+ id?: string | undefined;
1905
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1906
+ persist?: boolean | undefined;
1907
+ content: string;
1908
+ } | string[] | {
1909
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1910
+ id?: string | undefined;
1911
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1912
+ persist?: boolean | undefined;
1913
+ content: string;
1914
+ }[]) | undefined;
1915
+ removeInstructions?: string[] | undefined;
1916
+ message?: string | undefined;
1917
+ secondsDelay?: number | undefined;
1918
+ scheduled?: number | undefined;
1919
+ contextUpsert?: {
1920
+ [x: string]: any;
1921
+ } | undefined;
1922
+ resetIntent?: boolean | undefined;
1923
+ followup?: ({
1924
+ scheduled: number;
1925
+ cancelIf?: {
1926
+ [x: string]: any;
1927
+ } | undefined;
1928
+ /** This will still run even if the conversation is locked, defaults to false */
1929
+ overrideLock?: boolean | undefined;
1930
+ /** Manual message sent to client */
1931
+ message: string;
1932
+ } | {
1933
+ scheduled: number;
1934
+ cancelIf?: {
1935
+ [x: string]: any;
1936
+ } | undefined;
1937
+ /** This will still run even if the conversation is locked, defaults to false */
1938
+ overrideLock?: boolean | undefined;
1939
+ instructions: string | {
1940
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1941
+ id?: string | undefined;
1942
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1943
+ persist?: boolean | undefined;
1944
+ content: string;
1945
+ } | string[] | {
1946
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1947
+ id?: string | undefined;
1948
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1949
+ persist?: boolean | undefined;
1950
+ content: string;
1951
+ }[];
1952
+ }) | undefined;
1953
+ keywords: string[];
1954
+ }[]) | undefined;
1955
+ }[]> | ({
1956
+ /** Forward input information of a conversation */
1957
+ forward?: (boolean | string | {
1958
+ to?: string | undefined;
1959
+ mode?: ("after-reply" | "immediately") | undefined;
1960
+ /** Note to provide to the agent */
1961
+ note?: string | undefined;
1962
+ }) | undefined;
1963
+ /** Note to provide to the agent, recommend using forward object api instead */
1964
+ forwardNote?: string | undefined;
1965
+ instructions?: (string | {
1966
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1967
+ id?: string | undefined;
1968
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1969
+ persist?: boolean | undefined;
1970
+ content: string;
1971
+ } | string[] | {
1972
+ /** Unique ID for the instruction, this is used to remove the instruction later */
1973
+ id?: string | undefined;
1974
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
1975
+ persist?: boolean | undefined;
1976
+ content: string;
1977
+ }[]) | undefined;
1978
+ removeInstructions?: string[] | undefined;
1979
+ message?: string | undefined;
1980
+ secondsDelay?: number | undefined;
1981
+ scheduled?: number | undefined;
1982
+ contextUpsert?: {
1983
+ [x: string]: any;
1984
+ } | undefined;
1985
+ resetIntent?: boolean | undefined;
1986
+ followup?: ({
1987
+ scheduled: number;
1988
+ cancelIf?: {
1989
+ [x: string]: any;
1990
+ } | undefined;
1991
+ /** This will still run even if the conversation is locked, defaults to false */
1992
+ overrideLock?: boolean | undefined;
1993
+ /** Manual message sent to client */
1994
+ message: string;
1995
+ } | {
1996
+ scheduled: number;
1997
+ cancelIf?: {
1998
+ [x: string]: any;
1999
+ } | undefined;
2000
+ /** This will still run even if the conversation is locked, defaults to false */
2001
+ overrideLock?: boolean | undefined;
2002
+ instructions: string | {
2003
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2004
+ id?: string | undefined;
2005
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2006
+ persist?: boolean | undefined;
2007
+ content: string;
2008
+ } | string[] | {
2009
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2010
+ id?: string | undefined;
2011
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2012
+ persist?: boolean | undefined;
2013
+ content: string;
2014
+ }[];
2015
+ }) | undefined;
2016
+ anticipate?: ({
2017
+ did: string;
2018
+ yes: {
2019
+ /** Forward input information of a conversation */
2020
+ forward?: (boolean | string | {
2021
+ to?: string | undefined;
2022
+ mode?: ("after-reply" | "immediately") | undefined;
2023
+ /** Note to provide to the agent */
2024
+ note?: string | undefined;
2025
+ }) | undefined;
2026
+ /** Note to provide to the agent, recommend using forward object api instead */
2027
+ forwardNote?: string | undefined;
2028
+ instructions?: (string | {
2029
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2030
+ id?: string | undefined;
2031
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2032
+ persist?: boolean | undefined;
2033
+ content: string;
2034
+ } | string[] | {
2035
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2036
+ id?: string | undefined;
2037
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2038
+ persist?: boolean | undefined;
2039
+ content: string;
2040
+ }[]) | undefined;
2041
+ removeInstructions?: string[] | undefined;
2042
+ message?: string | undefined;
2043
+ secondsDelay?: number | undefined;
2044
+ scheduled?: number | undefined;
2045
+ contextUpsert?: {
2046
+ [x: string]: any;
2047
+ } | undefined;
2048
+ resetIntent?: boolean | undefined;
2049
+ followup?: ({
2050
+ scheduled: number;
2051
+ cancelIf?: {
2052
+ [x: string]: any;
2053
+ } | undefined;
2054
+ /** This will still run even if the conversation is locked, defaults to false */
2055
+ overrideLock?: boolean | undefined;
2056
+ /** Manual message sent to client */
2057
+ message: string;
2058
+ } | {
2059
+ scheduled: number;
2060
+ cancelIf?: {
2061
+ [x: string]: any;
2062
+ } | undefined;
2063
+ /** This will still run even if the conversation is locked, defaults to false */
2064
+ overrideLock?: boolean | undefined;
2065
+ instructions: string | {
2066
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2067
+ id?: string | undefined;
2068
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2069
+ persist?: boolean | undefined;
2070
+ content: string;
2071
+ } | string[] | {
2072
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2073
+ id?: string | undefined;
2074
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2075
+ persist?: boolean | undefined;
2076
+ content: string;
2077
+ }[];
2078
+ }) | undefined;
2079
+ };
2080
+ no: {
2081
+ /** Forward input information of a conversation */
2082
+ forward?: (boolean | string | {
2083
+ to?: string | undefined;
2084
+ mode?: ("after-reply" | "immediately") | undefined;
2085
+ /** Note to provide to the agent */
2086
+ note?: string | undefined;
2087
+ }) | undefined;
2088
+ /** Note to provide to the agent, recommend using forward object api instead */
2089
+ forwardNote?: string | undefined;
2090
+ instructions?: (string | {
2091
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2092
+ id?: string | undefined;
2093
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2094
+ persist?: boolean | undefined;
2095
+ content: string;
2096
+ } | string[] | {
2097
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2098
+ id?: string | undefined;
2099
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2100
+ persist?: boolean | undefined;
2101
+ content: string;
2102
+ }[]) | undefined;
2103
+ removeInstructions?: string[] | undefined;
2104
+ message?: string | undefined;
2105
+ secondsDelay?: number | undefined;
2106
+ scheduled?: number | undefined;
2107
+ contextUpsert?: {
2108
+ [x: string]: any;
2109
+ } | undefined;
2110
+ resetIntent?: boolean | undefined;
2111
+ followup?: ({
2112
+ scheduled: number;
2113
+ cancelIf?: {
2114
+ [x: string]: any;
2115
+ } | undefined;
2116
+ /** This will still run even if the conversation is locked, defaults to false */
2117
+ overrideLock?: boolean | undefined;
2118
+ /** Manual message sent to client */
2119
+ message: string;
2120
+ } | {
2121
+ scheduled: number;
2122
+ cancelIf?: {
2123
+ [x: string]: any;
2124
+ } | undefined;
2125
+ /** This will still run even if the conversation is locked, defaults to false */
2126
+ overrideLock?: boolean | undefined;
2127
+ instructions: string | {
2128
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2129
+ id?: string | undefined;
2130
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2131
+ persist?: boolean | undefined;
2132
+ content: string;
2133
+ } | string[] | {
2134
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2135
+ id?: string | undefined;
2136
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2137
+ persist?: boolean | undefined;
2138
+ content: string;
2139
+ }[];
2140
+ }) | undefined;
2141
+ };
2142
+ } | {
2143
+ /** Forward input information of a conversation */
2144
+ forward?: (boolean | string | {
2145
+ to?: string | undefined;
2146
+ mode?: ("after-reply" | "immediately") | undefined;
2147
+ /** Note to provide to the agent */
2148
+ note?: string | undefined;
2149
+ }) | undefined;
2150
+ /** Note to provide to the agent, recommend using forward object api instead */
2151
+ forwardNote?: string | undefined;
2152
+ instructions?: (string | {
2153
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2154
+ id?: string | undefined;
2155
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2156
+ persist?: boolean | undefined;
2157
+ content: string;
2158
+ } | string[] | {
2159
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2160
+ id?: string | undefined;
2161
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2162
+ persist?: boolean | undefined;
2163
+ content: string;
2164
+ }[]) | undefined;
2165
+ removeInstructions?: string[] | undefined;
2166
+ message?: string | undefined;
2167
+ secondsDelay?: number | undefined;
2168
+ scheduled?: number | undefined;
2169
+ contextUpsert?: {
2170
+ [x: string]: any;
2171
+ } | undefined;
2172
+ resetIntent?: boolean | undefined;
2173
+ followup?: ({
2174
+ scheduled: number;
2175
+ cancelIf?: {
2176
+ [x: string]: any;
2177
+ } | undefined;
2178
+ /** This will still run even if the conversation is locked, defaults to false */
2179
+ overrideLock?: boolean | undefined;
2180
+ /** Manual message sent to client */
2181
+ message: string;
2182
+ } | {
2183
+ scheduled: number;
2184
+ cancelIf?: {
2185
+ [x: string]: any;
2186
+ } | undefined;
2187
+ /** This will still run even if the conversation is locked, defaults to false */
2188
+ overrideLock?: boolean | undefined;
2189
+ instructions: string | {
2190
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2191
+ id?: string | undefined;
2192
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2193
+ persist?: boolean | undefined;
2194
+ content: string;
2195
+ } | string[] | {
2196
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2197
+ id?: string | undefined;
2198
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2199
+ persist?: boolean | undefined;
2200
+ content: string;
2201
+ }[];
2202
+ }) | undefined;
2203
+ keywords: string[];
2204
+ }[]) | undefined;
2205
+ } | {
2206
+ /** Forward input information of a conversation */
2207
+ forward?: (boolean | string | {
2208
+ to?: string | undefined;
2209
+ mode?: ("after-reply" | "immediately") | undefined;
2210
+ /** Note to provide to the agent */
2211
+ note?: string | undefined;
2212
+ }) | undefined;
2213
+ /** Note to provide to the agent, recommend using forward object api instead */
2214
+ forwardNote?: string | undefined;
2215
+ instructions?: (string | {
2216
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2217
+ id?: string | undefined;
2218
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2219
+ persist?: boolean | undefined;
2220
+ content: string;
2221
+ } | string[] | {
2222
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2223
+ id?: string | undefined;
2224
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2225
+ persist?: boolean | undefined;
2226
+ content: string;
2227
+ }[]) | undefined;
2228
+ removeInstructions?: string[] | undefined;
2229
+ message?: string | undefined;
2230
+ secondsDelay?: number | undefined;
2231
+ scheduled?: number | undefined;
2232
+ contextUpsert?: {
2233
+ [x: string]: any;
2234
+ } | undefined;
2235
+ resetIntent?: boolean | undefined;
2236
+ followup?: ({
2237
+ scheduled: number;
2238
+ cancelIf?: {
2239
+ [x: string]: any;
2240
+ } | undefined;
2241
+ /** This will still run even if the conversation is locked, defaults to false */
2242
+ overrideLock?: boolean | undefined;
2243
+ /** Manual message sent to client */
2244
+ message: string;
2245
+ } | {
2246
+ scheduled: number;
2247
+ cancelIf?: {
2248
+ [x: string]: any;
2249
+ } | undefined;
2250
+ /** This will still run even if the conversation is locked, defaults to false */
2251
+ overrideLock?: boolean | undefined;
2252
+ instructions: string | {
2253
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2254
+ id?: string | undefined;
2255
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2256
+ persist?: boolean | undefined;
2257
+ content: string;
2258
+ } | string[] | {
2259
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2260
+ id?: string | undefined;
2261
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2262
+ persist?: boolean | undefined;
2263
+ content: string;
2264
+ }[];
2265
+ }) | undefined;
2266
+ anticipate?: ({
2267
+ did: string;
2268
+ yes: {
2269
+ /** Forward input information of a conversation */
2270
+ forward?: (boolean | string | {
2271
+ to?: string | undefined;
2272
+ mode?: ("after-reply" | "immediately") | undefined;
2273
+ /** Note to provide to the agent */
2274
+ note?: string | undefined;
2275
+ }) | undefined;
2276
+ /** Note to provide to the agent, recommend using forward object api instead */
2277
+ forwardNote?: string | undefined;
2278
+ instructions?: (string | {
2279
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2280
+ id?: string | undefined;
2281
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2282
+ persist?: boolean | undefined;
2283
+ content: string;
2284
+ } | string[] | {
2285
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2286
+ id?: string | undefined;
2287
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2288
+ persist?: boolean | undefined;
2289
+ content: string;
2290
+ }[]) | undefined;
2291
+ removeInstructions?: string[] | undefined;
2292
+ message?: string | undefined;
2293
+ secondsDelay?: number | undefined;
2294
+ scheduled?: number | undefined;
2295
+ contextUpsert?: {
2296
+ [x: string]: any;
2297
+ } | undefined;
2298
+ resetIntent?: boolean | undefined;
2299
+ followup?: ({
2300
+ scheduled: number;
2301
+ cancelIf?: {
2302
+ [x: string]: any;
2303
+ } | undefined;
2304
+ /** This will still run even if the conversation is locked, defaults to false */
2305
+ overrideLock?: boolean | undefined;
2306
+ /** Manual message sent to client */
2307
+ message: string;
2308
+ } | {
2309
+ scheduled: number;
2310
+ cancelIf?: {
2311
+ [x: string]: any;
2312
+ } | undefined;
2313
+ /** This will still run even if the conversation is locked, defaults to false */
2314
+ overrideLock?: boolean | undefined;
2315
+ instructions: string | {
2316
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2317
+ id?: string | undefined;
2318
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2319
+ persist?: boolean | undefined;
2320
+ content: string;
2321
+ } | string[] | {
2322
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2323
+ id?: string | undefined;
2324
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2325
+ persist?: boolean | undefined;
2326
+ content: string;
2327
+ }[];
2328
+ }) | undefined;
2329
+ };
2330
+ no: {
2331
+ /** Forward input information of a conversation */
2332
+ forward?: (boolean | string | {
2333
+ to?: string | undefined;
2334
+ mode?: ("after-reply" | "immediately") | undefined;
2335
+ /** Note to provide to the agent */
2336
+ note?: string | undefined;
2337
+ }) | undefined;
2338
+ /** Note to provide to the agent, recommend using forward object api instead */
2339
+ forwardNote?: string | undefined;
2340
+ instructions?: (string | {
2341
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2342
+ id?: string | undefined;
2343
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2344
+ persist?: boolean | undefined;
2345
+ content: string;
2346
+ } | string[] | {
2347
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2348
+ id?: string | undefined;
2349
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2350
+ persist?: boolean | undefined;
2351
+ content: string;
2352
+ }[]) | undefined;
2353
+ removeInstructions?: string[] | undefined;
2354
+ message?: string | undefined;
2355
+ secondsDelay?: number | undefined;
2356
+ scheduled?: number | undefined;
2357
+ contextUpsert?: {
2358
+ [x: string]: any;
2359
+ } | undefined;
2360
+ resetIntent?: boolean | undefined;
2361
+ followup?: ({
2362
+ scheduled: number;
2363
+ cancelIf?: {
2364
+ [x: string]: any;
2365
+ } | undefined;
2366
+ /** This will still run even if the conversation is locked, defaults to false */
2367
+ overrideLock?: boolean | undefined;
2368
+ /** Manual message sent to client */
2369
+ message: string;
2370
+ } | {
2371
+ scheduled: number;
2372
+ cancelIf?: {
2373
+ [x: string]: any;
2374
+ } | undefined;
2375
+ /** This will still run even if the conversation is locked, defaults to false */
2376
+ overrideLock?: boolean | undefined;
2377
+ instructions: string | {
2378
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2379
+ id?: string | undefined;
2380
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2381
+ persist?: boolean | undefined;
2382
+ content: string;
2383
+ } | string[] | {
2384
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2385
+ id?: string | undefined;
2386
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2387
+ persist?: boolean | undefined;
2388
+ content: string;
2389
+ }[];
2390
+ }) | undefined;
2391
+ };
2392
+ } | {
2393
+ /** Forward input information of a conversation */
2394
+ forward?: (boolean | string | {
2395
+ to?: string | undefined;
2396
+ mode?: ("after-reply" | "immediately") | undefined;
2397
+ /** Note to provide to the agent */
2398
+ note?: string | undefined;
2399
+ }) | undefined;
2400
+ /** Note to provide to the agent, recommend using forward object api instead */
2401
+ forwardNote?: string | undefined;
2402
+ instructions?: (string | {
2403
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2404
+ id?: string | undefined;
2405
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2406
+ persist?: boolean | undefined;
2407
+ content: string;
2408
+ } | string[] | {
2409
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2410
+ id?: string | undefined;
2411
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2412
+ persist?: boolean | undefined;
2413
+ content: string;
2414
+ }[]) | undefined;
2415
+ removeInstructions?: string[] | undefined;
2416
+ message?: string | undefined;
2417
+ secondsDelay?: number | undefined;
2418
+ scheduled?: number | undefined;
2419
+ contextUpsert?: {
2420
+ [x: string]: any;
2421
+ } | undefined;
2422
+ resetIntent?: boolean | undefined;
2423
+ followup?: ({
2424
+ scheduled: number;
2425
+ cancelIf?: {
2426
+ [x: string]: any;
2427
+ } | undefined;
2428
+ /** This will still run even if the conversation is locked, defaults to false */
2429
+ overrideLock?: boolean | undefined;
2430
+ /** Manual message sent to client */
2431
+ message: string;
2432
+ } | {
2433
+ scheduled: number;
2434
+ cancelIf?: {
2435
+ [x: string]: any;
2436
+ } | undefined;
2437
+ /** This will still run even if the conversation is locked, defaults to false */
2438
+ overrideLock?: boolean | undefined;
2439
+ instructions: string | {
2440
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2441
+ id?: string | undefined;
2442
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2443
+ persist?: boolean | undefined;
2444
+ content: string;
2445
+ } | string[] | {
2446
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2447
+ id?: string | undefined;
2448
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2449
+ persist?: boolean | undefined;
2450
+ content: string;
2451
+ }[];
2452
+ }) | undefined;
2453
+ keywords: string[];
2454
+ }[]) | undefined;
2455
+ }[]);
2456
+
2457
+ export type WorkflowResponseMessage = string | {
2458
+ uri: string;
2459
+ data?: any | undefined;
2460
+ headers?: {
2461
+ [x: string]: string;
2462
+ } | undefined;
2463
+ method?: ("GET" | "POST" | "PUT") | undefined;
2464
+ };
2465
+
2466
+ export type WorkflowResponseMessageApiRequest = {
2467
+ uri: string;
2468
+ data?: any | undefined;
2469
+ headers?: {
2470
+ [x: string]: string;
2471
+ } | undefined;
2472
+ method?: ("GET" | "POST" | "PUT") | undefined;
2473
+ };
2474
+
2475
+ export type WorkflowResponseMessageApiResponse = string | {
2476
+ message: string;
2477
+ } | {
2478
+ text: string;
2479
+ } | {
2480
+ data: {
2481
+ message: string;
2482
+ };
2483
+ } | {
2484
+ data: {
2485
+ text: string;
2486
+ };
2487
+ };
2488
+
2489
+ export type WorkflowResponse = {
2490
+ /** Forward input information of a conversation */
2491
+ forward?: (boolean | string | {
2492
+ to?: string | undefined;
2493
+ mode?: ("after-reply" | "immediately") | undefined;
2494
+ /** Note to provide to the agent */
2495
+ note?: string | undefined;
2496
+ }) | undefined;
2497
+ /** Note to provide to the agent, recommend using forward object api instead */
2498
+ forwardNote?: string | undefined;
2499
+ instructions?: (string | {
2500
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2501
+ id?: string | undefined;
2502
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2503
+ persist?: boolean | undefined;
2504
+ content: string;
2505
+ } | string[] | {
2506
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2507
+ id?: string | undefined;
2508
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2509
+ persist?: boolean | undefined;
2510
+ content: string;
2511
+ }[]) | undefined;
2512
+ removeInstructions?: string[] | undefined;
2513
+ message?: string | undefined;
2514
+ secondsDelay?: number | undefined;
2515
+ scheduled?: number | undefined;
2516
+ contextUpsert?: {
2517
+ [x: string]: any;
2518
+ } | undefined;
2519
+ resetIntent?: boolean | undefined;
2520
+ followup?: ({
2521
+ scheduled: number;
2522
+ cancelIf?: {
2523
+ [x: string]: any;
2524
+ } | undefined;
2525
+ /** This will still run even if the conversation is locked, defaults to false */
2526
+ overrideLock?: boolean | undefined;
2527
+ /** Manual message sent to client */
2528
+ message: string;
2529
+ } | {
2530
+ scheduled: number;
2531
+ cancelIf?: {
2532
+ [x: string]: any;
2533
+ } | undefined;
2534
+ /** This will still run even if the conversation is locked, defaults to false */
2535
+ overrideLock?: boolean | undefined;
2536
+ instructions: string | {
2537
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2538
+ id?: string | undefined;
2539
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2540
+ persist?: boolean | undefined;
2541
+ content: string;
2542
+ } | string[] | {
2543
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2544
+ id?: string | undefined;
2545
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2546
+ persist?: boolean | undefined;
2547
+ content: string;
2548
+ }[];
2549
+ }) | undefined;
2550
+ anticipate?: ({
2551
+ did: string;
2552
+ yes: {
2553
+ /** Forward input information of a conversation */
2554
+ forward?: (boolean | string | {
2555
+ to?: string | undefined;
2556
+ mode?: ("after-reply" | "immediately") | undefined;
2557
+ /** Note to provide to the agent */
2558
+ note?: string | undefined;
2559
+ }) | undefined;
2560
+ /** Note to provide to the agent, recommend using forward object api instead */
2561
+ forwardNote?: string | undefined;
2562
+ instructions?: (string | {
2563
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2564
+ id?: string | undefined;
2565
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2566
+ persist?: boolean | undefined;
2567
+ content: string;
2568
+ } | string[] | {
2569
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2570
+ id?: string | undefined;
2571
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2572
+ persist?: boolean | undefined;
2573
+ content: string;
2574
+ }[]) | undefined;
2575
+ removeInstructions?: string[] | undefined;
2576
+ message?: string | undefined;
2577
+ secondsDelay?: number | undefined;
2578
+ scheduled?: number | undefined;
2579
+ contextUpsert?: {
2580
+ [x: string]: any;
2581
+ } | undefined;
2582
+ resetIntent?: boolean | undefined;
2583
+ followup?: ({
2584
+ scheduled: number;
2585
+ cancelIf?: {
2586
+ [x: string]: any;
2587
+ } | undefined;
2588
+ /** This will still run even if the conversation is locked, defaults to false */
2589
+ overrideLock?: boolean | undefined;
2590
+ /** Manual message sent to client */
2591
+ message: string;
2592
+ } | {
2593
+ scheduled: number;
2594
+ cancelIf?: {
2595
+ [x: string]: any;
2596
+ } | undefined;
2597
+ /** This will still run even if the conversation is locked, defaults to false */
2598
+ overrideLock?: boolean | undefined;
2599
+ instructions: string | {
2600
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2601
+ id?: string | undefined;
2602
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2603
+ persist?: boolean | undefined;
2604
+ content: string;
2605
+ } | string[] | {
2606
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2607
+ id?: string | undefined;
2608
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2609
+ persist?: boolean | undefined;
2610
+ content: string;
2611
+ }[];
2612
+ }) | undefined;
2613
+ };
2614
+ no: {
2615
+ /** Forward input information of a conversation */
2616
+ forward?: (boolean | string | {
2617
+ to?: string | undefined;
2618
+ mode?: ("after-reply" | "immediately") | undefined;
2619
+ /** Note to provide to the agent */
2620
+ note?: string | undefined;
2621
+ }) | undefined;
2622
+ /** Note to provide to the agent, recommend using forward object api instead */
2623
+ forwardNote?: string | undefined;
2624
+ instructions?: (string | {
2625
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2626
+ id?: string | undefined;
2627
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2628
+ persist?: boolean | undefined;
2629
+ content: string;
2630
+ } | string[] | {
2631
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2632
+ id?: string | undefined;
2633
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2634
+ persist?: boolean | undefined;
2635
+ content: string;
2636
+ }[]) | undefined;
2637
+ removeInstructions?: string[] | undefined;
2638
+ message?: string | undefined;
2639
+ secondsDelay?: number | undefined;
2640
+ scheduled?: number | undefined;
2641
+ contextUpsert?: {
2642
+ [x: string]: any;
2643
+ } | undefined;
2644
+ resetIntent?: boolean | undefined;
2645
+ followup?: ({
2646
+ scheduled: number;
2647
+ cancelIf?: {
2648
+ [x: string]: any;
2649
+ } | undefined;
2650
+ /** This will still run even if the conversation is locked, defaults to false */
2651
+ overrideLock?: boolean | undefined;
2652
+ /** Manual message sent to client */
2653
+ message: string;
2654
+ } | {
2655
+ scheduled: number;
2656
+ cancelIf?: {
2657
+ [x: string]: any;
2658
+ } | undefined;
2659
+ /** This will still run even if the conversation is locked, defaults to false */
2660
+ overrideLock?: boolean | undefined;
2661
+ instructions: string | {
2662
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2663
+ id?: string | undefined;
2664
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2665
+ persist?: boolean | undefined;
2666
+ content: string;
2667
+ } | string[] | {
2668
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2669
+ id?: string | undefined;
2670
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2671
+ persist?: boolean | undefined;
2672
+ content: string;
2673
+ }[];
2674
+ }) | undefined;
2675
+ };
2676
+ } | {
2677
+ /** Forward input information of a conversation */
2678
+ forward?: (boolean | string | {
2679
+ to?: string | undefined;
2680
+ mode?: ("after-reply" | "immediately") | undefined;
2681
+ /** Note to provide to the agent */
2682
+ note?: string | undefined;
2683
+ }) | undefined;
2684
+ /** Note to provide to the agent, recommend using forward object api instead */
2685
+ forwardNote?: string | undefined;
2686
+ instructions?: (string | {
2687
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2688
+ id?: string | undefined;
2689
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2690
+ persist?: boolean | undefined;
2691
+ content: string;
2692
+ } | string[] | {
2693
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2694
+ id?: string | undefined;
2695
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2696
+ persist?: boolean | undefined;
2697
+ content: string;
2698
+ }[]) | undefined;
2699
+ removeInstructions?: string[] | undefined;
2700
+ message?: string | undefined;
2701
+ secondsDelay?: number | undefined;
2702
+ scheduled?: number | undefined;
2703
+ contextUpsert?: {
2704
+ [x: string]: any;
2705
+ } | undefined;
2706
+ resetIntent?: boolean | undefined;
2707
+ followup?: ({
2708
+ scheduled: number;
2709
+ cancelIf?: {
2710
+ [x: string]: any;
2711
+ } | undefined;
2712
+ /** This will still run even if the conversation is locked, defaults to false */
2713
+ overrideLock?: boolean | undefined;
2714
+ /** Manual message sent to client */
2715
+ message: string;
2716
+ } | {
2717
+ scheduled: number;
2718
+ cancelIf?: {
2719
+ [x: string]: any;
2720
+ } | undefined;
2721
+ /** This will still run even if the conversation is locked, defaults to false */
2722
+ overrideLock?: boolean | undefined;
2723
+ instructions: string | {
2724
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2725
+ id?: string | undefined;
2726
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2727
+ persist?: boolean | undefined;
2728
+ content: string;
2729
+ } | string[] | {
2730
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2731
+ id?: string | undefined;
2732
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2733
+ persist?: boolean | undefined;
2734
+ content: string;
2735
+ }[];
2736
+ }) | undefined;
2737
+ keywords: string[];
2738
+ }[]) | undefined;
2739
+ } | {
2740
+ /** Forward input information of a conversation */
2741
+ forward?: (boolean | string | {
2742
+ to?: string | undefined;
2743
+ mode?: ("after-reply" | "immediately") | undefined;
2744
+ /** Note to provide to the agent */
2745
+ note?: string | undefined;
2746
+ }) | undefined;
2747
+ /** Note to provide to the agent, recommend using forward object api instead */
2748
+ forwardNote?: string | undefined;
2749
+ instructions?: (string | {
2750
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2751
+ id?: string | undefined;
2752
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2753
+ persist?: boolean | undefined;
2754
+ content: string;
2755
+ } | string[] | {
2756
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2757
+ id?: string | undefined;
2758
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2759
+ persist?: boolean | undefined;
2760
+ content: string;
2761
+ }[]) | undefined;
2762
+ removeInstructions?: string[] | undefined;
2763
+ message?: string | undefined;
2764
+ secondsDelay?: number | undefined;
2765
+ scheduled?: number | undefined;
2766
+ contextUpsert?: {
2767
+ [x: string]: any;
2768
+ } | undefined;
2769
+ resetIntent?: boolean | undefined;
2770
+ followup?: ({
2771
+ scheduled: number;
2772
+ cancelIf?: {
2773
+ [x: string]: any;
2774
+ } | undefined;
2775
+ /** This will still run even if the conversation is locked, defaults to false */
2776
+ overrideLock?: boolean | undefined;
2777
+ /** Manual message sent to client */
2778
+ message: string;
2779
+ } | {
2780
+ scheduled: number;
2781
+ cancelIf?: {
2782
+ [x: string]: any;
2783
+ } | undefined;
2784
+ /** This will still run even if the conversation is locked, defaults to false */
2785
+ overrideLock?: boolean | undefined;
2786
+ instructions: string | {
2787
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2788
+ id?: string | undefined;
2789
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2790
+ persist?: boolean | undefined;
2791
+ content: string;
2792
+ } | string[] | {
2793
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2794
+ id?: string | undefined;
2795
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2796
+ persist?: boolean | undefined;
2797
+ content: string;
2798
+ }[];
2799
+ }) | undefined;
2800
+ anticipate?: ({
2801
+ did: string;
2802
+ yes: {
2803
+ /** Forward input information of a conversation */
2804
+ forward?: (boolean | string | {
2805
+ to?: string | undefined;
2806
+ mode?: ("after-reply" | "immediately") | undefined;
2807
+ /** Note to provide to the agent */
2808
+ note?: string | undefined;
2809
+ }) | undefined;
2810
+ /** Note to provide to the agent, recommend using forward object api instead */
2811
+ forwardNote?: string | undefined;
2812
+ instructions?: (string | {
2813
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2814
+ id?: string | undefined;
2815
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2816
+ persist?: boolean | undefined;
2817
+ content: string;
2818
+ } | string[] | {
2819
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2820
+ id?: string | undefined;
2821
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2822
+ persist?: boolean | undefined;
2823
+ content: string;
2824
+ }[]) | undefined;
2825
+ removeInstructions?: string[] | undefined;
2826
+ message?: string | undefined;
2827
+ secondsDelay?: number | undefined;
2828
+ scheduled?: number | undefined;
2829
+ contextUpsert?: {
2830
+ [x: string]: any;
2831
+ } | undefined;
2832
+ resetIntent?: boolean | undefined;
2833
+ followup?: ({
2834
+ scheduled: number;
2835
+ cancelIf?: {
2836
+ [x: string]: any;
2837
+ } | undefined;
2838
+ /** This will still run even if the conversation is locked, defaults to false */
2839
+ overrideLock?: boolean | undefined;
2840
+ /** Manual message sent to client */
2841
+ message: string;
2842
+ } | {
2843
+ scheduled: number;
2844
+ cancelIf?: {
2845
+ [x: string]: any;
2846
+ } | undefined;
2847
+ /** This will still run even if the conversation is locked, defaults to false */
2848
+ overrideLock?: boolean | undefined;
2849
+ instructions: string | {
2850
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2851
+ id?: string | undefined;
2852
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2853
+ persist?: boolean | undefined;
2854
+ content: string;
2855
+ } | string[] | {
2856
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2857
+ id?: string | undefined;
2858
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2859
+ persist?: boolean | undefined;
2860
+ content: string;
2861
+ }[];
2862
+ }) | undefined;
2863
+ };
2864
+ no: {
2865
+ /** Forward input information of a conversation */
2866
+ forward?: (boolean | string | {
2867
+ to?: string | undefined;
2868
+ mode?: ("after-reply" | "immediately") | undefined;
2869
+ /** Note to provide to the agent */
2870
+ note?: string | undefined;
2871
+ }) | undefined;
2872
+ /** Note to provide to the agent, recommend using forward object api instead */
2873
+ forwardNote?: string | undefined;
2874
+ instructions?: (string | {
2875
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2876
+ id?: string | undefined;
2877
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2878
+ persist?: boolean | undefined;
2879
+ content: string;
2880
+ } | string[] | {
2881
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2882
+ id?: string | undefined;
2883
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2884
+ persist?: boolean | undefined;
2885
+ content: string;
2886
+ }[]) | undefined;
2887
+ removeInstructions?: string[] | undefined;
2888
+ message?: string | undefined;
2889
+ secondsDelay?: number | undefined;
2890
+ scheduled?: number | undefined;
2891
+ contextUpsert?: {
2892
+ [x: string]: any;
2893
+ } | undefined;
2894
+ resetIntent?: boolean | undefined;
2895
+ followup?: ({
2896
+ scheduled: number;
2897
+ cancelIf?: {
2898
+ [x: string]: any;
2899
+ } | undefined;
2900
+ /** This will still run even if the conversation is locked, defaults to false */
2901
+ overrideLock?: boolean | undefined;
2902
+ /** Manual message sent to client */
2903
+ message: string;
2904
+ } | {
2905
+ scheduled: number;
2906
+ cancelIf?: {
2907
+ [x: string]: any;
2908
+ } | undefined;
2909
+ /** This will still run even if the conversation is locked, defaults to false */
2910
+ overrideLock?: boolean | undefined;
2911
+ instructions: string | {
2912
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2913
+ id?: string | undefined;
2914
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2915
+ persist?: boolean | undefined;
2916
+ content: string;
2917
+ } | string[] | {
2918
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2919
+ id?: string | undefined;
2920
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2921
+ persist?: boolean | undefined;
2922
+ content: string;
2923
+ }[];
2924
+ }) | undefined;
2925
+ };
2926
+ } | {
2927
+ /** Forward input information of a conversation */
2928
+ forward?: (boolean | string | {
2929
+ to?: string | undefined;
2930
+ mode?: ("after-reply" | "immediately") | undefined;
2931
+ /** Note to provide to the agent */
2932
+ note?: string | undefined;
2933
+ }) | undefined;
2934
+ /** Note to provide to the agent, recommend using forward object api instead */
2935
+ forwardNote?: string | undefined;
2936
+ instructions?: (string | {
2937
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2938
+ id?: string | undefined;
2939
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2940
+ persist?: boolean | undefined;
2941
+ content: string;
2942
+ } | string[] | {
2943
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2944
+ id?: string | undefined;
2945
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2946
+ persist?: boolean | undefined;
2947
+ content: string;
2948
+ }[]) | undefined;
2949
+ removeInstructions?: string[] | undefined;
2950
+ message?: string | undefined;
2951
+ secondsDelay?: number | undefined;
2952
+ scheduled?: number | undefined;
2953
+ contextUpsert?: {
2954
+ [x: string]: any;
2955
+ } | undefined;
2956
+ resetIntent?: boolean | undefined;
2957
+ followup?: ({
2958
+ scheduled: number;
2959
+ cancelIf?: {
2960
+ [x: string]: any;
2961
+ } | undefined;
2962
+ /** This will still run even if the conversation is locked, defaults to false */
2963
+ overrideLock?: boolean | undefined;
2964
+ /** Manual message sent to client */
2965
+ message: string;
2966
+ } | {
2967
+ scheduled: number;
2968
+ cancelIf?: {
2969
+ [x: string]: any;
2970
+ } | undefined;
2971
+ /** This will still run even if the conversation is locked, defaults to false */
2972
+ overrideLock?: boolean | undefined;
2973
+ instructions: string | {
2974
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2975
+ id?: string | undefined;
2976
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2977
+ persist?: boolean | undefined;
2978
+ content: string;
2979
+ } | string[] | {
2980
+ /** Unique ID for the instruction, this is used to remove the instruction later */
2981
+ id?: string | undefined;
2982
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
2983
+ persist?: boolean | undefined;
2984
+ content: string;
2985
+ }[];
2986
+ }) | undefined;
2987
+ keywords: string[];
2988
+ }[]) | undefined;
2989
+ }[];
2990
+
2991
+ export type WorkflowResponseSlotBase = {
2992
+ /** Forward input information of a conversation */
2993
+ forward?: (boolean | string | {
2994
+ to?: string | undefined;
2995
+ mode?: ("after-reply" | "immediately") | undefined;
2996
+ /** Note to provide to the agent */
2997
+ note?: string | undefined;
2998
+ }) | undefined;
2999
+ /** Note to provide to the agent, recommend using forward object api instead */
3000
+ forwardNote?: string | undefined;
3001
+ instructions?: (string | {
3002
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3003
+ id?: string | undefined;
3004
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3005
+ persist?: boolean | undefined;
3006
+ content: string;
3007
+ } | string[] | {
3008
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3009
+ id?: string | undefined;
3010
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3011
+ persist?: boolean | undefined;
3012
+ content: string;
3013
+ }[]) | undefined;
3014
+ removeInstructions?: string[] | undefined;
3015
+ message?: string | undefined;
3016
+ secondsDelay?: number | undefined;
3017
+ scheduled?: number | undefined;
3018
+ contextUpsert?: {
3019
+ [x: string]: any;
3020
+ } | undefined;
3021
+ resetIntent?: boolean | undefined;
3022
+ followup?: ({
3023
+ scheduled: number;
3024
+ cancelIf?: {
3025
+ [x: string]: any;
3026
+ } | undefined;
3027
+ /** This will still run even if the conversation is locked, defaults to false */
3028
+ overrideLock?: boolean | undefined;
3029
+ /** Manual message sent to client */
3030
+ message: string;
3031
+ } | {
3032
+ scheduled: number;
3033
+ cancelIf?: {
3034
+ [x: string]: any;
3035
+ } | undefined;
3036
+ /** This will still run even if the conversation is locked, defaults to false */
3037
+ overrideLock?: boolean | undefined;
3038
+ instructions: string | {
3039
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3040
+ id?: string | undefined;
3041
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3042
+ persist?: boolean | undefined;
3043
+ content: string;
3044
+ } | string[] | {
3045
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3046
+ id?: string | undefined;
3047
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3048
+ persist?: boolean | undefined;
3049
+ content: string;
3050
+ }[];
3051
+ }) | undefined;
3052
+ };
3053
+
3054
+ export type WorkflowResponseSlot = {
3055
+ /** Forward input information of a conversation */
3056
+ forward?: (boolean | string | {
3057
+ to?: string | undefined;
3058
+ mode?: ("after-reply" | "immediately") | undefined;
3059
+ /** Note to provide to the agent */
3060
+ note?: string | undefined;
3061
+ }) | undefined;
3062
+ /** Note to provide to the agent, recommend using forward object api instead */
3063
+ forwardNote?: string | undefined;
3064
+ instructions?: (string | {
3065
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3066
+ id?: string | undefined;
3067
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3068
+ persist?: boolean | undefined;
3069
+ content: string;
3070
+ } | string[] | {
3071
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3072
+ id?: string | undefined;
3073
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3074
+ persist?: boolean | undefined;
3075
+ content: string;
3076
+ }[]) | undefined;
3077
+ removeInstructions?: string[] | undefined;
3078
+ message?: string | undefined;
3079
+ secondsDelay?: number | undefined;
3080
+ scheduled?: number | undefined;
3081
+ contextUpsert?: {
3082
+ [x: string]: any;
3083
+ } | undefined;
3084
+ resetIntent?: boolean | undefined;
3085
+ followup?: ({
3086
+ scheduled: number;
3087
+ cancelIf?: {
3088
+ [x: string]: any;
3089
+ } | undefined;
3090
+ /** This will still run even if the conversation is locked, defaults to false */
3091
+ overrideLock?: boolean | undefined;
3092
+ /** Manual message sent to client */
3093
+ message: string;
3094
+ } | {
3095
+ scheduled: number;
3096
+ cancelIf?: {
3097
+ [x: string]: any;
3098
+ } | undefined;
3099
+ /** This will still run even if the conversation is locked, defaults to false */
3100
+ overrideLock?: boolean | undefined;
3101
+ instructions: string | {
3102
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3103
+ id?: string | undefined;
3104
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3105
+ persist?: boolean | undefined;
3106
+ content: string;
3107
+ } | string[] | {
3108
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3109
+ id?: string | undefined;
3110
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3111
+ persist?: boolean | undefined;
3112
+ content: string;
3113
+ }[];
3114
+ }) | undefined;
3115
+ anticipate?: ({
3116
+ did: string;
3117
+ yes: {
3118
+ /** Forward input information of a conversation */
3119
+ forward?: (boolean | string | {
3120
+ to?: string | undefined;
3121
+ mode?: ("after-reply" | "immediately") | undefined;
3122
+ /** Note to provide to the agent */
3123
+ note?: string | undefined;
3124
+ }) | undefined;
3125
+ /** Note to provide to the agent, recommend using forward object api instead */
3126
+ forwardNote?: string | undefined;
3127
+ instructions?: (string | {
3128
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3129
+ id?: string | undefined;
3130
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3131
+ persist?: boolean | undefined;
3132
+ content: string;
3133
+ } | string[] | {
3134
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3135
+ id?: string | undefined;
3136
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3137
+ persist?: boolean | undefined;
3138
+ content: string;
3139
+ }[]) | undefined;
3140
+ removeInstructions?: string[] | undefined;
3141
+ message?: string | undefined;
3142
+ secondsDelay?: number | undefined;
3143
+ scheduled?: number | undefined;
3144
+ contextUpsert?: {
3145
+ [x: string]: any;
3146
+ } | undefined;
3147
+ resetIntent?: boolean | undefined;
3148
+ followup?: ({
3149
+ scheduled: number;
3150
+ cancelIf?: {
3151
+ [x: string]: any;
3152
+ } | undefined;
3153
+ /** This will still run even if the conversation is locked, defaults to false */
3154
+ overrideLock?: boolean | undefined;
3155
+ /** Manual message sent to client */
3156
+ message: string;
3157
+ } | {
3158
+ scheduled: number;
3159
+ cancelIf?: {
3160
+ [x: string]: any;
3161
+ } | undefined;
3162
+ /** This will still run even if the conversation is locked, defaults to false */
3163
+ overrideLock?: boolean | undefined;
3164
+ instructions: string | {
3165
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3166
+ id?: string | undefined;
3167
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3168
+ persist?: boolean | undefined;
3169
+ content: string;
3170
+ } | string[] | {
3171
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3172
+ id?: string | undefined;
3173
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3174
+ persist?: boolean | undefined;
3175
+ content: string;
3176
+ }[];
3177
+ }) | undefined;
3178
+ };
3179
+ no: {
3180
+ /** Forward input information of a conversation */
3181
+ forward?: (boolean | string | {
3182
+ to?: string | undefined;
3183
+ mode?: ("after-reply" | "immediately") | undefined;
3184
+ /** Note to provide to the agent */
3185
+ note?: string | undefined;
3186
+ }) | undefined;
3187
+ /** Note to provide to the agent, recommend using forward object api instead */
3188
+ forwardNote?: string | undefined;
3189
+ instructions?: (string | {
3190
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3191
+ id?: string | undefined;
3192
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3193
+ persist?: boolean | undefined;
3194
+ content: string;
3195
+ } | string[] | {
3196
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3197
+ id?: string | undefined;
3198
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3199
+ persist?: boolean | undefined;
3200
+ content: string;
3201
+ }[]) | undefined;
3202
+ removeInstructions?: string[] | undefined;
3203
+ message?: string | undefined;
3204
+ secondsDelay?: number | undefined;
3205
+ scheduled?: number | undefined;
3206
+ contextUpsert?: {
3207
+ [x: string]: any;
3208
+ } | undefined;
3209
+ resetIntent?: boolean | undefined;
3210
+ followup?: ({
3211
+ scheduled: number;
3212
+ cancelIf?: {
3213
+ [x: string]: any;
3214
+ } | undefined;
3215
+ /** This will still run even if the conversation is locked, defaults to false */
3216
+ overrideLock?: boolean | undefined;
3217
+ /** Manual message sent to client */
3218
+ message: string;
3219
+ } | {
3220
+ scheduled: number;
3221
+ cancelIf?: {
3222
+ [x: string]: any;
3223
+ } | undefined;
3224
+ /** This will still run even if the conversation is locked, defaults to false */
3225
+ overrideLock?: boolean | undefined;
3226
+ instructions: string | {
3227
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3228
+ id?: string | undefined;
3229
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3230
+ persist?: boolean | undefined;
3231
+ content: string;
3232
+ } | string[] | {
3233
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3234
+ id?: string | undefined;
3235
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3236
+ persist?: boolean | undefined;
3237
+ content: string;
3238
+ }[];
3239
+ }) | undefined;
3240
+ };
3241
+ } | {
3242
+ /** Forward input information of a conversation */
3243
+ forward?: (boolean | string | {
3244
+ to?: string | undefined;
3245
+ mode?: ("after-reply" | "immediately") | undefined;
3246
+ /** Note to provide to the agent */
3247
+ note?: string | undefined;
3248
+ }) | undefined;
3249
+ /** Note to provide to the agent, recommend using forward object api instead */
3250
+ forwardNote?: string | undefined;
3251
+ instructions?: (string | {
3252
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3253
+ id?: string | undefined;
3254
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3255
+ persist?: boolean | undefined;
3256
+ content: string;
3257
+ } | string[] | {
3258
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3259
+ id?: string | undefined;
3260
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3261
+ persist?: boolean | undefined;
3262
+ content: string;
3263
+ }[]) | undefined;
3264
+ removeInstructions?: string[] | undefined;
3265
+ message?: string | undefined;
3266
+ secondsDelay?: number | undefined;
3267
+ scheduled?: number | undefined;
3268
+ contextUpsert?: {
3269
+ [x: string]: any;
3270
+ } | undefined;
3271
+ resetIntent?: boolean | undefined;
3272
+ followup?: ({
3273
+ scheduled: number;
3274
+ cancelIf?: {
3275
+ [x: string]: any;
3276
+ } | undefined;
3277
+ /** This will still run even if the conversation is locked, defaults to false */
3278
+ overrideLock?: boolean | undefined;
3279
+ /** Manual message sent to client */
3280
+ message: string;
3281
+ } | {
3282
+ scheduled: number;
3283
+ cancelIf?: {
3284
+ [x: string]: any;
3285
+ } | undefined;
3286
+ /** This will still run even if the conversation is locked, defaults to false */
3287
+ overrideLock?: boolean | undefined;
3288
+ instructions: string | {
3289
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3290
+ id?: string | undefined;
3291
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3292
+ persist?: boolean | undefined;
3293
+ content: string;
3294
+ } | string[] | {
3295
+ /** Unique ID for the instruction, this is used to remove the instruction later */
3296
+ id?: string | undefined;
3297
+ /** if true, the instruction persists the conversation, if false the instruction will only last for 1 auto reply */
3298
+ persist?: boolean | undefined;
3299
+ content: string;
3300
+ }[];
3301
+ }) | undefined;
3302
+ keywords: string[];
3303
+ }[]) | undefined;
3304
+ };
3305
+
3306
+ export type WorkflowsConfiguration = {
3307
+ /** Workflow id association, used to handle route params */
3308
+ entities: string[];
3309
+ entity: string;
3310
+ }[];
3311
+
3312
+ export type apiFunction = (args_0: {
3313
+ searchParams: {
3314
+ [x: string]: string | string[];
3315
+ };
3316
+ params: {
3317
+ [x: string]: string;
3318
+ };
3319
+ }, ...args_1: unknown[]) => Promise<{
3320
+ body?: any;
3321
+ init?: {
3322
+ status?: number | undefined;
3323
+ statusText?: string | undefined;
3324
+ headers?: any | undefined;
3325
+ } | undefined;
3326
+ }>;
3327
+
3328
+ export type deleteApiFunction = (args_0: {
3329
+ searchParams: {
3330
+ [x: string]: string | string[];
3331
+ };
3332
+ params: {
3333
+ [x: string]: string;
3334
+ };
3335
+ }, ...args_1: unknown[]) => Promise<{
3336
+ body?: any;
3337
+ init?: {
3338
+ status?: number | undefined;
3339
+ statusText?: string | undefined;
3340
+ headers?: any | undefined;
3341
+ } | undefined;
3342
+ }>;
3343
+
3344
+ export type eventResponse = {
3345
+ body?: any;
3346
+ init?: {
3347
+ status?: number | undefined;
3348
+ statusText?: string | undefined;
3349
+ headers?: any | undefined;
3350
+ } | undefined;
3351
+ };
3352
+
3353
+ export type getApiFunction = (args_0: {
3354
+ searchParams: {
3355
+ [x: string]: string | string[];
3356
+ };
3357
+ params: {
3358
+ [x: string]: string;
3359
+ };
3360
+ }, ...args_1: unknown[]) => Promise<{
3361
+ body?: any;
3362
+ init?: {
3363
+ status?: number | undefined;
3364
+ statusText?: string | undefined;
3365
+ headers?: any | undefined;
3366
+ } | undefined;
3367
+ }>;
3368
+
3369
+ export type queryApiFunction = (args_0: {
3370
+ searchParams: {
3371
+ [x: string]: string | string[];
3372
+ };
3373
+ params: {
3374
+ [x: string]: string;
3375
+ };
3376
+ }, ...args_1: unknown[]) => Promise<{
3377
+ body?: any;
3378
+ init?: {
3379
+ status?: number | undefined;
3380
+ statusText?: string | undefined;
3381
+ headers?: any | undefined;
3382
+ } | undefined;
3383
+ }>;