aws-sdk-lex 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b40f67e3e7dc928f8bd76d2a22ccfbe6aeaf76a
4
- data.tar.gz: de37a3d87e6bc40d090b4442a0d30f50e98f8040
3
+ metadata.gz: 50a0e82cab65f174d50dd6000044fb18d8038643
4
+ data.tar.gz: a45f8a25725cbd77238e3bdfacfc66b413ca1d14
5
5
  SHA512:
6
- metadata.gz: 4e1a1d4781b252e88c15a06c4955b09cfa959ccfab2a90346f2f6a281b5334c686c9cf627de340afda08fb0e4b7ae3c793feb7f6ea57a7c313d4709c907e14be
7
- data.tar.gz: 9beee9db72b27fe51cddbc88009b8c1560a4828bd05367aaf27d740dbcf759155985d26111954998ba13b4f0b4cfddee684f98388c35fdf04f0f78a52d28aa3d
6
+ metadata.gz: 29eda2c423a1e7bc1cfdc0e4dd9a426e25b746cc3740d3830f33d38e1755a2dcef9e9ea176defc50c4529276ec99bb3ca72270660ae5db1a25bcb9b4bb06f47e
7
+ data.tar.gz: c39d891496368bd7a2f89e140a2e42b990644e004329ea353faf08c83e5611694a818a3d4a9d119abb8f0f9709859781fac09f206ba263ad5a1b4578cd476137
@@ -42,6 +42,6 @@ require_relative 'aws-sdk-lex/customizations'
42
42
  # @service
43
43
  module Aws::Lex
44
44
 
45
- GEM_VERSION = '1.1.0'
45
+ GEM_VERSION = '1.2.0'
46
46
 
47
47
  end
@@ -146,8 +146,13 @@ module Aws::Lex
146
146
  # @!group API Operations
147
147
 
148
148
  # Sends user input (text or speech) to Amazon Lex. Clients use this API
149
- # to send requests to Amazon Lex at runtime. Amazon Lex interprets the
150
- # user input using the machine learning model that it built for the bot.
149
+ # to send text and audio requests to Amazon Lex at runtime. Amazon Lex
150
+ # interprets the user input using the machine learning model that it
151
+ # built for the bot.
152
+ #
153
+ # The `PostContent` operation supports audio input at 8kHz and 16kHz.
154
+ # You can use 8kHz audio to achieve higher speech recognition accuracy
155
+ # in telephone audio applications.
151
156
  #
152
157
  # In response, Amazon Lex returns the next message to convey to the
153
158
  # user. Consider the following example messages:
@@ -210,73 +215,63 @@ module Aws::Lex
210
215
  # Alias of the Amazon Lex bot.
211
216
  #
212
217
  # @option params [required, String] :user_id
213
- # ID of the client application user. Typically, each of your application
214
- # users should have a unique ID. The application developer decides the
215
- # user IDs. At runtime, each request must include the user ID. Note the
216
- # following considerations:
218
+ # The ID of the client application user. Amazon Lex uses this to
219
+ # identify a user's conversation with your bot. At runtime, each
220
+ # request must contain the `userID` field.
221
+ #
222
+ # To decide the user ID to use for your application, consider the
223
+ # following factors.
224
+ #
225
+ # * The `userID` field must not contain any personally identifiable
226
+ # information of the user, for example, name, personal identification
227
+ # numbers, or other end user personal information.
217
228
  #
218
- # * If you want a user to start conversation on one device and continue
219
- # the conversation on another device, you might choose a user-specific
220
- # identifier, such as the user's login, or Amazon Cognito user ID
221
- # (assuming your application is using Amazon Cognito).
229
+ # * If you want a user to start a conversation on one device and
230
+ # continue on another device, use a user-specific identifier.
222
231
  #
223
232
  # * If you want the same user to be able to have two independent
224
- # conversations on two different devices, you might choose
225
- # device-specific identifier, such as device ID, or some globally
226
- # unique identifier.
233
+ # conversations on two different devices, choose a device-specific
234
+ # identifier.
235
+ #
236
+ # * A user can't have two independent conversations with two different
237
+ # versions of the same bot. For example, a user can't have a
238
+ # conversation with the PROD and BETA versions of the same bot. If you
239
+ # anticipate that a user will need to have conversation with two
240
+ # different versions, for example, while testing, include the bot
241
+ # alias in the user ID to separate the two conversations.
227
242
  #
228
243
  # @option params [String] :session_attributes
