@aws-sdk/client-lex-runtime-service 3.36.0 → 3.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist-cjs/LexRuntimeService.js +0 -14
  3. package/dist-cjs/LexRuntimeServiceClient.js +0 -19
  4. package/dist-cjs/commands/DeleteSessionCommand.js +0 -25
  5. package/dist-cjs/commands/GetSessionCommand.js +0 -25
  6. package/dist-cjs/commands/PostContentCommand.js +0 -100
  7. package/dist-cjs/commands/PostTextCommand.js +0 -99
  8. package/dist-cjs/commands/PutSessionCommand.js +0 -28
  9. package/dist-cjs/commands/index.js +8 -0
  10. package/dist-cjs/endpoints.js +6 -1
  11. package/dist-cjs/index.js +3 -7
  12. package/dist-cjs/models/models_0.js +0 -93
  13. package/dist-cjs/protocols/Aws_restJson1.js +0 -5
  14. package/dist-cjs/runtimeConfig.browser.js +1 -5
  15. package/dist-cjs/runtimeConfig.js +1 -5
  16. package/dist-cjs/runtimeConfig.native.js +0 -3
  17. package/dist-cjs/runtimeConfig.shared.js +0 -3
  18. package/dist-es/commands/index.js +5 -0
  19. package/dist-es/endpoints.js +6 -1
  20. package/dist-es/index.js +3 -7
  21. package/dist-types/commands/index.d.ts +5 -0
  22. package/dist-types/index.d.ts +3 -7
  23. package/dist-types/ts3.4/LexRuntimeService.d.ts +6 -186
  24. package/dist-types/ts3.4/LexRuntimeServiceClient.d.ts +24 -100
  25. package/dist-types/ts3.4/commands/DeleteSessionCommand.d.ts +2 -21
  26. package/dist-types/ts3.4/commands/GetSessionCommand.d.ts +2 -21
  27. package/dist-types/ts3.4/commands/PostContentCommand.d.ts +5 -103
  28. package/dist-types/ts3.4/commands/PostTextCommand.d.ts +2 -95
  29. package/dist-types/ts3.4/commands/PutSessionCommand.d.ts +2 -24
  30. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  31. package/dist-types/ts3.4/index.d.ts +3 -7
  32. package/dist-types/ts3.4/models/models_0.d.ts +73 -1543
  33. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  34. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  35. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  36. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  37. package/package.json +32 -32
@@ -1,155 +1,90 @@
1
- /// <reference types="node" />
1
+
2
2
  import { LazyJsonString as __LazyJsonString } from "@aws-sdk/smithy-client";
3
3
  import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
4
4
  import { Readable } from "stream";
5
- /**
6
- * <p>The length of time or number of turns that a context remains
7
- * active.</p>
8
- */
5
+
9
6
  export interface ActiveContextTimeToLive {
10
- /**
11
- * <p>The number of seconds that the context should be active after it is
12
- * first sent in a <code>PostContent</code> or <code>PostText</code>
13
- * response. You can set the value between 5 and 86,400 seconds (24
14
- * hours).</p>
15
- */
7
+
16
8
  timeToLiveInSeconds?: number;
17
- /**
18
- * <p>The number of conversation turns that the context should be active. A
19
- * conversation turn is one <code>PostContent</code> or <code>PostText</code>
20
- * request and the corresponding response from Amazon Lex.</p>
21
- */
9
+
22
10
  turnsToLive?: number;
23
11
  }
24
12
  export declare namespace ActiveContextTimeToLive {
25
- /**
26
- * @internal
27
- */
13
+
28
14
  const filterSensitiveLog: (obj: ActiveContextTimeToLive) => any;
29
15
  }
30
- /**
31
- * <p>A context is a variable that contains information about the current
32
- * state of the conversation between a user and Amazon Lex. Context can be set
33
- * automatically by Amazon Lex when an intent is fulfilled, or it can be set at
34
- * runtime using the <code>PutContent</code>, <code>PutText</code>, or
35
- * <code>PutSession</code> operation.</p>
36
- */
16
+
37
17
  export interface ActiveContext {
38
- /**
39
- * <p>The name of the context.</p>
40
- */
18
+
41
19
  name: string | undefined;
42
- /**
43
- * <p>The length of time or number of turns that a context remains
44
- * active.</p>
45
- */
20
+
46
21
  timeToLive: ActiveContextTimeToLive | undefined;
47
- /**
48
- * <p>State variables for the current context. You can use these values as
49
- * default values for slots in subsequent events.</p>
50
- */
22
+
51
23
  parameters: {
52
24
  [key: string]: string;
53
25
  } | undefined;
54
26
  }
55
27
  export declare namespace ActiveContext {
56
- /**
57
- * @internal
58
- */
28
+
59
29
  const filterSensitiveLog: (obj: ActiveContext) => any;
60
30
  }
61
- /**
62
- * <p> Request validation failed, there is no usable message in the context,
63
- * or the bot build failed, is still in progress, or contains unbuilt
64
- * changes. </p>
65
- */
31
+
66
32
  export interface BadRequestException extends __SmithyException, $MetadataBearer {
67
33
  name: "BadRequestException";
68
34
  $fault: "client";
69
35
  message?: string;
70
36
  }
71
37
  export declare namespace BadRequestException {
72
- /**
73
- * @internal
74
- */
38
+
75
39
  const filterSensitiveLog: (obj: BadRequestException) => any;
76
40
  }
77
- /**
78
- * <p> Two clients are using the same AWS account, Amazon Lex bot, and user
79
- * ID. </p>
80
- */
41
+
81
42
  export interface ConflictException extends __SmithyException, $MetadataBearer {
82
43
  name: "ConflictException";
83
44
  $fault: "client";
84
45
  message?: string;
85
46
  }
86
47
  export declare namespace ConflictException {
87
- /**
88
- * @internal
89
- */
48
+
90
49
  const filterSensitiveLog: (obj: ConflictException) => any;
91
50
  }
92
51
  export interface DeleteSessionRequest {
93
- /**
94
- * <p>The name of the bot that contains the session data.</p>
95
- */
52
+
96
53
  botName: string | undefined;
97
- /**
98
- * <p>The alias in use for the bot that contains the session data.</p>
99
- */
54
+
100
55
  botAlias: string | undefined;
101
- /**
102
- * <p>The identifier of the user associated with the session data.</p>
103
- */
56
+
104
57
  userId: string | undefined;
105
58
  }
106
59
  export declare namespace DeleteSessionRequest {
107
- /**
108
- * @internal
109
- */
60
+
110
61
  const filterSensitiveLog: (obj: DeleteSessionRequest) => any;
111
62
  }
112
63
  export interface DeleteSessionResponse {
113
- /**
114
- * <p>The name of the bot associated with the session data.</p>
115
- */
64
+
116
65
  botName?: string;
117
- /**
118
- * <p>The alias in use for the bot associated with the session data.</p>
119
- */
66
+
120
67
  botAlias?: string;
121
- /**
122
- * <p>The ID of the client application user.</p>
123
- */
68
+
124
69
  userId?: string;
125
- /**
126
- * <p>The unique identifier for the session.</p>
127
- */
70
+
128
71
  sessionId?: string;
129
72
  }
130
73
  export declare namespace DeleteSessionResponse {
131
- /**
132
- * @internal
133
- */
74
+
134
75
  const filterSensitiveLog: (obj: DeleteSessionResponse) => any;
135
76
  }
136
- /**
137
- * <p>Internal service error. Retry the call.</p>
138
- */
77
+
139
78
  export interface InternalFailureException extends __SmithyException, $MetadataBearer {
140
79
  name: "InternalFailureException";
141
80
  $fault: "server";
142
81
  message?: string;
143
82
  }
144
83
  export declare namespace InternalFailureException {
145
- /**
146
- * @internal
147
- */
84
+
148
85
  const filterSensitiveLog: (obj: InternalFailureException) => any;
149
86
  }
150
- /**
151
- * <p>Exceeded a limit.</p>
152
- */
87
+
153
88
  export interface LimitExceededException extends __SmithyException, $MetadataBearer {
154
89
  name: "LimitExceededException";
155
90
  $fault: "client";
@@ -157,53 +92,31 @@ export interface LimitExceededException extends __SmithyException, $MetadataBear
157
92
  message?: string;
158
93
  }
159
94
  export declare namespace LimitExceededException {
160
- /**
161
- * @internal
162
- */
95
+
163
96
  const filterSensitiveLog: (obj: LimitExceededException) => any;
164
97
  }
165
- /**
166
- * <p>The resource (such as the Amazon Lex bot or an alias) that is referred
167
- * to is not found.</p>
168
- */
98
+
169
99
  export interface NotFoundException extends __SmithyException, $MetadataBearer {
170
100
  name: "NotFoundException";
171
101
  $fault: "client";
172
102
  message?: string;
173
103
  }