229
- # You pass this value in the `x-amz-lex-session-attributes` HTTP header.
230
- # The value must be map (keys and values must be strings) that is JSON
231
- # serialized and then base64 encoded.
232
- #
233
- # A session represents dialog between a user and Amazon Lex. At runtime,
234
- # a client application can pass contextual information, in the request
235
- # to Amazon Lex. For example,
236
- #
237
- # * You might use session attributes to track the requestID of user
238
- # requests.
239
- #
240
- # * In Getting Started Exercise 1, the example bot uses the price
241
- # session attribute to maintain the price of flowers ordered (for
242
- # example, "price":25). The code hook (Lambda function) sets this
243
- # attribute based on the type of flowers ordered. For more
244
- # information, see [Review the Details of Information Flow][1].
245
- #
246
- # * In the BookTrip bot exercise, the bot uses the `currentReservation`
247
- # session attribute to maintains the slot data during the in-progress
248
- # conversation to book a hotel or book a car. For more information,
249
- # see [Details of Information Flow][2].
250
- #
251
- # Amazon Lex passes these session attributes to the Lambda functions
252
- # configured for the intent In the your Lambda function, you can use the
253
- # session attributes for initialization and customization (prompts).
254
- # Some examples are:
255
- #
256
- # * Initialization - In a pizza ordering bot, if you pass user location
257
- # (for example, `"Location : 111 Maple Street"`), then your Lambda
258
- # function might use this information to determine the closest
259
- # pizzeria to place the order (and perhaps set the storeAddress slot
260
- # value as well).
261
- #
262
- # Personalized prompts - For example, you can configure prompts to
263
- # refer to the user by name (for example, "Hey \[firstName\], what
264
- # toppings would you like?"). You can pass the user's name as a
265
- # session attribute ("firstName": "Joe") so that Amazon Lex can
266
- # substitute the placeholder to provide a personalized prompt to the
267
- # user ("Hey Joe, what toppings would you like?").
268
- #
269
- # <note markdown="1"> Amazon Lex does not persist session attributes.
270
- #
271
- # If you configured a code hook for the intent, Amazon Lex passes the
272
- # incoming session attributes to the Lambda function. The Lambda
273
- # function must return these session attributes if you want Amazon Lex
274
- # to return them to the client.
275
- #
276
- # If there is no code hook configured for the intent Amazon Lex simply
277
- # returns the session attributes to the client application.
278
- #
279
- # </note>
244
+ # You pass this value as the `x-amz-lex-session-attributes` HTTP header.
245
+ #
246
+ # Application-specific information passed between Amazon Lex and a
247
+ # client application. The value must be a JSON serialized and base64
248
+ # encoded map with string keys and values. The total size of the
249
+ # `sessionAttributes` and `requestAttributes` headers is limited to 12
250
+ # KB.
251
+ #
252
+ # For more information, see [Setting Session Attributes][1].
253
+ #
254
+ # **SDK automatically handles json encoding and base64 encoding for you
255
+ # when the required value (Hash, Array, etc.) is provided according to
256
+ # the description.**
257
+ #
258
+ #
259
+ #
260
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs
261
+ #
262
+ # @option params [String] :request_attributes
263
+ # You pass this value as the `x-amz-lex-request-attributes` HTTP header.
264
+ #
265
+ # Request-specific information passed between Amazon Lex and a client
266
+ # application. The value must be a JSON serialized and base64 encoded
267
+ # map with string keys and values. The total size of the
268
+ # `requestAttributes` and `sessionAttributes` headers is limited to 12
269
+ # KB.
270
+ #
271
+ # The namespace `x-amz-lex:` is reserved for special attributes. Don't
272
+ # create any request attributes with the prefix `x-amz-lex:`.
273
+ #
274
+ # For more information, see [Setting Request Attributes][1].
280
275
  #
281
276
  # **SDK automatically handles json encoding and base64 encoding for you
282
277
  # when the required value (Hash, Array, etc.) is provided according to
@@ -284,25 +279,27 @@ module Aws::Lex
284
279
  #
285
280
  #
286
281
  #
287
- # [1]: http://docs.aws.amazon.com/lex/latest/dg/gs-bp-details-after-lambda.html
288
- # [2]: http://docs.aws.amazon.com/lex/latest/dg/book-trip-detail-flow.html
282
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs
289
283
  #
290
284
  # @option params [required, String] :content_type
291
- # You pass this values as the `Content-Type` HTTP header.
285
+ # You pass this value as the `Content-Type` HTTP header.
292
286
  #
293
287
  # Indicates the audio format or text. The header value must start with
294
288
  # one of the following prefixes:
295
289
  #
296
- # * PCM format
290
+ # * PCM format, audio data must be in little-endian byte order.
297
291
  #
298
292
  # * audio/l16; rate=16000; channels=1
299
293
  #
300
294
  # * audio/x-l16; sample-rate=16000; channel-count=1
301
295
  #
296
+ # * audio/lpcm; sample-rate=8000; sample-size-bits=16;
297
+ # channel-count=1; is-big-endian=false
298
+ #
302
299
  # * Opus format
303
300
  #
304
- # * audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=1;
305
- # frame-size-milliseconds=1.1
301
+ # * audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000;
302
+ # frame-size-milliseconds=4
306
303
  #
307
304
  # ^
308
305
  #
@@ -343,6 +340,11 @@ module Aws::Lex
343
340
  # User input in PCM or Opus audio format or text format as described in
344
341
  # the `Content-Type` HTTP header.
345
342
  #
343
+ # You can stream audio data to Amazon Lex or you can create a local
344
+ # buffer that captures all of the audio data before sending. In general,
345
+ # you get better performance if you stream audio data rather than
346
+ # buffering the data locally.
347
+ #
346
348
  # @return [Types::PostContentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
347
349
  #
348
350
  # * {Types::PostContentResponse#content_type #content_type} => String
@@ -361,7 +363,8 @@ module Aws::Lex
361
363
  # bot_name: "BotName", # required
362
364
  # bot_alias: "BotAlias", # required
363
365
  # user_id: "UserId", # required
364
- # session_attributes: "String",
366
+ # session_attributes: "AttributesString",
367
+ # request_attributes: "AttributesString",
365
368
  # content_type: "HttpContentType", # required
366
369
  # accept: "Accept",
367
370
  # input_stream: "data", # required
@@ -453,75 +456,53 @@ module Aws::Lex
453
456
  # The alias of the Amazon Lex bot.
454
457
  #
455
458
  # @option params [required, String] :user_id
456
- # The ID of the client application user. The application developer
457
- # decides the user IDs. At runtime, each request must include the user
458
- # ID. Typically, each of your application users should have a unique ID.
459
- # Note the following considerations:
459
+ # The ID of the client application user. Amazon Lex uses this to
460
+ # identify a user's conversation with your bot. At runtime, each
461
+ # request must contain the `userID` field.
460
462
  #
461
- # * If you want a user to start a conversation on one device and
462
- # continue the conversation on another device, you might choose a
463
- # user-specific identifier, such as a login or Amazon Cognito user ID
464
- # (assuming your application is using Amazon Cognito).
463
+ # To decide the user ID to use for your application, consider the
464
+ # following factors.
465
465
  #
466
- # * If you want the same user to be able to have two independent
467
- # conversations on two different devices, you might choose a
468
- # device-specific identifier, such as device ID, or some globally
469
- # unique identifier.
466
+ # * The `userID` field must not contain any personally identifiable
467
+ # information of the user, for example, name, personal identification
468
+ # numbers, or other end user personal information.
470
469
  #
471
- # @option params [Hash<String,String>] :session_attributes
472
- # By using session attributes, a client application can pass contextual
473
- # information in the request to Amazon Lex For example,
474
- #
475
- # * In Getting Started Exercise 1, the example bot uses the `price`
476
- # session attribute to maintain the price of the flowers ordered (for
477
- # example, "Price":25). The code hook (the Lambda function) sets
478
- # this attribute based on the type of flowers ordered. For more
479
- # information, see [Review the Details of Information Flow][1].
470
+ # * If you want a user to start a conversation on one device and
471
+ # continue on another device, use a user-specific identifier.
480
472
  #
481
- # * In the BookTrip bot exercise, the bot uses the `currentReservation`
482
- # session attribute to maintain slot data during the in-progress
483
- # conversation to book a hotel or book a car. For more information,
484
- # see [Details of Information Flow][2].
473
+ # * If you want the same user to be able to have two independent
474
+ # conversations on two different devices, choose a device-specific
475
+ # identifier.
485
476
  #
486
- # * You might use the session attributes (key, value pairs) to track the
487
- # requestID of user requests.
477
+ # * A user can't have two independent conversations with two different
478
+ # versions of the same bot. For example, a user can't have a
479
+ # conversation with the PROD and BETA versions of the same bot. If you
480
+ # anticipate that a user will need to have conversation with two
481
+ # different versions, for example, while testing, include the bot
482
+ # alias in the user ID to separate the two conversations.
488
483
  #
489
- # Amazon Lex simply passes these session attributes to the Lambda
490
- # functions configured for the intent.
484
+ # @option params [Hash<String,String>] :session_attributes
485
+ # Application-specific information passed between Amazon Lex and a
486
+ # client application.
491
487
  #
492
- # In your Lambda function, you can also use the session attributes for
493
- # initialization and customization (prompts and response cards). Some
494
- # examples are:
488
+ # For more information, see [Setting Session Attributes][1].
495
489
  #
496
- # * Initialization - In a pizza ordering bot, if you can pass the user
497
- # location as a session attribute (for example, `"Location" : "111
498
- # Maple street"`), then your Lambda function might use this
499
- # information to determine the closest pizzeria to place the order
500
- # (perhaps to set the storeAddress slot value).
501
490
  #
502
- # * Personalize prompts - For example, you can configure prompts to
503
- # refer to the user name. (For example, "Hey \[FirstName\], what
504
- # toppings would you like?"). You can pass the user name as a session
505
- # attribute (`"FirstName" : "Joe"`) so that Amazon Lex can substitute
506
- # the placeholder to provide a personalize prompt to the user ("Hey
507
- # Joe, what toppings would you like?").
508
491
  #
509
- # <note markdown="1"> Amazon Lex does not persist session attributes.
492
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs
510
493
  #
511
- # If you configure a code hook for the intent, Amazon Lex passes the
512
- # incoming session attributes to the Lambda function. If you want Amazon
513
- # Lex to return these session attributes back to the client, the Lambda
514
- # function must return them.
494
+ # @option params [Hash<String,String>] :request_attributes
495
+ # Request-specific information passed between Amazon Lex and a client
496
+ # application.
515
497
  #