174
104
  export declare namespace NotFoundException {
175
- /**
176
- * @internal
177
- */
105
+
178
106
  const filterSensitiveLog: (obj: NotFoundException) => any;
179
107
  }
180
108
  export interface GetSessionRequest {
181
- /**
182
- * <p>The name of the bot that contains the session data.</p>
183
- */
109
+
184
110
  botName: string | undefined;
185
- /**
186
- * <p>The alias in use for the bot that contains the session data.</p>
187
- */
111
+
188
112
  botAlias: string | undefined;
189
- /**
190
- * <p>The ID of the client application user. Amazon Lex uses this to identify a
191
- * user's conversation with your bot. </p>
192
- */
113
+
193
114
  userId: string | undefined;
194
- /**
195
- * <p>A string used to filter the intents returned in the
196
- * <code>recentIntentSummaryView</code> structure. </p>
197
- * <p>When you specify a filter, only intents with their
198
- * <code>checkpointLabel</code> field set to that string are
199
- * returned.</p>
200
- */
115
+
201
116
  checkpointLabelFilter?: string;
202
117
  }
203
118
  export declare namespace GetSessionRequest {
204
- /**
205
- * @internal
206
- */
119
+
207
120
  const filterSensitiveLog: (obj: GetSessionRequest) => any;
208
121
  }