516
- # If there is no code hook configured for the intent, Amazon Lex simply
517
- # returns the session attributes back to the client application.
498
+ # The namespace `x-amz-lex:` is reserved for special attributes. Don't
499
+ # create any request attributes with the prefix `x-amz-lex:`.
518
500
  #
519
- # </note>
501
+ # For more information, see [Setting Request Attributes][1].
520
502
  #
521
503
  #
522
504
  #
523
- # [1]: http://docs.aws.amazon.com/lex/latest/dg/gs-bp-details-after-lambda.html
524
- # [2]: http://docs.aws.amazon.com/lex/latest/dg/book-trip-detail-flow.html
505
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs
525
506
  #
526
507
  # @option params [required, String] :input_text
527
508
  # The text that the user entered (Amazon Lex interprets this text).
@@ -545,6 +526,9 @@ module Aws::Lex
545
526
  # session_attributes: {
546
527
  # "String" => "String",
547
528
  # },
529
+ # request_attributes: {
530
+ # "String" => "String",
531
+ # },
548
532
  # input_text: "Text", # required
549
533
  # })
550
534
  #
@@ -591,7 +575,7 @@ module Aws::Lex
591
575
  params: params,
592
576
  config: config)
593
577
  context[:gem_name] = 'aws-sdk-lex'
594
- context[:gem_version] = '1.1.0'
578
+ context[:gem_version] = '1.2.0'
595
579
  Seahorse::Client::Request.new(handlers, context)
596
580
  end
597
581
 
@@ -12,6 +12,7 @@ module Aws::Lex
12
12
  include Seahorse::Model
13
13
 
14
14
  Accept = Shapes::StringShape.new(name: 'Accept')
15
+ AttributesString = Shapes::StringShape.new(name: 'AttributesString')
15
16
  BadGatewayException = Shapes::StructureShape.new(name: 'BadGatewayException')
16
17
  BadRequestException = Shapes::StructureShape.new(name: 'BadRequestException')
17
18
  BlobStream = Shapes::BlobShape.new(name: 'BlobStream')
@@ -63,7 +64,8 @@ module Aws::Lex
63
64
  PostContentRequest.add_member(:bot_name, Shapes::ShapeRef.new(shape: BotName, required: true, location: "uri", location_name: "botName"))
64
65
  PostContentRequest.add_member(:bot_alias, Shapes::ShapeRef.new(shape: BotAlias, required: true, location: "uri", location_name: "botAlias"))
65
66
  PostContentRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "userId"))
66
- PostContentRequest.add_member(:session_attributes, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "x-amz-lex-session-attributes", metadata: {"jsonvalue"=>true}))
67
+ PostContentRequest.add_member(:session_attributes, Shapes::ShapeRef.new(shape: AttributesString, location: "header", location_name: "x-amz-lex-session-attributes", metadata: {"jsonvalue"=>true}))
68
+ PostContentRequest.add_member(:request_attributes, Shapes::ShapeRef.new(shape: AttributesString, location: "header", location_name: "x-amz-lex-request-attributes", metadata: {"jsonvalue"=>true}))
67
69
  PostContentRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: HttpContentType, required: true, location: "header", location_name: "Content-Type"))
68
70
  PostContentRequest.add_member(:accept, Shapes::ShapeRef.new(shape: Accept, location: "header", location_name: "Accept"))
69
71
  PostContentRequest.add_member(:input_stream, Shapes::ShapeRef.new(shape: BlobStream, required: true, location_name: "inputStream"))
@@ -88,6 +90,7 @@ module Aws::Lex
88
90
  PostTextRequest.add_member(:bot_alias, Shapes::ShapeRef.new(shape: BotAlias, required: true, location: "uri", location_name: "botAlias"))
89
91
  PostTextRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "userId"))
90
92
  PostTextRequest.add_member(:session_attributes, Shapes::ShapeRef.new(shape: StringMap, location_name: "sessionAttributes"))
93
+ PostTextRequest.add_member(:request_attributes, Shapes::ShapeRef.new(shape: StringMap, location_name: "requestAttributes"))
91
94
  PostTextRequest.add_member(:input_text, Shapes::ShapeRef.new(shape: Text, required: true, location_name: "inputText"))
92
95
  PostTextRequest.struct_class = Types::PostTextRequest
93
96
 
@@ -70,7 +70,8 @@ module Aws::Lex
70
70
  # bot_name: "BotName", # required
71
71
  # bot_alias: "BotAlias", # required
72
72
  # user_id: "UserId", # required
73
- # session_attributes: "String",
73
+ # session_attributes: "AttributesString",
74
+ # request_attributes: "AttributesString",
74
75
  # content_type: "HttpContentType", # required
75
76
  # accept: "Accept",
76
77
  # input_stream: "data", # required
@@ -85,98 +86,88 @@ module Aws::Lex
85
86
  # @return [String]
86
87
  #
87
88
  # @!attribute [rw] user_id
88
- # ID of the client application user. Typically, each of your
89
- # application users should have a unique ID. The application developer
90
- # decides the user IDs. At runtime, each request must include the user
91
- # ID. Note the following considerations:
89
+ # The ID of the client application user. Amazon Lex uses this to
90
+ # identify a user's conversation with your bot. At runtime, each
91
+ # request must contain the `userID` field.
92
92
  #
93
- # * If you want a user to start conversation on one device and
94
- # continue the conversation on another device, you might choose a
95
- # user-specific identifier, such as the user's login, or Amazon
96
- # Cognito user ID (assuming your application is using Amazon
97
- # Cognito).
93
+ # To decide the user ID to use for your application, consider the
94
+ # following factors.
95
+ #
96
+ # * The `userID` field must not contain any personally identifiable
97
+ # information of the user, for example, name, personal
98
+ # identification numbers, or other end user personal information.
99
+ #
100
+ # * If you want a user to start a conversation on one device and
101
+ # continue on another device, use a user-specific identifier.
98
102
  #
99
103
  # * If you want the same user to be able to have two independent
100
- # conversations on two different devices, you might choose
101
- # device-specific identifier, such as device ID, or some globally
102
- # unique identifier.
104
+ # conversations on two different devices, choose a device-specific
105
+ # identifier.
106
+ #
107
+ # * A user can't have two independent conversations with two
108
+ # different versions of the same bot. For example, a user can't
109
+ # have a conversation with the PROD and BETA versions of the same
110
+ # bot. If you anticipate that a user will need to have conversation
111
+ # with two different versions, for example, while testing, include
112
+ # the bot alias in the user ID to separate the two conversations.
103
113
  # @return [String]
104
114
  #
105
115
  # @!attribute [rw] session_attributes
106
- # You pass this value in the `x-amz-lex-session-attributes` HTTP
107
- # header. The value must be map (keys and values must be strings) that
108
- # is JSON serialized and then base64 encoded.
116
+ # You pass this value as the `x-amz-lex-session-attributes` HTTP
117
+ # header.
109
118
  #
110
- # A session represents dialog between a user and Amazon Lex. At
111
- # runtime, a client application can pass contextual information, in
112
- # the request to Amazon Lex. For example,
119
+ # Application-specific information passed between Amazon Lex and a
120
+ # client application. The value must be a JSON serialized and base64
121
+ # encoded map with string keys and values. The total size of the
122
+ # `sessionAttributes` and `requestAttributes` headers is limited to 12
123
+ # KB.
113
124
  #
114
- # * You might use session attributes to track the requestID of user
115
- # requests.
125
+ # For more information, see [Setting Session Attributes][1].
116
126
  #
117
- # * In Getting Started Exercise 1, the example bot uses the price
118
- # session attribute to maintain the price of flowers ordered (for
119
- # example, "price":25). The code hook (Lambda function) sets this
120
- # attribute based on the type of flowers ordered. For more
121
- # information, see [Review the Details of Information Flow][1].
122
127
  #
123
- # * In the BookTrip bot exercise, the bot uses the
124
- # `currentReservation` session attribute to maintains the slot data
125
- # during the in-progress conversation to book a hotel or book a car.
126
- # For more information, see [Details of Information Flow][2].
127
128
  #
128
- # Amazon Lex passes these session attributes to the Lambda functions
129
- # configured for the intent In the your Lambda function, you can use
130
- # the session attributes for initialization and customization
131
- # (prompts). Some examples are:
132
- #
133
- # * Initialization - In a pizza ordering bot, if you pass user
134
- # location (for example, `"Location : 111 Maple Street"`), then your
135
- # Lambda function might use this information to determine the
136
- # closest pizzeria to place the order (and perhaps set the
137
- # storeAddress slot value as well).
138
- #
139
- # Personalized prompts - For example, you can configure prompts to
140
- # refer to the user by name (for example, "Hey \[firstName\], what
141
- # toppings would you like?"). You can pass the user's name as a
142
- # session attribute ("firstName": "Joe") so that Amazon Lex can
143
- # substitute the placeholder to provide a personalized prompt to the
144
- # user ("Hey Joe, what toppings would you like?").
129
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs
130
+ # @return [String]
145
131
  #
146
- # <note markdown="1"> Amazon Lex does not persist session attributes.
132
+ # @!attribute [rw] request_attributes
133
+ # You pass this value as the `x-amz-lex-request-attributes` HTTP
134
+ # header.
147
135
  #
148
- # If you configured a code hook for the intent, Amazon Lex passes the
149
- # incoming session attributes to the Lambda function. The Lambda
150
- # function must return these session attributes if you want Amazon Lex
151
- # to return them to the client.
136
+ # Request-specific information passed between Amazon Lex and a client
137
+ # application. The value must be a JSON serialized and base64 encoded
138
+ # map with string keys and values. The total size of the
139
+ # `requestAttributes` and `sessionAttributes` headers is limited to 12
140
+ # KB.
152
141
  #
153
- # If there is no code hook configured for the intent Amazon Lex simply
154
- # returns the session attributes to the client application.
142
+ # The namespace `x-amz-lex:` is reserved for special attributes.
143
+ # Don't create any request attributes with the prefix `x-amz-lex:`.
155
144
  #
156
- # </note>
145
+ # For more information, see [Setting Request Attributes][1].
157
146
  #
158
147
  #
159
148
  #