209
122
  export declare enum FulfillmentState {
@@ -224,120 +137,27 @@ export declare enum DialogActionType {
224
137
  ELICIT_INTENT = "ElicitIntent",
225
138
  ELICIT_SLOT = "ElicitSlot"
226
139
  }
227
- /**
228
- * <p>Describes the next action that the bot should take in its interaction
229
- * with the user and provides information about the context in which the
230
- * action takes place. Use the <code>DialogAction</code> data type to set the
231
- * interaction to a specific state, or to return the interaction to a
232
- * previous state.</p>
233
- */
140
+
234
141
  export interface DialogAction {
235
- /**
236
- * <p>The next action that the bot should take in its interaction with the
237
- * user. The possible values are:</p>
238
- * <ul>
239
- * <li>
240
- * <p>
241
- * <code>ConfirmIntent</code> - The next action is asking the user if
242
- * the intent is complete and ready to be fulfilled. This is a yes/no
243
- * question such as "Place the order?"</p>
244
- * </li>
245
- * <li>
246
- * <p>
247
- * <code>Close</code> - Indicates that the there will not be a
248
- * response from the user. For example, the statement "Your order has
249
- * been placed" does not require a response.</p>
250
- * </li>
251
- * <li>
252
- * <p>
253
- * <code>Delegate</code> - The next action is determined by
254
- * Amazon Lex.</p>
255
- * </li>
256
- * <li>
257
- * <p>
258
- * <code>ElicitIntent</code> - The next action is to determine the
259
- * intent that the user wants to fulfill.</p>
260
- * </li>
261
- * <li>
262
- * <p>
263
- * <code>ElicitSlot</code> - The next action is to elicit a slot
264
- * value from the user.</p>
265
- * </li>
266
- * </ul>
267
- */
142
+
268
143
  type: DialogActionType | string | undefined;
269
- /**
270
- * <p>The name of the intent.</p>
271
- */
144
+
272
145
  intentName?: string;
273
- /**
274
- * <p>Map of the slots that have been gathered and their values. </p>
275
- */
146
+
276
147
  slots?: {
277
148
  [key: string]: string;
278
149
  };
279
- /**
280
- * <p>The name of the slot that should be elicited from the user.</p>
281
- */
150
+
282
151
  slotToElicit?: string;
283
- /**
284
- * <p>The fulfillment state of the intent. The possible values are:</p>
285
- * <ul>
286
- * <li>
287
- * <p>
288
- * <code>Failed</code> - The Lambda function associated with the
289
- * intent failed to fulfill the intent.</p>
290
- * </li>
291
- * <li>
292
- * <p>
293
- * <code>Fulfilled</code> - The intent has fulfilled by the Lambda
294
- * function associated with the intent. </p>
295
- * </li>
296
- * <li>
297
- * <p>
298
- * <code>ReadyForFulfillment</code> - All of the information
299
- * necessary for the intent is present and the intent ready to be
300
- * fulfilled by the client application.</p>
301
- * </li>
302
- * </ul>
303
- */
152
+
304
153
  fulfillmentState?: FulfillmentState | string;
305
- /**
306
- * <p>The message that should be shown to the user. If you don't specify a
307
- * message, Amazon Lex will use the message configured for the intent.</p>
308
- */
154
+
309
155
  message?: string;
310
- /**
311
- * <ul>
312
- * <li>
313
- * <p>
314
- * <code>PlainText</code> - The message contains plain UTF-8
315
- * text.</p>
316
- * </li>
317
- * <li>
318
- * <p>
319
- * <code>CustomPayload</code> - The message is a custom format for
320
- * the client.</p>
321
- * </li>
322
- * <li>
323
- * <p>
324
- * <code>SSML</code> - The message contains text formatted for voice
325
- * output.</p>
326
- * </li>
327
- * <li>
328
- * <p>
329
- * <code>Composite</code> - The message contains an escaped JSON
330
- * object containing one or more messages. For more information, see
331
- * <a href="https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html">Message Groups</a>. </p>
332
- * </li>
333
- * </ul>
334
- */
156
+
335
157
  messageFormat?: MessageFormatType | string;
336
158
  }
337
159
  export declare namespace DialogAction {
338
- /**
339
- * @internal
340
- */
160
+
341
161
  const filterSensitiveLog: (obj: DialogAction) => any;
342
162
  }
343
163
  export declare enum ConfirmationStatus {
@@ -345,1388 +165,98 @@ export declare enum ConfirmationStatus {
345
165
  DENIED = "Denied",
346
166
  NONE = "None"
347
167
  }
348
- /**
349
- * <p>Provides information about the state of an intent. You can use this
350
- * information to get the current state of an intent so that you can process
351
- * the intent, or so that you can return the intent to its previous
352
- * state.</p>
353
- */
168
+
354
169
  export interface IntentSummary {
355
- /**
356
- * <p>The name of the intent.</p>
357
- */
170
+
358
171
  intentName?: string;
359
- /**
360
- * <p>A user-defined label that identifies a particular intent. You can use
361
- * this label to return to a previous intent. </p>
362
- * <p>Use the <code>checkpointLabelFilter</code> parameter of the
363
- * <code>GetSessionRequest</code> operation to filter the intents returned
364
- * by the operation to those with only the specified label.</p>
365
- */
172
+
366
173
  checkpointLabel?: string;
367
- /**
368
- * <p>Map of the slots that have been gathered and their values. </p>
369
- */
174
+
370
175
  slots?: {
371
176
  [key: string]: string;
372
177
  };
373
- /**
374
- * <p>The status of the intent after the user responds to the confirmation
375
- * prompt. If the user confirms the intent, Amazon Lex sets this field to
376
- * <code>Confirmed</code>. If the user denies the intent, Amazon Lex sets this
377
- * value to <code>Denied</code>. The possible values are:</p>
378
- * <ul>
379
- * <li>
380
- * <p>
381
- * <code>Confirmed</code> - The user has responded "Yes" to the
382
- * confirmation prompt, confirming that the intent is complete and that
383
- * it is ready to be fulfilled.</p>
384
- * </li>
385
- * <li>
386
- * <p>
387
- * <code>Denied</code> - The user has responded "No" to the
388
- * confirmation prompt.</p>
389
- * </li>
390
- * <li>
391
- * <p>
392
- * <code>None</code> - The user has never been prompted for
393
- * confirmation; or, the user was prompted but did not confirm or deny
394
- * the prompt.</p>
395
- * </li>
396
- * </ul>
397
- */
178
+
398
179
  confirmationStatus?: ConfirmationStatus | string;
399
- /**
400
- * <p>The next action that the bot should take in its interaction with the
401
- * user. The possible values are:</p>
402
- * <ul>
403
- * <li>
404
- * <p>
405
- * <code>ConfirmIntent</code> - The next action is asking the user if
406
- * the intent is complete and ready to be fulfilled. This is a yes/no
407
- * question such as "Place the order?"</p>
408
- * </li>
409
- * <li>
410
- * <p>
411
- * <code>Close</code> - Indicates that the there will not be a
412
- * response from the user. For example, the statement "Your order has
413
- * been placed" does not require a response.</p>
414
- * </li>
415
- * <li>
416
- * <p>
417
- * <code>ElicitIntent</code> - The next action is to determine the
418
- * intent that the user wants to fulfill.</p>
419
- * </li>
420
- * <li>
421
- * <p>
422
- * <code>ElicitSlot</code> - The next action is to elicit a slot
423
- * value from the user.</p>
424
- * </li>
425
- * </ul>
426
- */
180
+
427
181
  dialogActionType: DialogActionType | string | undefined;
428
- /**
429
- * <p>The fulfillment state of the intent. The possible values are:</p>
430
- * <ul>
431
- * <li>
432
- * <p>
433
- * <code>Failed</code> - The Lambda function associated with the
434
- * intent failed to fulfill the intent.</p>
435
- * </li>
436
- * <li>
437
- * <p>
438
- * <code>Fulfilled</code> - The intent has fulfilled by the Lambda
439
- * function associated with the intent. </p>
440
- * </li>
441
- * <li>
442
- * <p>
443
- * <code>ReadyForFulfillment</code> - All of the information
444
- * necessary for the intent is present and the intent ready to be
445
- * fulfilled by the client application.</p>
446
- * </li>
447
- * </ul>
448
- */
182
+
449
183
  fulfillmentState?: FulfillmentState | string;
450
- /**
451
- * <p>The next slot to elicit from the user. If there is not slot to elicit,
452
- * the field is blank.</p>
453
- */
184
+
454
185
  slotToElicit?: string;
455
186
  }
456
187
  export declare namespace IntentSummary {
457
- /**
458
- * @internal
459
- */
188
+
460
189
  const filterSensitiveLog: (obj: IntentSummary) => any;
461
190
  }
462
191
  export interface GetSessionResponse {
463
- /**
464
- * <p>An array of information about the intents used in the session. The
465
- * array can contain a maximum of three summaries. If more than three intents
466
- * are used in the session, the <code>recentIntentSummaryView</code>
467
- * operation contains information about the last three intents used.</p>
468
- * <p>If you set the <code>checkpointLabelFilter</code> parameter in the
469
- * request, the array contains only the intents with the specified
470
- * label.</p>
471
- */
192
+
472
193
  recentIntentSummaryView?: IntentSummary[];
473
- /**
474
- * <p>Map of key/value pairs representing the session-specific context
475
- * information. It contains application information passed between Amazon Lex and
476
- * a client application.</p>
477
- */
194
+
478
195
  sessionAttributes?: {
479
196
  [key: string]: string;
480
197
  };
481
- /**
482
- * <p>A unique identifier for the session.</p>
483
- */
198
+
484
199
  sessionId?: string;
485
- /**
486
- * <p>Describes the current state of the bot.</p>
487
- */
200
+
488
201
  dialogAction?: DialogAction;
489
- /**
490
- * <p>A list of active contexts for the session. A context can be set when
491
- * an intent is fulfilled or by calling the <code>PostContent</code>,
492
- * <code>PostText</code>, or <code>PutSession</code> operation.</p>
493
- * <p>You can use a context to control the intents that can follow up an
494
- * intent, or to modify the operation of your application.</p>
495
- */
202
+
496
203
  activeContexts?: ActiveContext[];
497
204
  }
498
205
  export declare namespace GetSessionResponse {
499
- /**
500
- * @internal
501
- */
206
+
502
207
  const filterSensitiveLog: (obj: GetSessionResponse) => any;
503
208
  }
504
- /**
505
- * <p>Either the Amazon Lex bot is still building, or one of the dependent
506
- * services (Amazon Polly, AWS Lambda) failed with an internal service
507
- * error.</p>
508
- */
209
+
509
210
  export interface BadGatewayException extends __SmithyException, $MetadataBearer {
510
211
  name: "BadGatewayException";
511
212
  $fault: "server";
512
213
  Message?: string;
513
214
  }
514
215
  export declare namespace BadGatewayException {
515
- /**
516
- * @internal
517
- */
216
+
518
217
  const filterSensitiveLog: (obj: BadGatewayException) => any;
519
218
  }
520
- /**
521
- * <p> One of the dependencies, such as AWS Lambda or Amazon Polly, threw an
522
- * exception. For example, </p>
523
- * <ul>
524
- * <li>
525
- * <p>If Amazon Lex does not have sufficient permissions to call a Lambda
526
- * function.</p>
527
- * </li>
528
- * <li>
529
- * <p>If a Lambda function takes longer than 30 seconds to
530
- * execute.</p>
531
- * </li>
532
- * <li>
533
- * <p>If a fulfillment Lambda function returns a <code>Delegate</code>
534
- * dialog action without removing any slot values.</p>
535
- * </li>
536
- * </ul>
537
- */
219
+
538
220
  export interface DependencyFailedException extends __SmithyException, $MetadataBearer {
539
221
  name: "DependencyFailedException";
540
222
  $fault: "client";
541
223
  Message?: string;
542
224
  }
543
225
  export declare namespace DependencyFailedException {
544
- /**
545
- * @internal
546
- */
226
+
547
227
  const filterSensitiveLog: (obj: DependencyFailedException) => any;
548
228
  }
549
- /**
550
- * <p>This exception is not used.</p>
551
- */
229
+
552
230
  export interface LoopDetectedException extends __SmithyException, $MetadataBearer {
553
231
  name: "LoopDetectedException";
554
232
  $fault: "server";
555
233
  Message?: string;
556
234
  }
557
235
  export declare namespace LoopDetectedException {
558
- /**
559
- * @internal
560
- */
236
+
561
237
  const filterSensitiveLog: (obj: LoopDetectedException) => any;
562
238
  }
563
- /**
564
- * <p>The accept header in the request does not have a valid value.</p>
565
- */
239
+
566
240
  export interface NotAcceptableException extends __SmithyException, $MetadataBearer {
567
241
  name: "NotAcceptableException";
568
242
  $fault: "client";
569
243
  message?: string;
570
244
  }
571
245
  export declare namespace NotAcceptableException {
572
- /**
573
- * @internal
574
- */
246
+
575
247
  const filterSensitiveLog: (obj: NotAcceptableException) => any;
576
248
  }
577
249
  export interface PostContentRequest {
578
- /**
579
- * <p>Name of the Amazon Lex bot.</p>
580
- */
250
+
581
251
  botName: string | undefined;
582
- /**
583
- * <p>Alias of the Amazon Lex bot.</p>
584
- */
252
+
585
253
  botAlias: string | undefined;
586
- /**
587
- * <p>The ID of the client application user. Amazon Lex uses this to identify a
588
- * user's conversation with your bot. At runtime, each request must contain
589
- * the <code>userID</code> field.</p>
590
- * <p>To decide the user ID to use for your application, consider the
591
- * following factors.</p>
592
- * <ul>
593
- * <li>
594
- * <p>The <code>userID</code> field must not contain any personally
595
- * identifiable information of the user, for example, name, personal
596
- * identification numbers, or other end user personal information.</p>
597
- * </li>
598
- * <li>
599
- * <p>If you want a user to start a conversation on one device and
600
- * continue on another device, use a user-specific identifier.</p>
601
- * </li>
602
- * <li>
603
- * <p>If you want the same user to be able to have two independent
604
- * conversations on two different devices, choose a device-specific
605
- * identifier.</p>
606
- * </li>
607
- * <li>
608
- * <p>A user can't have two independent conversations with two different
609
- * versions of the same bot. For example, a user can't have a
610
- * conversation with the PROD and BETA versions of the same bot. If you
611
- * anticipate that a user will need to have conversation with two
612
- * different versions, for example, while testing, include the bot alias
613
- * in the user ID to separate the two conversations.</p>
614
- * </li>
615
- * </ul>
616
- */
254
+
617
255
  userId: string | undefined;
618
- /**
619
- * <p>You pass this value as the <code>x-amz-lex-session-attributes</code>
620
- * HTTP header.</p>
621
- * <p>Application-specific information passed between Amazon Lex and a client
622
- * application. The value must be a JSON serialized and base64 encoded map
623
- * with string keys and values. The total size of the
624
- * <code>sessionAttributes</code> and <code>requestAttributes</code>
625
- * headers is limited to 12 KB.</p>
626
- * <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
627
- */
256
+
628
257
  sessionAttributes?: __LazyJsonString | string;
629
- /**
630
- * <p>You pass this value as the <code>x-amz-lex-request-attributes</code>
631
- * HTTP header.</p>
632
- * <p>Request-specific information passed between Amazon Lex and a client
633
- * application. The value must be a JSON serialized and base64 encoded map
634
- * with string keys and values. The total size of the
635
- * <code>requestAttributes</code> and <code>sessionAttributes</code>
636
- * headers is limited to 12 KB.</p>
637
- * <p>The namespace <code>x-amz-lex:</code> is reserved for special
638
- * attributes. Don't create any request attributes with the prefix
639
- * <code>x-amz-lex:</code>.</p>
640
- * <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
641
- */
258
+
642
259
  requestAttributes?: __LazyJsonString | string;
643
- /**
644
- * <p> You pass this value as the <code>Content-Type</code> HTTP header. </p>
645
- * <p> Indicates the audio format or text. The header value must start with
646
- * one of the following prefixes: </p>
647
- * <ul>
648
- * <li>
649
- * <p>PCM format, audio data must be in little-endian byte order.</p>
650
- * <ul>
651
- * <li>
652
- * <p>audio/l16; rate=16000; channels=1</p>
653
- * </li>
654
- * <li>
655
- * <p>audio/x-l16; sample-rate=16000; channel-count=1</p>
656
- * </li>
657
- * <li>
658
- * <p>audio/lpcm; sample-rate=8000; sample-size-bits=16;
659
- * channel-count=1; is-big-endian=false </p>
660
- * </li>
661
- * </ul>
662
- * </li>
663
- * <li>
664
- * <p>Opus format</p>
665
- * <ul>
666
- * <li>
667
- * <p>audio/x-cbr-opus-with-preamble; preamble-size=0;
668
- * bit-rate=256000; frame-size-milliseconds=4</p>
669
- * </li>
670
- * </ul>
671
- * </li>
672
- * <li>
673
- * <p>Text format</p>
674
- * <ul>
675
- * <li>
676
- * <p>text/plain; charset=utf-8</p>
677
- * </li>
678
- * </ul>
679
- * </li>
680
- * </ul>
681
- */
260
+
682
261
  contentType: string | undefined;
683
- /**
684
- * <p> You pass this value as the <code>Accept</code> HTTP header. </p>
685
- * <p> The message Amazon Lex returns in the response can be either text or
686
- * speech based on the <code>Accept</code> HTTP header value in the request. </p>
687
- * <ul>
688
- * <li>
689
- * <p> If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex
690
- * returns text in the response. </p>
691
- * </li>
692
- * <li>
693
- * <p> If the value begins with <code>audio/</code>, Amazon Lex returns
694
- * speech in the response. Amazon Lex uses Amazon Polly to generate the speech
695
- * (using the configuration you specified in the <code>Accept</code>
696
- * header). For example, if you specify <code>audio/mpeg</code> as the
697
- * value, Amazon Lex returns speech in the MPEG format.</p>
698
- * </li>
699
- * <li>
700
- * <p>If the value is <code>audio/pcm</code>, the speech returned is
701
- * <code>audio/pcm</code> in 16-bit, little endian format.
702
- * </p>
703
- * </li>
704
- * <li>
705
- * <p>The following are the accepted values:</p>
706
- * <ul>
707
- * <li>
708
- * <p>audio/mpeg</p>
709
- * </li>
710
- * <li>
711
- * <p>audio/ogg</p>
712
- * </li>
713
- * <li>
714
- * <p>audio/pcm</p>
715
- * </li>
716
- * <li>
717
- * <p>text/plain; charset=utf-8</p>
718
- * </li>
719
- * <li>
720
- * <p>audio/* (defaults to mpeg)</p>
721
- * </li>
722
- * </ul>
723
- * </li>
724
- * </ul>
725
- */
726
- accept?: string;
727
- /**
728
- * <p> User input in PCM or Opus audio format or text format as described in
729
- * the <code>Content-Type</code> HTTP header. </p>
730
- * <p>You can stream audio data to Amazon Lex or you can create a local buffer
731
- * that captures all of the audio data before sending. In general, you get
732
- * better performance if you stream audio data rather than buffering the data
733
- * locally.</p>
734
- */
735
- inputStream: Readable | ReadableStream | Blob | undefined;
736
- /**
737
- * <p>A list of contexts active for the request. A context can be activated
738
- * when a previous intent is fulfilled, or by including the context in the
739
- * request,</p>
740
- * <p>If you don't specify a list of contexts, Amazon Lex will use the current
741
- * list of contexts for the session. If you specify an empty list, all
742
- * contexts for the session are cleared.</p>
743
- */
744
- activeContexts?: __LazyJsonString | string;
745
- }
746
- export declare namespace PostContentRequest {
747
- /**
748
- * @internal
749
- */
750
- const filterSensitiveLog: (obj: PostContentRequest) => any;
751
- }
752
- export declare enum DialogState {
753
- CONFIRM_INTENT = "ConfirmIntent",
754
- ELICIT_INTENT = "ElicitIntent",
755
- ELICIT_SLOT = "ElicitSlot",
756
- FAILED = "Failed",
757
- FULFILLED = "Fulfilled",
758
- READY_FOR_FULFILLMENT = "ReadyForFulfillment"
759
- }
760
- export interface PostContentResponse {
761
- /**
762
- * <p>Content type as specified in the <code>Accept</code> HTTP header in
763
- * the request.</p>
764
- */
765
- contentType?: string;
766
- /**
767
- * <p>Current user intent that Amazon Lex is aware of.</p>
768
- */
769
- intentName?: string;
770
- /**
771
- * <p>Provides a score that indicates how confident Amazon Lex is that the
772
- * returned intent is the one that matches the user's intent. The score is
773
- * between 0.0 and 1.0.</p>
774
- * <p>The score is a relative score, not an absolute score. The score may
775
- * change based on improvements to Amazon Lex. </p>
776
- */
777
- nluIntentConfidence?: __LazyJsonString | string;
778
- /**
779
- * <p>One to four alternative intents that may be applicable to the user's
780
- * intent.</p>
781
- * <p>Each alternative includes a score that indicates how confident Amazon Lex
782
- * is that the intent matches the user's intent. The intents are sorted by
783
- * the confidence score.</p>
784
- */
785
- alternativeIntents?: __LazyJsonString | string;
786
- /**
787
- * <p>Map of zero or more intent slots (name/value pairs) Amazon Lex detected
788
- * from the user input during the conversation. The field is base-64
789
- * encoded.</p>
790
- * <p>Amazon Lex creates a resolution list containing likely values for a slot.
791
- * The value that it returns is determined by the
792
- * <code>valueSelectionStrategy</code> selected when the slot type was
793
- * created or updated. If <code>valueSelectionStrategy</code> is set to
794
- * <code>ORIGINAL_VALUE</code>, the value provided by the user is returned,
795
- * if the user value is similar to the slot values. If
796
- * <code>valueSelectionStrategy</code> is set to
797
- * <code>TOP_RESOLUTION</code> Amazon Lex returns the first value in the
798
- * resolution list or, if there is no resolution list, null. If you don't
799
- * specify a <code>valueSelectionStrategy</code>, the default is
800
- * <code>ORIGINAL_VALUE</code>.</p>
801
- */
802
- slots?: __LazyJsonString | string;
803
- /**
804
- * <p> Map of key/value pairs representing the session-specific context
805
- * information. </p>
806
- */
807
- sessionAttributes?: __LazyJsonString | string;
808
- /**
809
- * <p>The sentiment expressed in an utterance.</p>
810
- * <p>When the bot is configured to send utterances to Amazon Comprehend for
811
- * sentiment analysis, this field contains the result of the analysis.</p>
812
- */
813
- sentimentResponse?: string;
814
- /**
815
- * @deprecated
816
- *
817
- * <p>You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419,
818
- * es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the
819
- * <code>message</code> field is null. You should use the
820
- * <code>encodedMessage</code> field instead.</p>
821
- * <p>The message to convey to the user. The message can come from the bot's
822
- * configuration or from a Lambda function.</p>
823
- * <p>If the intent is not configured with a Lambda function, or if the Lambda
824
- * function returned <code>Delegate</code> as the
825
- * <code>dialogAction.type</code> in its response, Amazon Lex decides on the
826
- * next course of action and selects an appropriate message from the bot's
827
- * configuration based on the current interaction context. For example, if
828
- * Amazon Lex isn't able to understand user input, it uses a clarification prompt
829
- * message.</p>
830
- * <p>When you create an intent you can assign messages to groups. When
831
- * messages are assigned to groups Amazon Lex returns one message from each group
832
- * in the response. The message field is an escaped JSON string containing
833
- * the messages. For more information about the structure of the JSON string
834
- * returned, see <a>msg-prompts-formats</a>.</p>
835
- * <p>If the Lambda function returns a message, Amazon Lex passes it to the client
836
- * in its response.</p>
837
- */
838
- message?: string;
839
- /**
840
- * <p>The message to convey to the user. The message can come from the bot's
841
- * configuration or from a Lambda function.</p>
842
- * <p>If the intent is not configured with a Lambda function, or if the Lambda
843
- * function returned <code>Delegate</code> as the
844
- * <code>dialogAction.type</code> in its response, Amazon Lex decides on the
845
- * next course of action and selects an appropriate message from the bot's
846
- * configuration based on the current interaction context. For example, if
847
- * Amazon Lex isn't able to understand user input, it uses a clarification prompt
848
- * message.</p>
849
- * <p>When you create an intent you can assign messages to groups. When
850
- * messages are assigned to groups Amazon Lex returns one message from each group
851
- * in the response. The message field is an escaped JSON string containing
852
- * the messages. For more information about the structure of the JSON string
853
- * returned, see <a>msg-prompts-formats</a>.</p>
854
- * <p>If the Lambda function returns a message, Amazon Lex passes it to the client
855
- * in its response.</p>
856
- * <p>The <code>encodedMessage</code> field is base-64 encoded. You must
857
- * decode the field before you can use the value.</p>
858
- */
859
- encodedMessage?: string;
860
- /**
861
- * <p>The format of the response message. One of the following
862
- * values:</p>
863
- * <ul>
864
- * <li>
865
- * <p>
866
- * <code>PlainText</code> - The message contains plain UTF-8
867
- * text.</p>
868
- * </li>
869
- * <li>
870
- * <p>
871
- * <code>CustomPayload</code> - The message is a custom format for
872
- * the client.</p>
873
- * </li>
874
- * <li>
875
- * <p>
876
- * <code>SSML</code> - The message contains text formatted for voice
877
- * output.</p>
878
- * </li>
879
- * <li>
880
- * <p>
881
- * <code>Composite</code> - The message contains an escaped JSON
882
- * object containing one or more messages from the groups that messages
883
- * were assigned to when the intent was created.</p>
884
- * </li>
885
- * </ul>
886
- */
887
- messageFormat?: MessageFormatType | string;
888
- /**
889
- * <p>Identifies the current state of the user interaction. Amazon Lex returns
890
- * one of the following values as <code>dialogState</code>. The client can
891
- * optionally use this information to customize the user interface. </p>
892
- * <ul>
893
- * <li>
894
- * <p>
895
- * <code>ElicitIntent</code> - Amazon Lex wants to elicit the user's intent.
896
- * Consider the following examples: </p>
897
- * <p> For example, a user might utter an intent ("I want to order a
898
- * pizza"). If Amazon Lex cannot infer the user intent from this utterance, it
899
- * will return this dialog state. </p>
900
- * </li>
901
- * <li>
902
- * <p>
903
- * <code>ConfirmIntent</code> - Amazon Lex is expecting a "yes" or "no"
904
- * response. </p>
905
- * <p>For example, Amazon Lex wants user confirmation before fulfilling an
906
- * intent. Instead of a simple "yes" or "no" response, a user might
907
- * respond with additional information. For example, "yes, but make it a
908
- * thick crust pizza" or "no, I want to order a drink." Amazon Lex can process
909
- * such additional information (in these examples, update the crust type
910
- * slot or change the intent from OrderPizza to OrderDrink). </p>
911
- * </li>
912
- * <li>
913
- * <p>
914
- * <code>ElicitSlot</code> - Amazon Lex is expecting the value of a slot for
915
- * the current intent. </p>
916
- * <p> For example, suppose that in the response Amazon Lex sends this
917
- * message: "What size pizza would you like?". A user might reply with
918
- * the slot value (e.g., "medium"). The user might also provide
919
- * additional information in the response (e.g., "medium thick crust
920
- * pizza"). Amazon Lex can process such additional information appropriately.
921
- * </p>
922
- * </li>
923
- * <li>
924
- * <p>
925
- * <code>Fulfilled</code> - Conveys that the Lambda function has
926
- * successfully fulfilled the intent. </p>
927
- * </li>
928
- * <li>
929
- * <p>
930
- * <code>ReadyForFulfillment</code> - Conveys that the client has to
931
- * fulfill the request. </p>
932
- * </li>
933
- * <li>
934
- * <p>
935
- * <code>Failed</code> - Conveys that the conversation with the user
936
- * failed. </p>
937
- * <p> This can happen for various reasons, including that the user does
938
- * not provide an appropriate response to prompts from the service (you
939
- * can configure how many times Amazon Lex can prompt a user for specific
940
- * information), or if the Lambda function fails to fulfill the intent.
941
- * </p>
942
- * </li>
943
- * </ul>
944
- */
945
- dialogState?: DialogState | string;
946
- /**
947
- * <p> If the <code>dialogState</code> value is <code>ElicitSlot</code>,
948
- * returns the name of the slot for which Amazon Lex is eliciting a value. </p>
949
- */
950
- slotToElicit?: string;
951
- /**
952
- * @deprecated
953
- *
954
- * <p>The text used to process the request.</p>
955
- * <p>You can use this field only in the de-DE, en-AU, en-GB, en-US, es-419,
956
- * es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the
957
- * <code>inputTranscript</code> field is null. You should use the
958
- * <code>encodedInputTranscript</code> field instead.</p>
959
- * <p>If the input was an audio stream, the <code>inputTranscript</code>
960
- * field contains the text extracted from the audio stream. This is the text
961
- * that is actually processed to recognize intents and slot values. You can
962
- * use this information to determine if Amazon Lex is correctly processing the
963
- * audio that you send.</p>
964
- */
965
- inputTranscript?: string;
966
- /**
967
- * <p>The text used to process the request.</p>
968
- * <p>If the input was an audio stream, the
969
- * <code>encodedInputTranscript</code> field contains the text extracted
970
- * from the audio stream. This is the text that is actually processed to
971
- * recognize intents and slot values. You can use this information to
972
- * determine if Amazon Lex is correctly processing the audio that you send.</p>
973
- * <p>The <code>encodedInputTranscript</code> field is base-64 encoded. You must
974
- * decode the field before you can use the value.</p>
975
- */
976
- encodedInputTranscript?: string;
977
- /**
978
- * <p>The prompt (or statement) to convey to the user. This is based on the
979
- * bot configuration and context. For example, if Amazon Lex did not understand
980
- * the user intent, it sends the <code>clarificationPrompt</code> configured
981
- * for the bot. If the intent requires confirmation before taking the
982
- * fulfillment action, it sends the <code>confirmationPrompt</code>. Another
983
- * example: Suppose that the Lambda function successfully fulfilled the
984
- * intent, and sent a message to convey to the user. Then Amazon Lex sends that
985
- * message in the response. </p>
986
- */
987
- audioStream?: Readable | ReadableStream | Blob;
988
- /**
989
- * <p>The version of the bot that responded to the conversation. You can use
990
- * this information to help determine if one version of a bot is performing
991
- * better than another version.</p>
992
- */
993
- botVersion?: string;
994
- /**
995
- * <p>The unique identifier for the session.</p>
996
- */
997
- sessionId?: string;
998
- /**
999
- * <p>A list of active contexts for the session. A context can be set when
1000
- * an intent is fulfilled or by calling the <code>PostContent</code>,
1001
- * <code>PostText</code>, or <code>PutSession</code> operation.</p>
1002
- * <p>You can use a context to control the intents that can follow up an
1003
- * intent, or to modify the operation of your application.</p>
1004
- */
1005
- activeContexts?: __LazyJsonString | string;
1006
- }
1007
- export declare namespace PostContentResponse {
1008
- /**
1009
- * @internal
1010
- */
1011
- const filterSensitiveLog: (obj: PostContentResponse) => any;
1012
- }
1013
- /**
1014
- * <p>The input speech is too long.</p>
1015
- */
1016
- export interface RequestTimeoutException extends __SmithyException, $MetadataBearer {
1017
- name: "RequestTimeoutException";
1018
- $fault: "client";
1019
- message?: string;
1020
- }
1021
- export declare namespace RequestTimeoutException {
1022
- /**
1023
- * @internal
1024
- */
1025
- const filterSensitiveLog: (obj: RequestTimeoutException) => any;
1026
- }
1027
- /**
1028
- * <p>The Content-Type header (<code>PostContent</code> API) has an invalid
1029
- * value. </p>
1030
- */
1031
- export interface UnsupportedMediaTypeException extends __SmithyException, $MetadataBearer {
1032
- name: "UnsupportedMediaTypeException";
1033
- $fault: "client";
1034
- message?: string;
1035
- }
1036
- export declare namespace UnsupportedMediaTypeException {
1037
- /**
1038
- * @internal
1039
- */
1040
- const filterSensitiveLog: (obj: UnsupportedMediaTypeException) => any;
1041
- }
1042
- export interface PostTextRequest {
1043
- /**
1044
- * <p>The name of the Amazon Lex bot.</p>
1045
- */
1046
- botName: string | undefined;
1047
- /**
1048
- * <p>The alias of the Amazon Lex bot.</p>
1049
- */
1050
- botAlias: string | undefined;
1051
- /**
1052
- * <p>The ID of the client application user. Amazon Lex uses this to identify a
1053
- * user's conversation with your bot. At runtime, each request must contain
1054
- * the <code>userID</code> field.</p>
1055
- * <p>To decide the user ID to use for your application, consider the
1056
- * following factors.</p>
1057
- * <ul>
1058
- * <li>
1059
- * <p>The <code>userID</code> field must not contain any personally
1060
- * identifiable information of the user, for example, name, personal
1061
- * identification numbers, or other end user personal information.</p>
1062
- * </li>
1063
- * <li>
1064
- * <p>If you want a user to start a conversation on one device and
1065
- * continue on another device, use a user-specific identifier.</p>
1066
- * </li>
1067
- * <li>
1068
- * <p>If you want the same user to be able to have two independent
1069
- * conversations on two different devices, choose a device-specific
1070
- * identifier.</p>
1071
- * </li>
1072
- * <li>
1073
- * <p>A user can't have two independent conversations with two different
1074
- * versions of the same bot. For example, a user can't have a
1075
- * conversation with the PROD and BETA versions of the same bot. If you
1076
- * anticipate that a user will need to have conversation with two
1077
- * different versions, for example, while testing, include the bot alias
1078
- * in the user ID to separate the two conversations.</p>
1079
- * </li>
1080
- * </ul>
1081
- */
1082
- userId: string | undefined;
1083
- /**
1084
- * <p>Application-specific information passed between Amazon Lex and a client
1085
- * application.</p>
1086
- * <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
1087
- */
1088
- sessionAttributes?: {
1089
- [key: string]: string;
1090
- };
1091
- /**
1092
- * <p>Request-specific information passed between Amazon Lex and a client
1093
- * application.</p>
1094
- * <p>The namespace <code>x-amz-lex:</code> is reserved for special
1095
- * attributes. Don't create any request attributes with the prefix
1096
- * <code>x-amz-lex:</code>.</p>
1097
- * <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
1098
- */
1099
- requestAttributes?: {
1100
- [key: string]: string;
1101
- };
1102
- /**
1103
- * <p>The text that the user entered (Amazon Lex interprets this text).</p>
1104
- */
1105
- inputText: string | undefined;
1106
- /**
1107
- * <p>A list of contexts active for the request. A context can be activated
1108
- * when a previous intent is fulfilled, or by including the context in the
1109
- * request,</p>
1110
- * <p>If you don't specify a list of contexts, Amazon Lex will use the current
1111
- * list of contexts for the session. If you specify an empty list, all
1112
- * contexts for the session are cleared.</p>
1113
- */
1114
- activeContexts?: ActiveContext[];
1115
- }
1116
- export declare namespace PostTextRequest {
1117
- /**
1118
- * @internal
1119
- */
1120
- const filterSensitiveLog: (obj: PostTextRequest) => any;
1121
- }
1122
- /**
1123
- * <p>Provides a score that indicates the confidence that Amazon Lex has that an
1124
- * intent is the one that satisfies the user's intent.</p>
1125
- */
1126
- export interface IntentConfidence {
1127
- /**
1128
- * <p>A score that indicates how confident Amazon Lex is that an intent satisfies
1129
- * the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate
1130
- * higher confidence.</p>
1131
- */
1132
- score?: number;
1133
- }
1134
- export declare namespace IntentConfidence {
1135
- /**
1136
- * @internal
1137
- */
1138
- const filterSensitiveLog: (obj: IntentConfidence) => any;
1139
- }
1140
- /**
1141
- * <p>An intent that Amazon Lex suggests satisfies the user's intent. Includes
1142
- * the name of the intent, the confidence that Amazon Lex has that the user's
1143
- * intent is satisfied, and the slots defined for the intent.</p>
1144
- */
1145
- export interface PredictedIntent {
1146
- /**
1147
- * <p>The name of the intent that Amazon Lex suggests satisfies the user's
1148
- * intent.</p>
1149
- */
1150
- intentName?: string;
1151
- /**
1152
- * <p>Indicates how confident Amazon Lex is that an intent satisfies the user's
1153
- * intent.</p>
1154
- */
1155
- nluIntentConfidence?: IntentConfidence;
1156
- /**
1157
- * <p>The slot and slot values associated with the predicted intent.</p>
1158
- */
1159
- slots?: {
1160
- [key: string]: string;
1161
- };
1162
- }
1163
- export declare namespace PredictedIntent {
1164
- /**
1165
- * @internal
1166
- */
1167
- const filterSensitiveLog: (obj: PredictedIntent) => any;
1168
- }
1169
- export declare enum ContentType {
1170
- GENERIC = "application/vnd.amazonaws.card.generic"
1171
- }
1172
- /**
1173
- * <p>Represents an option to be shown on the client platform (Facebook,
1174
- * Slack, etc.)</p>
1175
- */
1176
- export interface Button {
1177
- /**
1178
- * <p>Text that is visible to the user on the button.</p>
1179
- */
1180
- text: string | undefined;
1181
- /**
1182
- * <p>The value sent to Amazon Lex when a user chooses the button. For
1183
- * example, consider button text "NYC." When the user chooses the button, the
1184
- * value sent can be "New York City."</p>
1185
- */
1186
- value: string | undefined;
1187
- }
1188
- export declare namespace Button {
1189
- /**
1190
- * @internal
1191
- */
1192
- const filterSensitiveLog: (obj: Button) => any;
1193
- }
1194
- /**
1195
- * <p>Represents an option rendered to the user when a prompt is shown. It
1196
- * could be an image, a button, a link, or text. </p>
1197
- */
1198
- export interface GenericAttachment {
1199
- /**
1200
- * <p>The title of the option.</p>
1201
- */
1202
- title?: string;
1203
- /**
1204
- * <p>The subtitle shown below the title.</p>
1205
- */
1206
- subTitle?: string;
1207
- /**
1208
- * <p>The URL of an attachment to the response card.</p>
1209
- */
1210
- attachmentLinkUrl?: string;
1211
- /**
1212
- * <p>The URL of an image that is displayed to the user.</p>
1213
- */
1214
- imageUrl?: string;
1215
- /**
1216
- * <p>The list of options to show to the user.</p>
1217
- */
1218
- buttons?: Button[];
1219
- }
1220
- export declare namespace GenericAttachment {
1221
- /**
1222
- * @internal
1223
- */
1224
- const filterSensitiveLog: (obj: GenericAttachment) => any;
1225
- }
1226
- /**
1227
- * <p>If you configure a response card when creating your bots, Amazon Lex
1228
- * substitutes the session attributes and slot values that are available, and
1229
- * then returns it. The response card can also come from a Lambda function (
1230
- * <code>dialogCodeHook</code> and <code>fulfillmentActivity</code> on an
1231
- * intent).</p>
1232
- */
1233
- export interface ResponseCard {
1234
- /**
1235
- * <p>The version of the response card format.</p>
1236
- */
1237
- version?: string;
1238
- /**
1239
- * <p>The content type of the response.</p>
1240
- */
1241
- contentType?: ContentType | string;
1242
- /**
1243
- * <p>An array of attachment objects representing options.</p>
1244
- */
1245
- genericAttachments?: GenericAttachment[];
1246
- }
1247
- export declare namespace ResponseCard {
1248
- /**
1249
- * @internal
1250
- */
1251
- const filterSensitiveLog: (obj: ResponseCard) => any;
1252
- }
1253
- /**
1254
- * <p>The sentiment expressed in an utterance.</p>
1255
- * <p>When the bot is configured to send utterances to Amazon Comprehend for
1256
- * sentiment analysis, this field structure contains the result of the
1257
- * analysis.</p>
1258
- */
1259
- export interface SentimentResponse {
1260
- /**
1261
- * <p>The inferred sentiment that Amazon Comprehend has the highest
1262
- * confidence in.</p>
1263
- */
1264
- sentimentLabel?: string;
1265
- /**
1266
- * <p>The likelihood that the sentiment was correctly inferred.</p>
1267
- */
1268
- sentimentScore?: string;
1269
- }
1270
- export declare namespace SentimentResponse {
1271
- /**
1272
- * @internal
1273
- */
1274
- const filterSensitiveLog: (obj: SentimentResponse) => any;
1275
- }
1276
- export interface PostTextResponse {
1277
- /**
1278
- * <p>The current user intent that Amazon Lex is aware of.</p>
1279
- */
1280
- intentName?: string;
1281
- /**
1282
- * <p>Provides a score that indicates how confident Amazon Lex is that the
1283
- * returned intent is the one that matches the user's intent. The score is
1284
- * between 0.0 and 1.0. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/confidence-scores.html">Confidence Scores</a>.</p>
1285
- * <p>The score is a relative score, not an absolute score. The score may
1286
- * change based on improvements to Amazon Lex.</p>
1287
- */
1288
- nluIntentConfidence?: IntentConfidence;
1289
- /**
1290
- * <p>One to four alternative intents that may be applicable to the user's
1291
- * intent.</p>
1292
- * <p>Each alternative includes a score that indicates how confident Amazon Lex
1293
- * is that the intent matches the user's intent. The intents are sorted by
1294
- * the confidence score.</p>
1295
- */
1296
- alternativeIntents?: PredictedIntent[];
1297
- /**
1298
- * <p> The intent slots that Amazon Lex detected from the user input in the
1299
- * conversation. </p>
1300
- * <p>Amazon Lex creates a resolution list containing likely values for a slot.
1301
- * The value that it returns is determined by the
1302
- * <code>valueSelectionStrategy</code> selected when the slot type was
1303
- * created or updated. If <code>valueSelectionStrategy</code> is set to
1304
- * <code>ORIGINAL_VALUE</code>, the value provided by the user is returned,
1305
- * if the user value is similar to the slot values. If
1306
- * <code>valueSelectionStrategy</code> is set to
1307
- * <code>TOP_RESOLUTION</code> Amazon Lex returns the first value in the
1308
- * resolution list or, if there is no resolution list, null. If you don't
1309
- * specify a <code>valueSelectionStrategy</code>, the default is
1310
- * <code>ORIGINAL_VALUE</code>.</p>
1311
- */
1312
- slots?: {
1313
- [key: string]: string;
1314
- };
1315
- /**
1316
- * <p>A map of key-value pairs representing the session-specific context
1317
- * information.</p>
1318
- */
1319
- sessionAttributes?: {
1320
- [key: string]: string;
1321
- };
1322
- /**
1323
- * <p>The message to convey to the user. The message can come from the bot's
1324
- * configuration or from a Lambda function.</p>
1325
- * <p>If the intent is not configured with a Lambda function, or if the Lambda
1326
- * function returned <code>Delegate</code> as the
1327
- * <code>dialogAction.type</code> its response, Amazon Lex decides on the next
1328
- * course of action and selects an appropriate message from the bot's
1329
- * configuration based on the current interaction context. For example, if
1330
- * Amazon Lex isn't able to understand user input, it uses a clarification prompt
1331
- * message.</p>
1332
- * <p>When you create an intent you can assign messages to groups. When
1333
- * messages are assigned to groups Amazon Lex returns one message from each group
1334
- * in the response. The message field is an escaped JSON string containing
1335
- * the messages. For more information about the structure of the JSON string
1336
- * returned, see <a>msg-prompts-formats</a>.</p>
1337
- * <p>If the Lambda function returns a message, Amazon Lex passes it to the client
1338
- * in its response.</p>
1339
- */
1340
- message?: string;
1341
- /**
1342
- * <p>The sentiment expressed in and utterance.</p>
1343
- * <p>When the bot is configured to send utterances to Amazon Comprehend for
1344
- * sentiment analysis, this field contains the result of the analysis.</p>
1345
- */
1346
- sentimentResponse?: SentimentResponse;
1347
- /**
1348
- * <p>The format of the response message. One of the following
1349
- * values:</p>
1350
- * <ul>
1351
- * <li>
1352
- * <p>
1353
- * <code>PlainText</code> - The message contains plain UTF-8
1354
- * text.</p>
1355
- * </li>
1356
- * <li>
1357
- * <p>
1358
- * <code>CustomPayload</code> - The message is a custom format
1359
- * defined by the Lambda function.</p>
1360
- * </li>
1361
- * <li>
1362
- * <p>
1363
- * <code>SSML</code> - The message contains text formatted for voice
1364
- * output.</p>
1365
- * </li>
1366
- * <li>
1367
- * <p>
1368
- * <code>Composite</code> - The message contains an escaped JSON
1369
- * object containing one or more messages from the groups that messages
1370
- * were assigned to when the intent was created.</p>
1371
- * </li>
1372
- * </ul>
1373
- */
1374
- messageFormat?: MessageFormatType | string;
1375
- /**
1376
- * <p> Identifies the current state of the user interaction. Amazon Lex returns
1377
- * one of the following values as <code>dialogState</code>. The client can
1378
- * optionally use this information to customize the user interface. </p>
1379
- * <ul>
1380
- * <li>
1381
- * <p>
1382
- * <code>ElicitIntent</code> - Amazon Lex wants to elicit user intent. </p>
1383
- * <p>For example, a user might utter an intent ("I want to order a
1384
- * pizza"). If Amazon Lex cannot infer the user intent from this utterance, it
1385
- * will return this dialogState.</p>
1386
- * </li>
1387
- * <li>
1388
- * <p>
1389
- * <code>ConfirmIntent</code> - Amazon Lex is expecting a "yes" or "no"
1390
- * response. </p>
1391
- * <p> For example, Amazon Lex wants user confirmation before fulfilling an
1392
- * intent. </p>
1393
- * <p>Instead of a simple "yes" or "no," a user might respond with
1394
- * additional information. For example, "yes, but make it thick crust
1395
- * pizza" or "no, I want to order a drink". Amazon Lex can process such
1396
- * additional information (in these examples, update the crust type slot
1397
- * value, or change intent from OrderPizza to OrderDrink).</p>
1398
- * </li>
1399
- * <li>
1400
- * <p>
1401
- * <code>ElicitSlot</code> - Amazon Lex is expecting a slot value for the
1402
- * current intent. </p>
1403
- * <p>For example, suppose that in the response Amazon Lex sends this
1404
- * message: "What size pizza would you like?". A user might reply with
1405
- * the slot value (e.g., "medium"). The user might also provide
1406
- * additional information in the response (e.g., "medium thick crust
1407
- * pizza"). Amazon Lex can process such additional information appropriately.
1408
- * </p>
1409
- * </li>
1410
- * <li>
1411
- * <p>
1412
- * <code>Fulfilled</code> - Conveys that the Lambda function configured
1413
- * for the intent has successfully fulfilled the intent. </p>
1414
- *
1415
- * </li>
1416
- * <li>
1417
- * <p>
1418
- * <code>ReadyForFulfillment</code> - Conveys that the client has to
1419
- * fulfill the intent. </p>
1420
- * </li>
1421
- * <li>
1422
- * <p>
1423
- * <code>Failed</code> - Conveys that the conversation with the user
1424
- * failed. </p>
1425
- * <p> This can happen for various reasons including that the user did
1426
- * not provide an appropriate response to prompts from the service (you
1427
- * can configure how many times Amazon Lex can prompt a user for specific
1428
- * information), or the Lambda function failed to fulfill the intent.
1429
- * </p>
1430
- * </li>
1431
- * </ul>
1432
- */
1433
- dialogState?: DialogState | string;
1434
- /**
1435
- * <p>If the <code>dialogState</code> value is <code>ElicitSlot</code>,
1436
- * returns the name of the slot for which Amazon Lex is eliciting a value. </p>
1437
- */
1438
- slotToElicit?: string;
1439
- /**
1440
- * <p>Represents the options that the user has to respond to the current
1441
- * prompt. Response Card can come from the bot configuration (in the
1442
- * Amazon Lex console, choose the settings button next to a slot) or from a
1443
- * code hook (Lambda function). </p>
1444
- */
1445
- responseCard?: ResponseCard;
1446
- /**
1447
- * <p>A unique identifier for the session.</p>
1448
- */
1449
- sessionId?: string;
1450
- /**
1451
- * <p>The version of the bot that responded to the conversation. You can use
1452
- * this information to help determine if one version of a bot is performing
1453
- * better than another version.</p>
1454
- */
1455
- botVersion?: string;
1456
- /**
1457
- * <p>A list of active contexts for the session. A context can be set when
1458
- * an intent is fulfilled or by calling the <code>PostContent</code>,
1459
- * <code>PostText</code>, or <code>PutSession</code> operation.</p>
1460
- * <p>You can use a context to control the intents that can follow up an
1461
- * intent, or to modify the operation of your application.</p>
1462
- */
1463
- activeContexts?: ActiveContext[];
1464
- }
1465
- export declare namespace PostTextResponse {
1466
- /**
1467
- * @internal
1468
- */
1469
- const filterSensitiveLog: (obj: PostTextResponse) => any;
1470
- }
1471
- export interface PutSessionRequest {
1472
- /**
1473
- * <p>The name of the bot that contains the session data.</p>
1474
- */
1475
- botName: string | undefined;
1476
- /**
1477
- * <p>The alias in use for the bot that contains the session data.</p>
1478
- */
1479
- botAlias: string | undefined;
1480
- /**
1481
- * <p>The ID of the client application user. Amazon Lex uses this to identify a
1482
- * user's conversation with your bot. </p>
1483
- */
1484
- userId: string | undefined;
1485
- /**
1486
- * <p>Map of key/value pairs representing the session-specific context
1487
- * information. It contains application information passed between Amazon Lex and
1488
- * a client application.</p>
1489
- */
1490
- sessionAttributes?: {
1491
- [key: string]: string;
1492
- };
1493
- /**
1494
- * <p>Sets the next action that the bot should take to fulfill the
1495
- * conversation.</p>
1496
- */
1497
- dialogAction?: DialogAction;
1498
- /**
1499
- * <p>A summary of the recent intents for the bot. You can use the intent
1500
- * summary view to set a checkpoint label on an intent and modify attributes
1501
- * of intents. You can also use it to remove or add intent summary objects to
1502
- * the list.</p>
1503
- * <p>An intent that you modify or add to the list must make sense for the
1504
- * bot. For example, the intent name must be valid for the bot. You must
1505
- * provide valid values for:</p>
1506
- * <ul>
1507
- * <li>
1508
- * <p>
1509
- * <code>intentName</code>
1510
- * </p>
1511
- * </li>
1512
- * <li>
1513
- * <p>slot names</p>
1514
- * </li>
1515
- * <li>
1516
- * <p>
1517
- * <code>slotToElict</code>
1518
- * </p>
1519
- * </li>
1520
- * </ul>
1521
- * <p>If you send the <code>recentIntentSummaryView</code> parameter in a
1522
- * <code>PutSession</code> request, the contents of the new summary view
1523
- * replaces the old summary view. For example, if a <code>GetSession</code>
1524
- * request returns three intents in the summary view and you call
1525
- * <code>PutSession</code> with one intent in the summary view, the next
1526
- * call to <code>GetSession</code> will only return one intent.</p>
1527
- */
1528
- recentIntentSummaryView?: IntentSummary[];
1529
- /**
1530
- * <p>The message that Amazon Lex returns in the response can be either text or
1531
- * speech based depending on the value of this field.</p>
1532
- * <ul>
1533
- * <li>
1534
- * <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex
1535
- * returns text in the response.</p>
1536
- * </li>
1537
- * <li>
1538
- * <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech
1539
- * in the response. Amazon Lex uses Amazon Polly to generate the speech in the
1540
- * configuration that you specify. For example, if you specify
1541
- * <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the
1542
- * MPEG format.</p>
1543
- * </li>
1544
- * <li>
1545
- * <p>If the value is <code>audio/pcm</code>, the speech is returned as
1546
- * <code>audio/pcm</code> in 16-bit, little endian format.</p>
1547
- * </li>
1548
- * <li>
1549
- * <p>The following are the accepted values:</p>
1550
- * <ul>
1551
- * <li>
1552
- * <p>
1553
- * <code>audio/mpeg</code>
1554
- * </p>
1555
- * </li>
1556
- * <li>
1557
- * <p>
1558
- * <code>audio/ogg</code>
1559
- * </p>
1560
- * </li>
1561
- * <li>
1562
- * <p>
1563
- * <code>audio/pcm</code>
1564
- * </p>
1565
- * </li>
1566
- * <li>
1567
- * <p>
1568
- * <code>audio/*</code> (defaults to mpeg)</p>
1569
- * </li>
1570
- * <li>
1571
- * <p>
1572
- * <code>text/plain; charset=utf-8</code>
1573
- * </p>
1574
- * </li>
1575
- * </ul>
1576
- * </li>
1577
- * </ul>
1578
- */
1579
- accept?: string;
1580
- /**
1581
- * <p>A list of contexts active for the request. A context can be activated
1582
- * when a previous intent is fulfilled, or by including the context in the
1583
- * request,</p>
1584
- * <p>If you don't specify a list of contexts, Amazon Lex will use the current
1585
- * list of contexts for the session. If you specify an empty list, all
1586
- * contexts for the session are cleared.</p>
1587
- */
1588
- activeContexts?: ActiveContext[];
1589
- }
1590
- export declare namespace PutSessionRequest {
1591
- /**
1592
- * @internal
1593
- */
1594
- const filterSensitiveLog: (obj: PutSessionRequest) => any;
1595
- }
1596
- export interface PutSessionResponse {
1597
- /**
1598
- * <p>Content type as specified in the <code>Accept</code> HTTP header in
1599
- * the request.</p>
1600
- */
1601
- contentType?: string;
1602
- /**
1603
- * <p>The name of the current intent.</p>
1604
- */
1605
- intentName?: string;
1606
- /**
1607
- * <p>Map of zero or more intent slots Amazon Lex detected from the user input
1608
- * during the conversation.</p>
1609
- * <p>Amazon Lex creates a resolution list containing likely values for a slot.
1610
- * The value that it returns is determined by the
1611
- * <code>valueSelectionStrategy</code> selected when the slot type was
1612
- * created or updated. If <code>valueSelectionStrategy</code> is set to
1613
- * <code>ORIGINAL_VALUE</code>, the value provided by the user is returned,
1614
- * if the user value is similar to the slot values. If
1615
- * <code>valueSelectionStrategy</code> is set to
1616
- * <code>TOP_RESOLUTION</code> Amazon Lex returns the first value in the
1617
- * resolution list or, if there is no resolution list, null. If you don't
1618
- * specify a <code>valueSelectionStrategy</code> the default is
1619
- * <code>ORIGINAL_VALUE</code>. </p>
1620
- */
1621
- slots?: __LazyJsonString | string;
1622
- /**
1623
- * <p>Map of key/value pairs representing session-specific context
1624
- * information.</p>
1625
- */
1626
- sessionAttributes?: __LazyJsonString | string;
1627
- /**
1628
- * @deprecated
1629
- *
1630
- * <p>The next message that should be presented to the user.</p>
1631
- * <p>You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419,
1632
- * es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the
1633
- * <code>message</code> field is null. You should use the
1634
- * <code>encodedMessage</code> field instead.</p>
1635
- */
1636
- message?: string;
1637
- /**
1638
- * <p>The next message that should be presented to the user.</p>
1639
- * <p>The <code>encodedMessage</code> field is base-64 encoded. You must
1640
- * decode the field before you can use the value.</p>
1641
- */
1642
- encodedMessage?: string;
1643
- /**
1644
- * <p>The format of the response message. One of the following
1645
- * values:</p>
1646
- * <ul>
1647
- * <li>
1648
- * <p>
1649
- * <code>PlainText</code> - The message contains plain UTF-8
1650
- * text.</p>
1651
- * </li>
1652
- * <li>
1653
- * <p>
1654
- * <code>CustomPayload</code> - The message is a custom format for
1655
- * the client.</p>
1656
- * </li>
1657
- * <li>
1658
- * <p>
1659
- * <code>SSML</code> - The message contains text formatted for voice
1660
- * output.</p>
1661
- * </li>
1662
- * <li>
1663
- * <p>
1664
- * <code>Composite</code> - The message contains an escaped JSON
1665
- * object containing one or more messages from the groups that messages
1666
- * were assigned to when the intent was created.</p>
1667
- * </li>
1668
- * </ul>
1669
- */
1670
- messageFormat?: MessageFormatType | string;
1671
- /**
1672
- * <p></p>
1673
- * <ul>
1674
- * <li>
1675
- * <p>
1676
- * <code>ConfirmIntent</code> - Amazon Lex is expecting a "yes" or "no"
1677
- * response to confirm the intent before fulfilling an intent.</p>
1678
- * </li>
1679
- * <li>
1680
- * <p>
1681
- * <code>ElicitIntent</code> - Amazon Lex wants to elicit the user's
1682
- * intent.</p>
1683
- * </li>
1684
- * <li>
1685
- * <p>
1686
- * <code>ElicitSlot</code> - Amazon Lex is expecting the value of a slot
1687
- * for the current intent.</p>
1688
- * </li>
1689
- * <li>
1690
- * <p>
1691
- * <code>Failed</code> - Conveys that the conversation with the user
1692
- * has failed. This can happen for various reasons, including the user
1693
- * does not provide an appropriate response to prompts from the service,
1694
- * or if the Lambda function fails to fulfill the intent.</p>
1695
- * </li>
1696
- * <li>
1697
- * <p>
1698
- * <code>Fulfilled</code> - Conveys that the Lambda function has
1699
- * sucessfully fulfilled the intent.</p>
1700
- * </li>
1701
- * <li>
1702
- * <p>
1703
- * <code>ReadyForFulfillment</code> - Conveys that the client has to
1704
- * fulfill the intent.</p>
1705
- * </li>
1706
- * </ul>
1707
- */
1708
- dialogState?: DialogState | string;
1709
- /**
1710
- * <p>If the <code>dialogState</code> is <code>ElicitSlot</code>, returns
1711
- * the name of the slot for which Amazon Lex is eliciting a value.</p>
1712
- */
1713
- slotToElicit?: string;
1714
- /**
1715
- * <p>The audio version of the message to convey to the user.</p>
1716
- */
1717
- audioStream?: Readable | ReadableStream | Blob;
1718
- /**
1719
- * <p>A unique identifier for the session.</p>
1720
- */
1721
- sessionId?: string;
1722
- /**
1723
- * <p>A list of active contexts for the session.</p>
1724
- */
1725
- activeContexts?: __LazyJsonString | string;
1726
- }
1727
- export declare namespace PutSessionResponse {
1728
- /**
1729
- * @internal
1730
- */
1731
- const filterSensitiveLog: (obj: PutSessionResponse) => any;
1732
- }
262
+