160
- # [1]: http://docs.aws.amazon.com/lex/latest/dg/gs-bp-details-after-lambda.html
161
- # [2]: http://docs.aws.amazon.com/lex/latest/dg/book-trip-detail-flow.html
149
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs
162
150
  # @return [String]
163
151
  #
164
152
  # @!attribute [rw] content_type
165
- # You pass this values as the `Content-Type` HTTP header.
153
+ # You pass this value as the `Content-Type` HTTP header.
166
154
  #
167
155
  # Indicates the audio format or text. The header value must start with
168
156
  # one of the following prefixes:
169
157
  #
170
- # * PCM format
158
+ # * PCM format, audio data must be in little-endian byte order.
171
159
  #
172
160
  # * audio/l16; rate=16000; channels=1
173
161
  #
174
162
  # * audio/x-l16; sample-rate=16000; channel-count=1
175
163
  #
164
+ # * audio/lpcm; sample-rate=8000; sample-size-bits=16;
165
+ # channel-count=1; is-big-endian=false
166
+ #
176
167
  # * Opus format
177
168
  #
178
- # * audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=1;
179
- # frame-size-milliseconds=1.1
169
+ # * audio/x-cbr-opus-with-preamble; preamble-size=0;
170
+ # bit-rate=256000; frame-size-milliseconds=4
180
171
  #
181
172
  # ^
182
173
  #
@@ -218,6 +209,11 @@ module Aws::Lex
218
209
  # @!attribute [rw] input_stream
219
210
  # User input in PCM or Opus audio format or text format as described
220
211
  # in the `Content-Type` HTTP header.
212
+ #
213
+ # You can stream audio data to Amazon Lex or you can create a local
214
+ # buffer that captures all of the audio data before sending. In
215
+ # general, you get better performance if you stream audio data rather
216
+ # than buffering the data locally.
221
217
  # @return [IO]
222
218
  #
223
219
  # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostContentRequest AWS API Documentation
@@ -227,6 +223,7 @@ module Aws::Lex
227
223
  :bot_alias,
228
224
  :user_id,
229
225
  :session_attributes,
226
+ :request_attributes,
230
227
  :content_type,
231
228
  :accept,
232
229
  :input_stream)
@@ -245,6 +242,17 @@ module Aws::Lex
245
242
  # @!attribute [rw] slots
246
243
  # Map of zero or more intent slots (name/value pairs) Amazon Lex
247
244
  # detected from the user input during the conversation.
245
+ #
246
+ # Amazon Lex creates a resolution list containing likely values for a
247
+ # slot. The value that it returns is determined by the
248
+ # `valueSelectionStrategy` selected when the slot type was created or
249
+ # updated. If `valueSelectionStrategy` is set to `ORIGINAL_VALUE`, the
250
+ # value provided by the user is returned, if the user value is similar
251
+ # to the slot values. If `valueSelectionStrategy` is set to
252
+ # `TOP_RESOLUTION` Amazon Lex returns the first value in the
253
+ # resolution list or, if there is no resolution list, null. If you
254
+ # don't specify a `valueSelectionStrategy`, the default is
255
+ # `ORIGINAL_VALUE`.
248
256
  # @return [String]
249
257
  #
250
258
  # @!attribute [rw] session_attributes
@@ -273,14 +281,14 @@ module Aws::Lex
273
281
  # returns one of the following values as `dialogState`. The client can
274
282
  # optionally use this information to customize the user interface.
275
283
  #
276
- # * `ElicitIntent` Amazon Lex wants to elicit the user's intent.
284
+ # * `ElicitIntent` - Amazon Lex wants to elicit the user's intent.
277
285
  # Consider the following examples:
278
286
  #
279
287
  # For example, a user might utter an intent ("I want to order a
280
288
  # pizza"). If Amazon Lex cannot infer the user intent from this
281
289
  # utterance, it will return this dialog state.
282
290
  #
283
- # * `ConfirmIntent` Amazon Lex is expecting a "yes" or "no"
291
+ # * `ConfirmIntent` - Amazon Lex is expecting a "yes" or "no"
284
292
  # response.
285
293
  #
286
294
  # For example, Amazon Lex wants user confirmation before fulfilling
@@ -291,7 +299,7 @@ module Aws::Lex
291
299
  # examples, update the crust type slot or change the intent from
292
300
  # OrderPizza to OrderDrink).
293
301
  #
294
- # * `ElicitSlot` Amazon Lex is expecting the value of a slot for the
302
+ # * `ElicitSlot` - Amazon Lex is expecting the value of a slot for the
295
303
  # current intent.
296
304
  #
297
305
  # For example, suppose that in the response Amazon Lex sends this
@@ -301,13 +309,13 @@ module Aws::Lex
301
309
  # thick crust pizza"). Amazon Lex can process such additional
302
310
  # information appropriately.
303
311
  #
304
- # * `Fulfilled` Conveys that the Lambda function has successfully
312
+ # * `Fulfilled` - Conveys that the Lambda function has successfully
305
313
  # fulfilled the intent.
306
314
  #
307
- # * `ReadyForFulfillment` Conveys that the client has to fullfill
308
- # the request.
315
+ # * `ReadyForFulfillment` - Conveys that the client has to fulfill the
316
+ # request.
309
317
  #
310
- # * `Failed` Conveys that the conversation with the user failed.
318
+ # * `Failed` - Conveys that the conversation with the user failed.
311
319
  #
312
320
  # This can happen for various reasons, including that the user does
313
321
  # not provide an appropriate response to prompts from the service
@@ -322,7 +330,13 @@ module Aws::Lex
322
330
  # @return [String]
323
331
  #
324
332
  # @!attribute [rw] input_transcript
325
- # Transcript of the voice input to the operation.
333
+ # The text used to process the request.
334
+ #
335
+ # If the input was an audio stream, the `inputTranscript` field
336
+ # contains the text extracted from the audio stream. This is the text
337
+ # that is actually processed to recognize intents and slot values. You
338
+ # can use this information to determine if Amazon Lex is correctly
339
+ # processing the audio that you send.
326
340
  # @return [String]
327
341
  #
328
342
  # @!attribute [rw] audio_stream
@@ -361,6 +375,9 @@ module Aws::Lex
361
375
  # session_attributes: {
362
376
  # "String" => "String",
363
377
  # },
378
+ # request_attributes: {
379
+ # "String" => "String",
380
+ # },
364
381
  # input_text: "Text", # required
365
382
  # }
366
383
  #
@@ -373,77 +390,55 @@ module Aws::Lex
373
390
  # @return [String]
374
391
  #
375
392
  # @!attribute [rw] user_id
376
- # The ID of the client application user. The application developer
377
- # decides the user IDs. At runtime, each request must include the user
378
- # ID. Typically, each of your application users should have a unique
379
- # ID. Note the following considerations:
393
+ # The ID of the client application user. Amazon Lex uses this to
394
+ # identify a user's conversation with your bot. At runtime, each
395
+ # request must contain the `userID` field.
396
+ #
397
+ # To decide the user ID to use for your application, consider the
398
+ # following factors.
399
+ #
400
+ # * The `userID` field must not contain any personally identifiable
401
+ # information of the user, for example, name, personal
402
+ # identification numbers, or other end user personal information.
380
403
  #
381
404
  # * If you want a user to start a conversation on one device and
382
- # continue the conversation on another device, you might choose a
383
- # user-specific identifier, such as a login or Amazon Cognito user
384
- # ID (assuming your application is using Amazon Cognito).
405
+ # continue on another device, use a user-specific identifier.
385
406
  #
386
407
  # * If you want the same user to be able to have two independent
387
- # conversations on two different devices, you might choose a
388
- # device-specific identifier, such as device ID, or some globally
389
- # unique identifier.
408
+ # conversations on two different devices, choose a device-specific
409
+ # identifier.
410
+ #
411
+ # * A user can't have two independent conversations with two
412
+ # different versions of the same bot. For example, a user can't
413
+ # have a conversation with the PROD and BETA versions of the same
414
+ # bot. If you anticipate that a user will need to have conversation
415
+ # with two different versions, for example, while testing, include
416
+ # the bot alias in the user ID to separate the two conversations.
390
417
  # @return [String]
391
418
  #
392
419
  # @!attribute [rw] session_attributes
393
- # By using session attributes, a client application can pass
394
- # contextual information in the request to Amazon Lex For example,
395
- #
396
- # * In Getting Started Exercise 1, the example bot uses the `price`
397
- # session attribute to maintain the price of the flowers ordered
398
- # (for example, "Price":25). The code hook (the Lambda function)
399
- # sets this attribute based on the type of flowers ordered. For more
400
- # information, see [Review the Details of Information Flow][1].
401
- #
402
- # * In the BookTrip bot exercise, the bot uses the
403
- # `currentReservation` session attribute to maintain slot data
404
- # during the in-progress conversation to book a hotel or book a car.
405
- # For more information, see [Details of Information Flow][2].
406
- #
407
- # * You might use the session attributes (key, value pairs) to track
408
- # the requestID of user requests.
409
- #
410
- # Amazon Lex simply passes these session attributes to the Lambda
411
- # functions configured for the intent.
412
- #
413
- # In your Lambda function, you can also use the session attributes for
414
- # initialization and customization (prompts and response cards). Some
415
- # examples are:
416
- #
417
- # * Initialization - In a pizza ordering bot, if you can pass the user
418
- # location as a session attribute (for example, `"Location" : "111
419
- # Maple street"`), then your Lambda function might use this
420
- # information to determine the closest pizzeria to place the order
421
- # (perhaps to set the storeAddress slot value).
422
- #
423
- # * Personalize prompts - For example, you can configure prompts to
424
- # refer to the user name. (For example, "Hey \[FirstName\], what
425
- # toppings would you like?"). You can pass the user name as a
426
- # session attribute (`"FirstName" : "Joe"`) so that Amazon Lex can
427
- # substitute the placeholder to provide a personalize prompt to the
428
- # user ("Hey Joe, what toppings would you like?").
429
- #
430
- # <note markdown="1"> Amazon Lex does not persist session attributes.
431
- #
432
- # If you configure a code hook for the intent, Amazon Lex passes the
433
- # incoming session attributes to the Lambda function. If you want
434
- # Amazon Lex to return these session attributes back to the client,
435
- # the Lambda function must return them.
436
- #
437
- # If there is no code hook configured for the intent, Amazon Lex
438
- # simply returns the session attributes back to the client
420
+ # Application-specific information passed between Amazon Lex and a
421
+ # client application.
422
+ #
423
+ # For more information, see [Setting Session Attributes][1].
424
+ #
425
+ #
426
+ #
427
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs
428
+ # @return [Hash<String,String>]
429
+ #
430
+ # @!attribute [rw] request_attributes
431
+ # Request-specific information passed between Amazon Lex and a client
439
432
  # application.
440
433
  #
441
- # </note>
434
+ # The namespace `x-amz-lex:` is reserved for special attributes.
435
+ # Don't create any request attributes with the prefix `x-amz-lex:`.
436
+ #
437
+ # For more information, see [Setting Request Attributes][1].
442
438
  #
443
439
  #
444
440
  #
445
- # [1]: http://docs.aws.amazon.com/lex/latest/dg/gs-bp-details-after-lambda.html
446
- # [2]: http://docs.aws.amazon.com/lex/latest/dg/book-trip-detail-flow.html
441
+ # [1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs
447
442
  # @return [Hash<String,String>]
448
443
  #
449
444
  # @!attribute [rw] input_text
@@ -457,6 +452,7 @@ module Aws::Lex
457
452
  :bot_alias,
458
453
  :user_id,
459
454
  :session_attributes,
455
+ :request_attributes,
460
456
  :input_text)
461
457
  include Aws::Structure
462
458
  end
@@ -466,8 +462,19 @@ module Aws::Lex
466
462
  # @return [String]
467
463
  #
468
464
  # @!attribute [rw] slots
469
- # The intent slots (name/value pairs) that Amazon Lex detected so far
470
- # from the user input in the conversation.
465
+ # The intent slots that Amazon Lex detected from the user input in the
466
+ # conversation.
467
+ #
468
+ # Amazon Lex creates a resolution list containing likely values for a
469
+ # slot. The value that it returns is determined by the
470
+ # `valueSelectionStrategy` selected when the slot type was created or
471
+ # updated. If `valueSelectionStrategy` is set to `ORIGINAL_VALUE`, the
472
+ # value provided by the user is returned, if the user value is similar
473
+ # to the slot values. If `valueSelectionStrategy` is set to
474
+ # `TOP_RESOLUTION` Amazon Lex returns the first value in the
475
+ # resolution list or, if there is no resolution list, null. If you
476
+ # don't specify a `valueSelectionStrategy`, the default is
477
+ # `ORIGINAL_VALUE`.
471
478
  # @return [Hash<String,String>]
472
479
  #
473
480
  # @!attribute [rw] session_attributes
@@ -496,13 +503,13 @@ module Aws::Lex
496
503
  # returns one of the following values as `dialogState`. The client can
497
504
  # optionally use this information to customize the user interface.
498
505
  #
499
- # * `ElicitIntent` Amazon Lex wants to elicit user intent.
506
+ # * `ElicitIntent` - Amazon Lex wants to elicit user intent.
500
507
  #
501
508
  # For example, a user might utter an intent ("I want to order a
502
509
  # pizza"). If Amazon Lex cannot infer the user intent from this
503
510
  # utterance, it will return this dialogState.
504
511
  #
505
- # * `ConfirmIntent` Amazon Lex is expecting a "yes" or "no"
512
+ # * `ConfirmIntent` - Amazon Lex is expecting a "yes" or "no"
506
513
  # response.
507
514
  #
508
515
  # For example, Amazon Lex wants user confirmation before fulfilling
@@ -515,7 +522,7 @@ module Aws::Lex
515
522
  # crust type slot value, or change intent from OrderPizza to
516
523
  # OrderDrink).
517
524
  #
518
- # * `ElicitSlot` Amazon Lex is expecting a slot value for the
525
+ # * `ElicitSlot` - Amazon Lex is expecting a slot value for the
519
526
  # current intent.
520
527
  #
521
528
  # For example, suppose that in the response Amazon Lex sends this
@@ -525,13 +532,13 @@ module Aws::Lex
525
532
  # thick crust pizza"). Amazon Lex can process such additional
526
533
  # information appropriately.
527
534
  #
528
- # * `Fulfilled` Conveys that the Lambda function configured for the
535
+ # * `Fulfilled` - Conveys that the Lambda function configured for the
529
536
  # intent has successfully fulfilled the intent.
530
537
  #
531
- # * `ReadyForFulfillment` Conveys that the client has to fulfill the
538
+ # * `ReadyForFulfillment` - Conveys that the client has to fulfill the
532
539
  # intent.
533
540
  #
534
- # * `Failed` Conveys that the conversation with the user failed.
541
+ # * `Failed` - Conveys that the conversation with the user failed.
535
542
  #
536
543
  # This can happen for various reasons including that the user did
537
544
  # not provide an appropriate response to prompts from the service
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-lex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-01 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core