aws-sdk-lexruntimev2 1.0.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.
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+
12
+ # When LexRuntimeV2 returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::LexRuntimeV2::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all LexRuntimeV2 errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::LexRuntimeV2::Errors::ServiceError
20
+ # # rescues all LexRuntimeV2 API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ #
31
+ # Additionally, error classes are dynamically generated for service errors based on the error code
32
+ # if they are not defined above.
33
+ module Errors
34
+
35
+ extend Aws::Errors::DynamicErrors
36
+
37
+ end
38
+ end
@@ -0,0 +1,266 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+ module EventStreams
12
+ class StartConversationRequestEventStream
13
+
14
+ def initialize
15
+ @event_emitter = Aws::EventEmitter.new
16
+ end
17
+
18
+ # @option params [Hash&lt;String,String&gt;] :request_attributes
19
+ # Request-specific information passed between the client application and
20
+ # Amazon Lex.
21
+ #
22
+ # The namespace `x-amz-lex:` is reserved for special attributes. Don&#39;t
23
+ # create any request attributes for prefix `x-amz-lex:`.
24
+ #
25
+ # @option params [String] :response_content_type
26
+ # The message that Amazon Lex returns in the response can be either text
27
+ # or speech based on the `responseContentType` value.
28
+ #
29
+ # * If the value is `text/plain;charset=utf-8`, Amazon Lex returns text
30
+ # in the response.
31
+ #
32
+ # * If the value begins with `audio/`, Amazon Lex returns speech in the
33
+ # response. Amazon Lex uses Amazon Polly to generate the speech using
34
+ # the configuration that you specified in the `requestContentType`
35
+ # parameter. For example, if you specify `audio/mpeg` as the value,
36
+ # Amazon Lex returns speech in the MPEG format.
37
+ #
38
+ # * If the value is `audio/pcm`, the speech returned is audio/pcm in
39
+ # 16-bit, little-endian format.
40
+ #
41
+ # * The following are the accepted values:
42
+ #
43
+ # * audio/mpeg
44
+ #
45
+ # * audio/ogg
46
+ #
47
+ # * audio/pcm
48
+ #
49
+ # * audio/* (defaults to mpeg)
50
+ #
51
+ # * text/plain; charset=utf-8
52
+ #
53
+ # @option params [Types::SessionState] :session_state
54
+ # The state of the user&#39;s session with Amazon Lex.
55
+ #
56
+ # @option params [Array&lt;Types::Message&gt;] :welcome_messages
57
+ # A list of messages to send to the user.
58
+ #
59
+ # @option params [Boolean] :disable_playback
60
+ # Determines whether Amazon Lex should send audio responses to the
61
+ # client application. When this parameter if `false`, the client
62
+ # application needs to create responses for the user.
63
+ #
64
+ # @option params [String] :event_id
65
+ # A unique identifier that your application assigns to the event. You
66
+ # can use this to identify events in logs.
67
+ #
68
+ # @option params [Integer] :client_timestamp_millis
69
+ # A timestamp set by the client of the date and time that the event was
70
+ # sent to Amazon Lex.
71
+ #
72
+ def signal_configuration_event_event(params = {})
73
+ @event_emitter.emit(:configuration_event, params)
74
+ end
75
+
76
+ # @option params [String, StringIO, File] :audio_chunk
77
+ # An encoded stream of audio.
78
+ #
79
+ # @option params [String] :content_type
80
+ # The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit
81
+ # mono-channel little-endian format. The value of the field should be:
82
+ #
83
+ # `audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1;
84
+ # is-big-endian=false`
85
+ #
86
+ # @option params [String] :event_id
87
+ # A unique identifier that your application assigns to the event. You
88
+ # can use this to identify events in logs.
89
+ #
90
+ # @option params [Integer] :client_timestamp_millis
91
+ # A timestamp set by the client of the date and time that the event was
92
+ # sent to Amazon Lex.
93
+ #
94
+ def signal_audio_input_event_event(params = {})
95
+ @event_emitter.emit(:audio_input_event, params)
96
+ end
97
+
98
+ # @option params [String] :input_character
99
+ # The DTMF character that the user pressed. The allowed characters are A
100
+ # - D, 0 - 9, # and *.
101
+ #
102
+ # @option params [String] :event_id
103
+ # A unique identifier that your application assigns to the event. You
104
+ # can use this to identify events in logs.
105
+ #
106
+ # @option params [Integer] :client_timestamp_millis
107
+ # A timestamp set by the client of the date and time that the event was
108
+ # sent to Amazon Lex.
109
+ #
110
+ def signal_dtmf_input_event_event(params = {})
111
+ @event_emitter.emit(:dtmf_input_event, params)
112
+ end
113
+
114
+ # @option params [String] :text
115
+ # The text from the user. Amazon Lex processes this as a complete
116
+ # statement.
117
+ #
118
+ # @option params [String] :event_id
119
+ # A unique identifier that your application assigns to the event. You
120
+ # can use this to identify events in logs.
121
+ #
122
+ # @option params [Integer] :client_timestamp_millis
123
+ # A timestamp set by the client of the date and time that the event was
124
+ # sent to Amazon Lex.
125
+ #
126
+ def signal_text_input_event_event(params = {})
127
+ @event_emitter.emit(:text_input_event, params)
128
+ end
129
+
130
+ # @option params [String] :event_id
131
+ # A unique identifier that your application assigns to the event. You
132
+ # can use this to identify events in logs.
133
+ #
134
+ # @option params [Integer] :client_timestamp_millis
135
+ # A timestamp set by the client of the date and time that the event was
136
+ # sent to Amazon Lex.
137
+ #
138
+ def signal_playback_completion_event_event(params = {})
139
+ @event_emitter.emit(:playback_completion_event, params)
140
+ end
141
+
142
+ # @option params [String] :event_id
143
+ # A unique identifier that your application assigns to the event. You
144
+ # can use this to identify events in logs.
145
+ #
146
+ # @option params [Integer] :client_timestamp_millis
147
+ # A timestamp set by the client of the date and time that the event was
148
+ # sent to Amazon Lex.
149
+ #
150
+ def signal_disconnection_event_event(params = {})
151
+ @event_emitter.emit(:disconnection_event, params)
152
+ end
153
+
154
+ def signal_end_stream
155
+ @event_emitter.emit(:end_stream, {})
156
+ end
157
+
158
+ # @api private
159
+ # @return Aws::EventEmitter
160
+ attr_reader :event_emitter
161
+
162
+ end
163
+
164
+ class StartConversationResponseEventStream
165
+
166
+ def initialize
167
+ @event_emitter = Aws::EventEmitter.new
168
+ end
169
+
170
+ def on_playback_interruption_event_event(&block)
171
+ @event_emitter.on(:playback_interruption_event, block) if block_given?
172
+ end
173
+
174
+ def on_transcript_event_event(&block)
175
+ @event_emitter.on(:transcript_event, block) if block_given?
176
+ end
177
+
178
+ def on_intent_result_event_event(&block)
179
+ @event_emitter.on(:intent_result_event, block) if block_given?
180
+ end
181
+
182
+ def on_text_response_event_event(&block)
183
+ @event_emitter.on(:text_response_event, block) if block_given?
184
+ end
185
+
186
+ def on_audio_response_event_event(&block)
187
+ @event_emitter.on(:audio_response_event, block) if block_given?
188
+ end
189
+
190
+ def on_heartbeat_event_event(&block)
191
+ @event_emitter.on(:heartbeat_event, block) if block_given?
192
+ end
193
+
194
+ def on_access_denied_exception_event(&block)
195
+ @event_emitter.on(:access_denied_exception, block) if block_given?
196
+ end
197
+
198
+ def on_resource_not_found_exception_event(&block)
199
+ @event_emitter.on(:resource_not_found_exception, block) if block_given?
200
+ end
201
+
202
+ def on_validation_exception_event(&block)
203
+ @event_emitter.on(:validation_exception, block) if block_given?
204
+ end
205
+
206
+ def on_throttling_exception_event(&block)
207
+ @event_emitter.on(:throttling_exception, block) if block_given?
208
+ end
209
+
210
+ def on_internal_server_exception_event(&block)
211
+ @event_emitter.on(:internal_server_exception, block) if block_given?
212
+ end
213
+
214
+ def on_conflict_exception_event(&block)
215
+ @event_emitter.on(:conflict_exception, block) if block_given?
216
+ end
217
+
218
+ def on_dependency_failed_exception_event(&block)
219
+ @event_emitter.on(:dependency_failed_exception, block) if block_given?
220
+ end
221
+
222
+ def on_bad_gateway_exception_event(&block)
223
+ @event_emitter.on(:bad_gateway_exception, block) if block_given?
224
+ end
225
+
226
+ def on_error_event(&block)
227
+ @event_emitter.on(:error, block) if block_given?
228
+ end
229
+
230
+ def on_initial_response_event(&block)
231
+ @event_emitter.on(:initial_response, block) if block_given?
232
+ end
233
+
234
+ def on_unknown_event(&block)
235
+ @event_emitter.on(:unknown_event, block) if block_given?
236
+ end
237
+
238
+ def on_event(&block)
239
+ on_playback_interruption_event_event(&block)
240
+ on_transcript_event_event(&block)
241
+ on_intent_result_event_event(&block)
242
+ on_text_response_event_event(&block)
243
+ on_audio_response_event_event(&block)
244
+ on_heartbeat_event_event(&block)
245
+ on_access_denied_exception_event(&block)
246
+ on_resource_not_found_exception_event(&block)
247
+ on_validation_exception_event(&block)
248
+ on_throttling_exception_event(&block)
249
+ on_internal_server_exception_event(&block)
250
+ on_conflict_exception_event(&block)
251
+ on_dependency_failed_exception_event(&block)
252
+ on_bad_gateway_exception_event(&block)
253
+ on_error_event(&block)
254
+ on_initial_response_event(&block)
255
+ on_unknown_event(&block)
256
+ end
257
+
258
+ # @api private
259
+ # @return Aws::EventEmitter
260
+ attr_reader :event_emitter
261
+
262
+ end
263
+
264
+ end
265
+ end
266
+
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,2060 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+ module Types
12
+
13
+ # @!attribute [rw] message
14
+ # @return [String]
15
+ #
16
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/AccessDeniedException AWS API Documentation
17
+ #
18
+ class AccessDeniedException < Struct.new(
19
+ :message,
20
+ :event_type)
21
+ SENSITIVE = []
22
+ include Aws::Structure
23
+ end
24
+
25
+ # Contains information about the contexts that a user is using in a
26
+ # session. You can configure Amazon Lex to set a context when an intent
27
+ # is fulfilled, or you can set a context using the , , or operations.
28
+ #
29
+ # Use a context to indicate to Amazon Lex intents that should be used as
30
+ # follow-up intents. For example, if the active context is
31
+ # `order-fulfilled`, only intents that have `order-fulfilled` configured
32
+ # as a trigger are considered for follow up.
33
+ #
34
+ # @note When making an API call, you may pass ActiveContext
35
+ # data as a hash:
36
+ #
37
+ # {
38
+ # name: "ActiveContextName", # required
39
+ # time_to_live: { # required
40
+ # time_to_live_in_seconds: 1, # required
41
+ # turns_to_live: 1, # required
42
+ # },
43
+ # context_attributes: {
44
+ # "ParameterName" => "Text",
45
+ # },
46
+ # }
47
+ #
48
+ # @!attribute [rw] name
49
+ # The name of the context.
50
+ # @return [String]
51
+ #
52
+ # @!attribute [rw] time_to_live
53
+ # Indicates the number of turns or seconds that the context is active.
54
+ # Once the time to live expires, the context is no longer returned in
55
+ # a response.
56
+ # @return [Types::ActiveContextTimeToLive]
57
+ #
58
+ # @!attribute [rw] context_attributes
59
+ # A lis tof contexts active for the request. A context can be
60
+ # activated when a previous intent is fulfilled, or by including the
61
+ # context in the request.
62
+ #
63
+ # If you don't specify a list of contexts, Amazon Lex will use the
64
+ # current list of contexts for the session. If you specify an empty
65
+ # list, all contexts for the session are cleared.
66
+ # @return [Hash<String,String>]
67
+ #
68
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ActiveContext AWS API Documentation
69
+ #
70
+ class ActiveContext < Struct.new(
71
+ :name,
72
+ :time_to_live,
73
+ :context_attributes)
74
+ SENSITIVE = []
75
+ include Aws::Structure
76
+ end
77
+
78
+ # The time that a context is active. You can specify the time to live in
79
+ # seconds or in conversation turns.
80
+ #
81
+ # @note When making an API call, you may pass ActiveContextTimeToLive
82
+ # data as a hash:
83
+ #
84
+ # {
85
+ # time_to_live_in_seconds: 1, # required
86
+ # turns_to_live: 1, # required
87
+ # }
88
+ #
89
+ # @!attribute [rw] time_to_live_in_seconds
90
+ # The number of seconds that the context is active. You can specify
91
+ # between 5 and 86400 seconds (24 hours).
92
+ # @return [Integer]
93
+ #
94
+ # @!attribute [rw] turns_to_live
95
+ # The number of turns that the context is active. You can specify up
96
+ # to 20 turns. Each request and response from the bot is a turn.
97
+ # @return [Integer]
98
+ #
99
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ActiveContextTimeToLive AWS API Documentation
100
+ #
101
+ class ActiveContextTimeToLive < Struct.new(
102
+ :time_to_live_in_seconds,
103
+ :turns_to_live)
104
+ SENSITIVE = []
105
+ include Aws::Structure
106
+ end
107
+
108
+ # Represents a chunk of audio sent from the client application to Amazon
109
+ # Lex. The audio is all or part of an utterance from the user.
110
+ #
111
+ # Amazon Lex accumulates audio chunks until it recognizes a natural
112
+ # pause in speech before processing the input.
113
+ #
114
+ # @note When making an API call, you may pass AudioInputEvent
115
+ # data as a hash:
116
+ #
117
+ # {
118
+ # audio_chunk: "data",
119
+ # content_type: "NonEmptyString", # required
120
+ # event_id: "EventId",
121
+ # client_timestamp_millis: 1,
122
+ # }
123
+ #
124
+ # @!attribute [rw] audio_chunk
125
+ # An encoded stream of audio.
126
+ # @return [String]
127
+ #
128
+ # @!attribute [rw] content_type
129
+ # The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit
130
+ # mono-channel little-endian format. The value of the field should be:
131
+ #
132
+ # `audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1;
133
+ # is-big-endian=false`
134
+ # @return [String]
135
+ #
136
+ # @!attribute [rw] event_id
137
+ # A unique identifier that your application assigns to the event. You
138
+ # can use this to identify events in logs.
139
+ # @return [String]
140
+ #
141
+ # @!attribute [rw] client_timestamp_millis
142
+ # A timestamp set by the client of the date and time that the event
143
+ # was sent to Amazon Lex.
144
+ # @return [Integer]
145
+ #
146
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/AudioInputEvent AWS API Documentation
147
+ #
148
+ class AudioInputEvent < Struct.new(
149
+ :audio_chunk,
150
+ :content_type,
151
+ :event_id,
152
+ :client_timestamp_millis,
153
+ :event_type)
154
+ SENSITIVE = []
155
+ include Aws::Structure
156
+ end
157
+
158
+ # An event sent from Amazon Lex to your client application containing
159
+ # audio to play to the user.
160
+ #
161
+ # @!attribute [rw] audio_chunk
162
+ # A chunk of the audio to play.
163
+ # @return [String]
164
+ #
165
+ # @!attribute [rw] content_type
166
+ # The encoding of the audio chunk. This is the same as the encoding
167
+ # configure in the `contentType` field of the `ConfigurationEvent`.
168
+ # @return [String]
169
+ #
170
+ # @!attribute [rw] event_id
171
+ # A unique identifier of the event sent by Amazon Lex. The identifier
172
+ # is in the form `RESPONSE-N`, where N is a number starting with one
173
+ # and incremented for each event sent by Amazon Lex in the current
174
+ # session.
175
+ # @return [String]
176
+ #
177
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/AudioResponseEvent AWS API Documentation
178
+ #
179
+ class AudioResponseEvent < Struct.new(
180
+ :audio_chunk,
181
+ :content_type,
182
+ :event_id,
183
+ :event_type)
184
+ SENSITIVE = []
185
+ include Aws::Structure
186
+ end
187
+
188
+ # @!attribute [rw] message
189
+ # @return [String]
190
+ #
191
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/BadGatewayException AWS API Documentation
192
+ #
193
+ class BadGatewayException < Struct.new(
194
+ :message,
195
+ :event_type)
196
+ SENSITIVE = []
197
+ include Aws::Structure
198
+ end
199
+
200
+ # A button that appears on a response card show to the user.
201
+ #
202
+ # @note When making an API call, you may pass Button
203
+ # data as a hash:
204
+ #
205
+ # {
206
+ # text: "ButtonText", # required
207
+ # value: "ButtonValue", # required
208
+ # }
209
+ #
210
+ # @!attribute [rw] text
211
+ # The text that is displayed on the button.
212
+ # @return [String]
213
+ #
214
+ # @!attribute [rw] value
215
+ # The value returned to Amazon Lex when a user chooses the button.
216
+ # @return [String]
217
+ #
218
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Button AWS API Documentation
219
+ #
220
+ class Button < Struct.new(
221
+ :text,
222
+ :value)
223
+ SENSITIVE = []
224
+ include Aws::Structure
225
+ end
226
+
227
+ # Provides a score that indicates the confidence that Amazon Lex has
228
+ # that an intent is the one that satisfies the user's intent.
229
+ #
230
+ # @!attribute [rw] score
231
+ # A score that indicates how confident Amazon Lex is that an intent
232
+ # satisfies the user's intent. Ranges between 0.00 and 1.00. Higher
233
+ # scores indicate higher confidence.
234
+ # @return [Float]
235
+ #
236
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ConfidenceScore AWS API Documentation
237
+ #
238
+ class ConfidenceScore < Struct.new(
239
+ :score)
240
+ SENSITIVE = []
241
+ include Aws::Structure
242
+ end
243
+
244
+ # The initial event sent from the application to Amazon Lex to configure
245
+ # the conversation, including session and request attributes and the
246
+ # response content type.
247
+ #
248
+ # @note When making an API call, you may pass ConfigurationEvent
249
+ # data as a hash:
250
+ #
251
+ # {
252
+ # request_attributes: {
253
+ # "NonEmptyString" => "String",
254
+ # },
255
+ # response_content_type: "NonEmptyString", # required
256
+ # session_state: {
257
+ # dialog_action: {
258
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
259
+ # slot_to_elicit: "NonEmptyString",
260
+ # },
261
+ # intent: {
262
+ # name: "NonEmptyString", # required
263
+ # slots: {
264
+ # "NonEmptyString" => {
265
+ # value: {
266
+ # original_value: "NonEmptyString",
267
+ # interpreted_value: "NonEmptyString", # required
268
+ # resolved_values: ["NonEmptyString"],
269
+ # },
270
+ # },
271
+ # },
272
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
273
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
274
+ # },
275
+ # active_contexts: [
276
+ # {
277
+ # name: "ActiveContextName", # required
278
+ # time_to_live: { # required
279
+ # time_to_live_in_seconds: 1, # required
280
+ # turns_to_live: 1, # required
281
+ # },
282
+ # context_attributes: {
283
+ # "ParameterName" => "Text",
284
+ # },
285
+ # },
286
+ # ],
287
+ # session_attributes: {
288
+ # "NonEmptyString" => "String",
289
+ # },
290
+ # originating_request_id: "NonEmptyString",
291
+ # },
292
+ # welcome_messages: [
293
+ # {
294
+ # content: "Text",
295
+ # content_type: "CustomPayload", # accepts CustomPayload, ImageResponseCard, PlainText, SSML
296
+ # image_response_card: {
297
+ # title: "AttachmentTitle", # required
298
+ # subtitle: "AttachmentTitle",
299
+ # image_url: "AttachmentUrl",
300
+ # buttons: [
301
+ # {
302
+ # text: "ButtonText", # required
303
+ # value: "ButtonValue", # required
304
+ # },
305
+ # ],
306
+ # },
307
+ # },
308
+ # ],
309
+ # disable_playback: false,
310
+ # event_id: "EventId",
311
+ # client_timestamp_millis: 1,
312
+ # }
313
+ #
314
+ # @!attribute [rw] request_attributes
315
+ # Request-specific information passed between the client application
316
+ # and Amazon Lex.
317
+ #
318
+ # The namespace `x-amz-lex:` is reserved for special attributes.
319
+ # Don't create any request attributes for prefix `x-amz-lex:`.
320
+ # @return [Hash<String,String>]
321
+ #
322
+ # @!attribute [rw] response_content_type
323
+ # The message that Amazon Lex returns in the response can be either
324
+ # text or speech based on the `responseContentType` value.
325
+ #
326
+ # * If the value is `text/plain;charset=utf-8`, Amazon Lex returns
327
+ # text in the response.
328
+ #
329
+ # * If the value begins with `audio/`, Amazon Lex returns speech in
330
+ # the response. Amazon Lex uses Amazon Polly to generate the speech
331
+ # using the configuration that you specified in the
332
+ # `requestContentType` parameter. For example, if you specify
333
+ # `audio/mpeg` as the value, Amazon Lex returns speech in the MPEG
334
+ # format.
335
+ #
336
+ # * If the value is `audio/pcm`, the speech returned is audio/pcm in
337
+ # 16-bit, little-endian format.
338
+ #
339
+ # * The following are the accepted values:
340
+ #
341
+ # * audio/mpeg
342
+ #
343
+ # * audio/ogg
344
+ #
345
+ # * audio/pcm
346
+ #
347
+ # * audio/* (defaults to mpeg)
348
+ #
349
+ # * text/plain; charset=utf-8
350
+ # @return [String]
351
+ #
352
+ # @!attribute [rw] session_state
353
+ # The state of the user's session with Amazon Lex.
354
+ # @return [Types::SessionState]
355
+ #
356
+ # @!attribute [rw] welcome_messages
357
+ # A list of messages to send to the user.
358
+ # @return [Array<Types::Message>]
359
+ #
360
+ # @!attribute [rw] disable_playback
361
+ # Determines whether Amazon Lex should send audio responses to the
362
+ # client application. When this parameter if `false`, the client
363
+ # application needs to create responses for the user.
364
+ # @return [Boolean]
365
+ #
366
+ # @!attribute [rw] event_id
367
+ # A unique identifier that your application assigns to the event. You
368
+ # can use this to identify events in logs.
369
+ # @return [String]
370
+ #
371
+ # @!attribute [rw] client_timestamp_millis
372
+ # A timestamp set by the client of the date and time that the event
373
+ # was sent to Amazon Lex.
374
+ # @return [Integer]
375
+ #
376
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ConfigurationEvent AWS API Documentation
377
+ #
378
+ class ConfigurationEvent < Struct.new(
379
+ :request_attributes,
380
+ :response_content_type,
381
+ :session_state,
382
+ :welcome_messages,
383
+ :disable_playback,
384
+ :event_id,
385
+ :client_timestamp_millis,
386
+ :event_type)
387
+ SENSITIVE = []
388
+ include Aws::Structure
389
+ end
390
+
391
+ # @!attribute [rw] message
392
+ # @return [String]
393
+ #
394
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ConflictException AWS API Documentation
395
+ #
396
+ class ConflictException < Struct.new(
397
+ :message,
398
+ :event_type)
399
+ SENSITIVE = []
400
+ include Aws::Structure
401
+ end
402
+
403
+ # A DTMF character sent from the client application. DTMF characters are
404
+ # typically sent from a phone keypad to represent numbers. For example,
405
+ # you can have Amazon Lex process a credit card number input from a
406
+ # phone.
407
+ #
408
+ # @note When making an API call, you may pass DTMFInputEvent
409
+ # data as a hash:
410
+ #
411
+ # {
412
+ # input_character: "DTMFRegex", # required
413
+ # event_id: "EventId",
414
+ # client_timestamp_millis: 1,
415
+ # }
416
+ #
417
+ # @!attribute [rw] input_character
418
+ # The DTMF character that the user pressed. The allowed characters are
419
+ # A - D, 0 - 9, # and *.
420
+ # @return [String]
421
+ #
422
+ # @!attribute [rw] event_id
423
+ # A unique identifier that your application assigns to the event. You
424
+ # can use this to identify events in logs.
425
+ # @return [String]
426
+ #
427
+ # @!attribute [rw] client_timestamp_millis
428
+ # A timestamp set by the client of the date and time that the event
429
+ # was sent to Amazon Lex.
430
+ # @return [Integer]
431
+ #
432
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DTMFInputEvent AWS API Documentation
433
+ #
434
+ class DTMFInputEvent < Struct.new(
435
+ :input_character,
436
+ :event_id,
437
+ :client_timestamp_millis,
438
+ :event_type)
439
+ SENSITIVE = [:input_character]
440
+ include Aws::Structure
441
+ end
442
+
443
+ # @note When making an API call, you may pass DeleteSessionRequest
444
+ # data as a hash:
445
+ #
446
+ # {
447
+ # bot_id: "BotIdentifier", # required
448
+ # bot_alias_id: "BotAliasIdentifier", # required
449
+ # locale_id: "LocaleId", # required
450
+ # session_id: "SessionId", # required
451
+ # }
452
+ #
453
+ # @!attribute [rw] bot_id
454
+ # The identifier of the bot that contains the session data.
455
+ # @return [String]
456
+ #
457
+ # @!attribute [rw] bot_alias_id
458
+ # The alias identifier in use for the bot that contains the session
459
+ # data.
460
+ # @return [String]
461
+ #
462
+ # @!attribute [rw] locale_id
463
+ # The locale where the session is in use.
464
+ # @return [String]
465
+ #
466
+ # @!attribute [rw] session_id
467
+ # The identifier of the session to delete.
468
+ # @return [String]
469
+ #
470
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DeleteSessionRequest AWS API Documentation
471
+ #
472
+ class DeleteSessionRequest < Struct.new(
473
+ :bot_id,
474
+ :bot_alias_id,
475
+ :locale_id,
476
+ :session_id)
477
+ SENSITIVE = []
478
+ include Aws::Structure
479
+ end
480
+
481
+ # @!attribute [rw] bot_id
482
+ # The identifier of the bot that contained the session data.
483
+ # @return [String]
484
+ #
485
+ # @!attribute [rw] bot_alias_id
486
+ # The alias identifier in use for the bot that contained the session
487
+ # data.
488
+ # @return [String]
489
+ #
490
+ # @!attribute [rw] locale_id
491
+ # The locale where the session was used.
492
+ # @return [String]
493
+ #
494
+ # @!attribute [rw] session_id
495
+ # The identifier of the deleted session.
496
+ # @return [String]
497
+ #
498
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DeleteSessionResponse AWS API Documentation
499
+ #
500
+ class DeleteSessionResponse < Struct.new(
501
+ :bot_id,
502
+ :bot_alias_id,
503
+ :locale_id,
504
+ :session_id)
505
+ SENSITIVE = []
506
+ include Aws::Structure
507
+ end
508
+
509
+ # @!attribute [rw] message
510
+ # @return [String]
511
+ #
512
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DependencyFailedException AWS API Documentation
513
+ #
514
+ class DependencyFailedException < Struct.new(
515
+ :message,
516
+ :event_type)
517
+ SENSITIVE = []
518
+ include Aws::Structure
519
+ end
520
+
521
+ # The next action that Amazon Lex should take.
522
+ #
523
+ # @note When making an API call, you may pass DialogAction
524
+ # data as a hash:
525
+ #
526
+ # {
527
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
528
+ # slot_to_elicit: "NonEmptyString",
529
+ # }
530
+ #
531
+ # @!attribute [rw] type
532
+ # The next action that the bot should take in its interaction with the
533
+ # user. The possible values are:
534
+ #
535
+ # * `Close` - Indicates that there will not be a response from the
536
+ # user. For example, the statement "Your order has been placed"
537
+ # does not require a response.
538
+ #
539
+ # * `ConfirmIntent` - The next action is asking the user if the intent
540
+ # is complete and ready to be fulfilled. This is a yes/no question
541
+ # such as "Place the order?"
542
+ #
543
+ # * `Delegate` - The next action is determined by Amazon Lex.
544
+ #
545
+ # * `ElicitSlot` - The next action is to elicit a slot value from the
546
+ # user.
547
+ # @return [String]
548
+ #
549
+ # @!attribute [rw] slot_to_elicit
550
+ # The name of the slot that should be elicited from the user.
551
+ # @return [String]
552
+ #
553
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DialogAction AWS API Documentation
554
+ #
555
+ class DialogAction < Struct.new(
556
+ :type,
557
+ :slot_to_elicit)
558
+ SENSITIVE = []
559
+ include Aws::Structure
560
+ end
561
+
562
+ # A notification from the client that it is disconnecting from Amazon
563
+ # Lex. Sending a `DisconnectionEvent` event is optional, but can help
564
+ # identify a conversation in logs.
565
+ #
566
+ # @note When making an API call, you may pass DisconnectionEvent
567
+ # data as a hash:
568
+ #
569
+ # {
570
+ # event_id: "EventId",
571
+ # client_timestamp_millis: 1,
572
+ # }
573
+ #
574
+ # @!attribute [rw] event_id
575
+ # A unique identifier that your application assigns to the event. You
576
+ # can use this to identify events in logs.
577
+ # @return [String]
578
+ #
579
+ # @!attribute [rw] client_timestamp_millis
580
+ # A timestamp set by the client of the date and time that the event
581
+ # was sent to Amazon Lex.
582
+ # @return [Integer]
583
+ #
584
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DisconnectionEvent AWS API Documentation
585
+ #
586
+ class DisconnectionEvent < Struct.new(
587
+ :event_id,
588
+ :client_timestamp_millis,
589
+ :event_type)
590
+ SENSITIVE = []
591
+ include Aws::Structure
592
+ end
593
+
594
+ # @note When making an API call, you may pass GetSessionRequest
595
+ # data as a hash:
596
+ #
597
+ # {
598
+ # bot_id: "BotIdentifier", # required
599
+ # bot_alias_id: "BotAliasIdentifier", # required
600
+ # locale_id: "LocaleId", # required
601
+ # session_id: "SessionId", # required
602
+ # }
603
+ #
604
+ # @!attribute [rw] bot_id
605
+ # The identifier of the bot that contains the session data.
606
+ # @return [String]
607
+ #
608
+ # @!attribute [rw] bot_alias_id
609
+ # The alias identifier in use for the bot that contains the session
610
+ # data.
611
+ # @return [String]
612
+ #
613
+ # @!attribute [rw] locale_id
614
+ # The locale where the session is in use.
615
+ # @return [String]
616
+ #
617
+ # @!attribute [rw] session_id
618
+ # The identifier of the session to return.
619
+ # @return [String]
620
+ #
621
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/GetSessionRequest AWS API Documentation
622
+ #
623
+ class GetSessionRequest < Struct.new(
624
+ :bot_id,
625
+ :bot_alias_id,
626
+ :locale_id,
627
+ :session_id)
628
+ SENSITIVE = []
629
+ include Aws::Structure
630
+ end
631
+
632
+ # @!attribute [rw] session_id
633
+ # The identifier of the returned session.
634
+ # @return [String]
635
+ #
636
+ # @!attribute [rw] messages
637
+ # A list of messages that were last sent to the user. The messages are
638
+ # ordered based on the order that your returned the messages from your
639
+ # Lambda function or the order that messages are defined in the bot.
640
+ # @return [Array<Types::Message>]
641
+ #
642
+ # @!attribute [rw] interpretations
643
+ # A list of intents that Amazon Lex determined might satisfy the
644
+ # user's utterance.
645
+ #
646
+ # Each interpretation includes the intent, a score that indicates how
647
+ # confident Amazon Lex is that the interpretation is the correct one,
648
+ # and an optional sentiment response that indicates the sentiment
649
+ # expressed in the utterance.
650
+ # @return [Array<Types::Interpretation>]
651
+ #
652
+ # @!attribute [rw] session_state
653
+ # Represents the current state of the dialog between the user and the
654
+ # bot.
655
+ #
656
+ # You can use this to determine the progress of the conversation and
657
+ # what the next action might be.
658
+ # @return [Types::SessionState]
659
+ #
660
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/GetSessionResponse AWS API Documentation
661
+ #
662
+ class GetSessionResponse < Struct.new(
663
+ :session_id,
664
+ :messages,
665
+ :interpretations,
666
+ :session_state)
667
+ SENSITIVE = []
668
+ include Aws::Structure
669
+ end
670
+
671
+ # Event that Amazon Lex sends to indicate that the stream is still open
672
+ # between the client application and Amazon Lex
673
+ #
674
+ # @!attribute [rw] event_id
675
+ # A unique identifier of the event sent by Amazon Lex. The identifier
676
+ # is in the form `RESPONSE-N`, where N is a number starting with one
677
+ # and incremented for each event sent by Amazon Lex in the current
678
+ # session.
679
+ # @return [String]
680
+ #
681
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/HeartbeatEvent AWS API Documentation
682
+ #
683
+ class HeartbeatEvent < Struct.new(
684
+ :event_id,
685
+ :event_type)
686
+ SENSITIVE = []
687
+ include Aws::Structure
688
+ end
689
+
690
+ # A card that is shown to the user by a messaging platform. You define
691
+ # the contents of the card, the card is displayed by the platform.
692
+ #
693
+ # When you use a response card, the response from the user is
694
+ # constrained to the text associated with a button on the card.
695
+ #
696
+ # @note When making an API call, you may pass ImageResponseCard
697
+ # data as a hash:
698
+ #
699
+ # {
700
+ # title: "AttachmentTitle", # required
701
+ # subtitle: "AttachmentTitle",
702
+ # image_url: "AttachmentUrl",
703
+ # buttons: [
704
+ # {
705
+ # text: "ButtonText", # required
706
+ # value: "ButtonValue", # required
707
+ # },
708
+ # ],
709
+ # }
710
+ #
711
+ # @!attribute [rw] title
712
+ # The title to display on the response card. The format of the title
713
+ # is determined by the platform displaying the response card.
714
+ # @return [String]
715
+ #
716
+ # @!attribute [rw] subtitle
717
+ # The subtitle to display on the response card. The format of the
718
+ # subtitle is determined by the platform displaying the response card.
719
+ # @return [String]
720
+ #
721
+ # @!attribute [rw] image_url
722
+ # The URL of an image to display on the response card. The image URL
723
+ # must be publicly available so that the platform displaying the
724
+ # response card has access to the image.
725
+ # @return [String]
726
+ #
727
+ # @!attribute [rw] buttons
728
+ # A list of buttons that should be displayed on the response card. The
729
+ # arrangement of the buttons is determined by the platform that
730
+ # displays the button.
731
+ # @return [Array<Types::Button>]
732
+ #
733
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ImageResponseCard AWS API Documentation
734
+ #
735
+ class ImageResponseCard < Struct.new(
736
+ :title,
737
+ :subtitle,
738
+ :image_url,
739
+ :buttons)
740
+ SENSITIVE = []
741
+ include Aws::Structure
742
+ end
743
+
744
+ # The current intent that Amazon Lex is attempting to fulfill.
745
+ #
746
+ # @note When making an API call, you may pass Intent
747
+ # data as a hash:
748
+ #
749
+ # {
750
+ # name: "NonEmptyString", # required
751
+ # slots: {
752
+ # "NonEmptyString" => {
753
+ # value: {
754
+ # original_value: "NonEmptyString",
755
+ # interpreted_value: "NonEmptyString", # required
756
+ # resolved_values: ["NonEmptyString"],
757
+ # },
758
+ # },
759
+ # },
760
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
761
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
762
+ # }
763
+ #
764
+ # @!attribute [rw] name
765
+ # The name of the intent.
766
+ # @return [String]
767
+ #
768
+ # @!attribute [rw] slots
769
+ # A map of all of the slots for the intent. The name of the slot maps
770
+ # to the value of the slot. If a slot has not been filled, the value
771
+ # is null.
772
+ # @return [Hash<String,Types::Slot>]
773
+ #
774
+ # @!attribute [rw] state
775
+ # Contains fulfillment information for the intent.
776
+ # @return [String]
777
+ #
778
+ # @!attribute [rw] confirmation_state
779
+ # Contains information about whether fulfillment of the intent has
780
+ # been confirmed.
781
+ # @return [String]
782
+ #
783
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Intent AWS API Documentation
784
+ #
785
+ class Intent < Struct.new(
786
+ :name,
787
+ :slots,
788
+ :state,
789
+ :confirmation_state)
790
+ SENSITIVE = []
791
+ include Aws::Structure
792
+ end
793
+
794
+ # Contains the current state of the conversation between the client
795
+ # application and Amazon Lex.
796
+ #
797
+ # @!attribute [rw] input_mode
798
+ # Indicates whether the input to the operation was text or speech.
799
+ # @return [String]
800
+ #
801
+ # @!attribute [rw] interpretations
802
+ # A list of intents that Amazon Lex determined might satisfy the
803
+ # user's utterance.
804
+ #
805
+ # Each interpretation includes the intent, a score that indicates how
806
+ # confident Amazon Lex is that the interpretation is the correct one,
807
+ # and an optional sentiment response that indicates the sentiment
808
+ # expressed in the utterance.
809
+ # @return [Array<Types::Interpretation>]
810
+ #
811
+ # @!attribute [rw] session_state
812
+ # The state of the user's session with Amazon Lex.
813
+ # @return [Types::SessionState]
814
+ #
815
+ # @!attribute [rw] request_attributes
816
+ # The attributes sent in the request.
817
+ # @return [Hash<String,String>]
818
+ #
819
+ # @!attribute [rw] session_id
820
+ # The identifier of the session in use.
821
+ # @return [String]
822
+ #
823
+ # @!attribute [rw] event_id
824
+ # A unique identifier of the event sent by Amazon Lex. The identifier
825
+ # is in the form `RESPONSE-N`, where N is a number starting with one
826
+ # and incremented for each event sent by Amazon Lex in the current
827
+ # session.
828
+ # @return [String]
829
+ #
830
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/IntentResultEvent AWS API Documentation
831
+ #
832
+ class IntentResultEvent < Struct.new(
833
+ :input_mode,
834
+ :interpretations,
835
+ :session_state,
836
+ :request_attributes,
837
+ :session_id,
838
+ :event_id,
839
+ :event_type)
840
+ SENSITIVE = []
841
+ include Aws::Structure
842
+ end
843
+
844
+ # @!attribute [rw] message
845
+ # @return [String]
846
+ #
847
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/InternalServerException AWS API Documentation
848
+ #
849
+ class InternalServerException < Struct.new(
850
+ :message,
851
+ :event_type)
852
+ SENSITIVE = []
853
+ include Aws::Structure
854
+ end
855
+
856
+ # An intent that Amazon Lex determined might satisfy the user's
857
+ # utterance. The intents are ordered by the confidence score.
858
+ #
859
+ # @!attribute [rw] nlu_confidence
860
+ # Determines the threshold where Amazon Lex will insert the
861
+ # `AMAZON.FallbackIntent`, `AMAZON.KendraSearchIntent`, or both when
862
+ # returning alternative intents in a response. `AMAZON.FallbackIntent`
863
+ # and `AMAZON.KendraSearchIntent` are only inserted if they are
864
+ # configured for the bot.
865
+ # @return [Types::ConfidenceScore]
866
+ #
867
+ # @!attribute [rw] sentiment_response
868
+ # The sentiment expressed in an utterance.
869
+ #
870
+ # When the bot is configured to send utterances to Amazon Comprehend
871
+ # for sentiment analysis, this field contains the result of the
872
+ # analysis.
873
+ # @return [Types::SentimentResponse]
874
+ #
875
+ # @!attribute [rw] intent
876
+ # A list of intents that might satisfy the user's utterance. The
877
+ # intents are ordered by the confidence score.
878
+ # @return [Types::Intent]
879
+ #
880
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Interpretation AWS API Documentation
881
+ #
882
+ class Interpretation < Struct.new(
883
+ :nlu_confidence,
884
+ :sentiment_response,
885
+ :intent)
886
+ SENSITIVE = []
887
+ include Aws::Structure
888
+ end
889
+
890
+ # Container for text that is returned to the customer..
891
+ #
892
+ # @note When making an API call, you may pass Message
893
+ # data as a hash:
894
+ #
895
+ # {
896
+ # content: "Text",
897
+ # content_type: "CustomPayload", # accepts CustomPayload, ImageResponseCard, PlainText, SSML
898
+ # image_response_card: {
899
+ # title: "AttachmentTitle", # required
900
+ # subtitle: "AttachmentTitle",
901
+ # image_url: "AttachmentUrl",
902
+ # buttons: [
903
+ # {
904
+ # text: "ButtonText", # required
905
+ # value: "ButtonValue", # required
906
+ # },
907
+ # ],
908
+ # },
909
+ # }
910
+ #
911
+ # @!attribute [rw] content
912
+ # The text of the message.
913
+ # @return [String]
914
+ #
915
+ # @!attribute [rw] content_type
916
+ # Indicates the type of response.
917
+ # @return [String]
918
+ #
919
+ # @!attribute [rw] image_response_card
920
+ # A card that is shown to the user by a messaging platform. You define
921
+ # the contents of the card, the card is displayed by the platform.
922
+ #
923
+ # When you use a response card, the response from the user is
924
+ # constrained to the text associated with a button on the card.
925
+ # @return [Types::ImageResponseCard]
926
+ #
927
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Message AWS API Documentation
928
+ #
929
+ class Message < Struct.new(
930
+ :content,
931
+ :content_type,
932
+ :image_response_card)
933
+ SENSITIVE = [:content]
934
+ include Aws::Structure
935
+ end
936
+
937
+ # Event sent from the client application to Amazon Lex to indicate that
938
+ # playback of audio is complete and that Amazon Lex should start
939
+ # processing the user's input.
940
+ #
941
+ # @note When making an API call, you may pass PlaybackCompletionEvent
942
+ # data as a hash:
943
+ #
944
+ # {
945
+ # event_id: "EventId",
946
+ # client_timestamp_millis: 1,
947
+ # }
948
+ #
949
+ # @!attribute [rw] event_id
950
+ # A unique identifier that your application assigns to the event. You
951
+ # can use this to identify events in logs.
952
+ # @return [String]
953
+ #
954
+ # @!attribute [rw] client_timestamp_millis
955
+ # A timestamp set by the client of the date and time that the event
956
+ # was sent to Amazon Lex.
957
+ # @return [Integer]
958
+ #
959
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PlaybackCompletionEvent AWS API Documentation
960
+ #
961
+ class PlaybackCompletionEvent < Struct.new(
962
+ :event_id,
963
+ :client_timestamp_millis,
964
+ :event_type)
965
+ SENSITIVE = []
966
+ include Aws::Structure
967
+ end
968
+
969
+ # Event sent from Amazon Lex to indicate to the client application
970
+ # should stop playback of audio. For example, if the client is playing a
971
+ # prompt that asks for the user's telephone number, the user might
972
+ # start to say the phone number before the prompt is complete. Amazon
973
+ # Lex sends this event to the client application to indicate that the
974
+ # user is responding and that Amazon Lex is processing their input.
975
+ #
976
+ # @!attribute [rw] event_reason
977
+ # Indicates the type of user input that Amazon Lex detected.
978
+ # @return [String]
979
+ #
980
+ # @!attribute [rw] caused_by_event_id
981
+ # The identifier of the event that contained the audio, DTMF, or text
982
+ # that caused the interruption.
983
+ # @return [String]
984
+ #
985
+ # @!attribute [rw] event_id
986
+ # A unique identifier of the event sent by Amazon Lex. The identifier
987
+ # is in the form `RESPONSE-N`, where N is a number starting with one
988
+ # and incremented for each event sent by Amazon Lex in the current
989
+ # session.
990
+ # @return [String]
991
+ #
992
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PlaybackInterruptionEvent AWS API Documentation
993
+ #
994
+ class PlaybackInterruptionEvent < Struct.new(
995
+ :event_reason,
996
+ :caused_by_event_id,
997
+ :event_id,
998
+ :event_type)
999
+ SENSITIVE = []
1000
+ include Aws::Structure
1001
+ end
1002
+
1003
+ # @note When making an API call, you may pass PutSessionRequest
1004
+ # data as a hash:
1005
+ #
1006
+ # {
1007
+ # bot_id: "BotIdentifier", # required
1008
+ # bot_alias_id: "BotAliasIdentifier", # required
1009
+ # locale_id: "LocaleId", # required
1010
+ # session_id: "SessionId", # required
1011
+ # messages: [
1012
+ # {
1013
+ # content: "Text",
1014
+ # content_type: "CustomPayload", # accepts CustomPayload, ImageResponseCard, PlainText, SSML
1015
+ # image_response_card: {
1016
+ # title: "AttachmentTitle", # required
1017
+ # subtitle: "AttachmentTitle",
1018
+ # image_url: "AttachmentUrl",
1019
+ # buttons: [
1020
+ # {
1021
+ # text: "ButtonText", # required
1022
+ # value: "ButtonValue", # required
1023
+ # },
1024
+ # ],
1025
+ # },
1026
+ # },
1027
+ # ],
1028
+ # session_state: { # required
1029
+ # dialog_action: {
1030
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
1031
+ # slot_to_elicit: "NonEmptyString",
1032
+ # },
1033
+ # intent: {
1034
+ # name: "NonEmptyString", # required
1035
+ # slots: {
1036
+ # "NonEmptyString" => {
1037
+ # value: {
1038
+ # original_value: "NonEmptyString",
1039
+ # interpreted_value: "NonEmptyString", # required
1040
+ # resolved_values: ["NonEmptyString"],
1041
+ # },
1042
+ # },
1043
+ # },
1044
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
1045
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
1046
+ # },
1047
+ # active_contexts: [
1048
+ # {
1049
+ # name: "ActiveContextName", # required
1050
+ # time_to_live: { # required
1051
+ # time_to_live_in_seconds: 1, # required
1052
+ # turns_to_live: 1, # required
1053
+ # },
1054
+ # context_attributes: {
1055
+ # "ParameterName" => "Text",
1056
+ # },
1057
+ # },
1058
+ # ],
1059
+ # session_attributes: {
1060
+ # "NonEmptyString" => "String",
1061
+ # },
1062
+ # originating_request_id: "NonEmptyString",
1063
+ # },
1064
+ # request_attributes: {
1065
+ # "NonEmptyString" => "String",
1066
+ # },
1067
+ # response_content_type: "NonEmptyString",
1068
+ # }
1069
+ #
1070
+ # @!attribute [rw] bot_id
1071
+ # The identifier of the bot that receives the session data.
1072
+ # @return [String]
1073
+ #
1074
+ # @!attribute [rw] bot_alias_id
1075
+ # The alias identifier of the bot that receives the session data.
1076
+ # @return [String]
1077
+ #
1078
+ # @!attribute [rw] locale_id
1079
+ # The locale where the session is in use.
1080
+ # @return [String]
1081
+ #
1082
+ # @!attribute [rw] session_id
1083
+ # The identifier of the session that receives the session data.
1084
+ # @return [String]
1085
+ #
1086
+ # @!attribute [rw] messages
1087
+ # A list of messages to send to the user. Messages are sent in the
1088
+ # order that they are defined in the list.
1089
+ # @return [Array<Types::Message>]
1090
+ #
1091
+ # @!attribute [rw] session_state
1092
+ # Sets the state of the session with the user. You can use this to set
1093
+ # the current intent, attributes, context, and dialog action. Use the
1094
+ # dialog action to determine the next step that Amazon Lex should use
1095
+ # in the conversation with the user.
1096
+ # @return [Types::SessionState]
1097
+ #
1098
+ # @!attribute [rw] request_attributes
1099
+ # Request-specific information passed between Amazon Lex and the
1100
+ # client application.
1101
+ #
1102
+ # The namespace `x-amz-lex:` is reserved for special attributes.
1103
+ # Don't create any request attributes with the prefix `x-amz-lex:`.
1104
+ # @return [Hash<String,String>]
1105
+ #
1106
+ # @!attribute [rw] response_content_type
1107
+ # The message that Amazon Lex returns in the response can be either
1108
+ # text or speech depending on the value of this parameter.
1109
+ #
1110
+ # * If the value is `text/plain; charset=utf-8`, Amazon Lex returns
1111
+ # text in the response.
1112
+ #
1113
+ # ^
1114
+ # @return [String]
1115
+ #
1116
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PutSessionRequest AWS API Documentation
1117
+ #
1118
+ class PutSessionRequest < Struct.new(
1119
+ :bot_id,
1120
+ :bot_alias_id,
1121
+ :locale_id,
1122
+ :session_id,
1123
+ :messages,
1124
+ :session_state,
1125
+ :request_attributes,
1126
+ :response_content_type)
1127
+ SENSITIVE = []
1128
+ include Aws::Structure
1129
+ end
1130
+
1131
+ # @!attribute [rw] content_type
1132
+ # The type of response. Same as the type specified in the
1133
+ # `responseContentType` field in the request.
1134
+ # @return [String]
1135
+ #
1136
+ # @!attribute [rw] messages
1137
+ # A list of messages that were last sent to the user. The messages are
1138
+ # ordered based on how you return the messages from you Lambda
1139
+ # function or the order that the messages are defined in the bot.
1140
+ # @return [String]
1141
+ #
1142
+ # @!attribute [rw] session_state
1143
+ # Represents the current state of the dialog between the user and the
1144
+ # bot.
1145
+ #
1146
+ # Use this to determine the progress of the conversation and what the
1147
+ # next action may be.
1148
+ # @return [String]
1149
+ #
1150
+ # @!attribute [rw] request_attributes
1151
+ # Request-specific information passed between the client application
1152
+ # and Amazon Lex. These are the same as the `requestAttribute`
1153
+ # parameter in the call to the `PutSession` operation.
1154
+ # @return [String]
1155
+ #
1156
+ # @!attribute [rw] session_id
1157
+ # The identifier of the session that received the data.
1158
+ # @return [String]
1159
+ #
1160
+ # @!attribute [rw] audio_stream
1161
+ # If the requested content type was audio, the audio version of the
1162
+ # message to convey to the user.
1163
+ # @return [IO]
1164
+ #
1165
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PutSessionResponse AWS API Documentation
1166
+ #
1167
+ class PutSessionResponse < Struct.new(
1168
+ :content_type,
1169
+ :messages,
1170
+ :session_state,
1171
+ :request_attributes,
1172
+ :session_id,
1173
+ :audio_stream)
1174
+ SENSITIVE = []
1175
+ include Aws::Structure
1176
+ end
1177
+
1178
+ # @note When making an API call, you may pass RecognizeTextRequest
1179
+ # data as a hash:
1180
+ #
1181
+ # {
1182
+ # bot_id: "BotIdentifier", # required
1183
+ # bot_alias_id: "BotAliasIdentifier", # required
1184
+ # locale_id: "LocaleId", # required
1185
+ # session_id: "SessionId", # required
1186
+ # text: "Text", # required
1187
+ # session_state: {
1188
+ # dialog_action: {
1189
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
1190
+ # slot_to_elicit: "NonEmptyString",
1191
+ # },
1192
+ # intent: {
1193
+ # name: "NonEmptyString", # required
1194
+ # slots: {
1195
+ # "NonEmptyString" => {
1196
+ # value: {
1197
+ # original_value: "NonEmptyString",
1198
+ # interpreted_value: "NonEmptyString", # required
1199
+ # resolved_values: ["NonEmptyString"],
1200
+ # },
1201
+ # },
1202
+ # },
1203
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
1204
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
1205
+ # },
1206
+ # active_contexts: [
1207
+ # {
1208
+ # name: "ActiveContextName", # required
1209
+ # time_to_live: { # required
1210
+ # time_to_live_in_seconds: 1, # required
1211
+ # turns_to_live: 1, # required
1212
+ # },
1213
+ # context_attributes: {
1214
+ # "ParameterName" => "Text",
1215
+ # },
1216
+ # },
1217
+ # ],
1218
+ # session_attributes: {
1219
+ # "NonEmptyString" => "String",
1220
+ # },
1221
+ # originating_request_id: "NonEmptyString",
1222
+ # },
1223
+ # request_attributes: {
1224
+ # "NonEmptyString" => "String",
1225
+ # },
1226
+ # }
1227
+ #
1228
+ # @!attribute [rw] bot_id
1229
+ # The identifier of the bot that processes the request.
1230
+ # @return [String]
1231
+ #
1232
+ # @!attribute [rw] bot_alias_id
1233
+ # The alias identifier in use for the bot that processes the request.
1234
+ # @return [String]
1235
+ #
1236
+ # @!attribute [rw] locale_id
1237
+ # The locale where the session is in use.
1238
+ # @return [String]
1239
+ #
1240
+ # @!attribute [rw] session_id
1241
+ # The identifier of the user session that is having the conversation.
1242
+ # @return [String]
1243
+ #
1244
+ # @!attribute [rw] text
1245
+ # The text that the user entered. Amazon Lex interprets this text.
1246
+ # @return [String]
1247
+ #
1248
+ # @!attribute [rw] session_state
1249
+ # The current state of the dialog between the user and the bot.
1250
+ # @return [Types::SessionState]
1251
+ #
1252
+ # @!attribute [rw] request_attributes
1253
+ # Request-specific information passed between the client application
1254
+ # and Amazon Lex
1255
+ #
1256
+ # The namespace `x-amz-lex:` is reserved for special attributes.
1257
+ # Don't create any request attributes with the prefix `x-amz-lex:`.
1258
+ # @return [Hash<String,String>]
1259
+ #
1260
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeTextRequest AWS API Documentation
1261
+ #
1262
+ class RecognizeTextRequest < Struct.new(
1263
+ :bot_id,
1264
+ :bot_alias_id,
1265
+ :locale_id,
1266
+ :session_id,
1267
+ :text,
1268
+ :session_state,
1269
+ :request_attributes)
1270
+ SENSITIVE = [:text]
1271
+ include Aws::Structure
1272
+ end
1273
+
1274
+ # @!attribute [rw] messages
1275
+ # A list of messages last sent to the user. The messages are ordered
1276
+ # based on the order that you returned the messages from your Lambda
1277
+ # function or the order that the messages are defined in the bot.
1278
+ # @return [Array<Types::Message>]
1279
+ #
1280
+ # @!attribute [rw] session_state
1281
+ # Represents the current state of the dialog between the user and the
1282
+ # bot.
1283
+ #
1284
+ # Use this to determine the progress of the conversation and what the
1285
+ # next action may be.
1286
+ # @return [Types::SessionState]
1287
+ #
1288
+ # @!attribute [rw] interpretations
1289
+ # A list of intents that Amazon Lex determined might satisfy the
1290
+ # user's utterance.
1291
+ #
1292
+ # Each interpretation includes the intent, a score that indicates now
1293
+ # confident Amazon Lex is that the interpretation is the correct one,
1294
+ # and an optional sentiment response that indicates the sentiment
1295
+ # expressed in the utterance.
1296
+ # @return [Array<Types::Interpretation>]
1297
+ #
1298
+ # @!attribute [rw] request_attributes
1299
+ # The attributes sent in the request.
1300
+ # @return [Hash<String,String>]
1301
+ #
1302
+ # @!attribute [rw] session_id
1303
+ # The identifier of the session in use.
1304
+ # @return [String]
1305
+ #
1306
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeTextResponse AWS API Documentation
1307
+ #
1308
+ class RecognizeTextResponse < Struct.new(
1309
+ :messages,
1310
+ :session_state,
1311
+ :interpretations,
1312
+ :request_attributes,
1313
+ :session_id)
1314
+ SENSITIVE = []
1315
+ include Aws::Structure
1316
+ end
1317
+
1318
+ # @note When making an API call, you may pass RecognizeUtteranceRequest
1319
+ # data as a hash:
1320
+ #
1321
+ # {
1322
+ # bot_id: "BotIdentifier", # required
1323
+ # bot_alias_id: "BotAliasIdentifier", # required
1324
+ # locale_id: "LocaleId", # required
1325
+ # session_id: "SessionId", # required
1326
+ # session_state: "SensitiveNonEmptyString",
1327
+ # request_attributes: "SensitiveNonEmptyString",
1328
+ # request_content_type: "NonEmptyString", # required
1329
+ # response_content_type: "NonEmptyString",
1330
+ # input_stream: "data",
1331
+ # }
1332
+ #
1333
+ # @!attribute [rw] bot_id
1334
+ # The identifier of the bot that should receive the request.
1335
+ # @return [String]
1336
+ #
1337
+ # @!attribute [rw] bot_alias_id
1338
+ # The alias identifier in use for the bot that should receive the
1339
+ # request.
1340
+ # @return [String]
1341
+ #
1342
+ # @!attribute [rw] locale_id
1343
+ # The locale where the session is in use.
1344
+ # @return [String]
1345
+ #
1346
+ # @!attribute [rw] session_id
1347
+ # The identifier of the session in use.
1348
+ # @return [String]
1349
+ #
1350
+ # @!attribute [rw] session_state
1351
+ # Sets the state of the session with the user. You can use this to set
1352
+ # the current intent, attributes, context, and dialog action. Use the
1353
+ # dialog action to determine the next step that Amazon Lex should use
1354
+ # in the conversation with the user.
1355
+ # @return [String]
1356
+ #
1357
+ # @!attribute [rw] request_attributes
1358
+ # Request-specific information passed between the client application
1359
+ # and Amazon Lex
1360
+ #
1361
+ # The namespace `x-amz-lex:` is reserved for special attributes.
1362
+ # Don't create any request attributes for prefix `x-amz-lex:`.
1363
+ # @return [String]
1364
+ #
1365
+ # @!attribute [rw] request_content_type
1366
+ # Indicates the format for audio input or that the content is text.
1367
+ # The header must start with one of the following prefixes:
1368
+ #
1369
+ # * PCM format, audio data must be in little-endian byte order.
1370
+ #
1371
+ # * audio/l16; rate=16000; channels=1
1372
+ #
1373
+ # * audio/x-l16; sample-rate=16000; channel-count=1
1374
+ #
1375
+ # * audio/lpcm; sample-rate=8000; sample-size-bits=16;
1376
+ # channel-count=1; is-big-endian=false
1377
+ #
1378
+ # * Opus format
1379
+ #
1380
+ # * audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4
1381
+ #
1382
+ # ^
1383
+ #
1384
+ # * Text format
1385
+ #
1386
+ # * text/plain; charset=utf-8
1387
+ #
1388
+ # ^
1389
+ # @return [String]
1390
+ #
1391
+ # @!attribute [rw] response_content_type
1392
+ # The message that Amazon Lex returns in the response can be either
1393
+ # text or speech based on the `responseContentType` value.
1394
+ #
1395
+ # * If the value is `text/plain;charset=utf-8`, Amazon Lex returns
1396
+ # text in the response.
1397
+ #
1398
+ # * If the value begins with `audio/`, Amazon Lex returns speech in
1399
+ # the response. Amazon Lex uses Amazon Polly to generate the speech
1400
+ # using the configuration that you specified in the
1401
+ # `requestContentType` parameter. For example, if you specify
1402
+ # `audio/mpeg` as the value, Amazon Lex returns speech in the MPEG
1403
+ # format.
1404
+ #
1405
+ # * If the value is `audio/pcm`, the speech returned is `audio/pcm` at
1406
+ # 16 KHz in 16-bit, little-endian format.
1407
+ #
1408
+ # * The following are the accepted values:
1409
+ #
1410
+ # * audio/mpeg
1411
+ #
1412
+ # * audio/ogg
1413
+ #
1414
+ # * audio/pcm (16 KHz)
1415
+ #
1416
+ # * audio/* (defaults to mpeg)
1417
+ #
1418
+ # * text/plain; charset=utf-8
1419
+ # @return [String]
1420
+ #
1421
+ # @!attribute [rw] input_stream
1422
+ # User input in PCM or Opus audio format or text format as described
1423
+ # in the `requestContentType` parameter.
1424
+ # @return [IO]
1425
+ #
1426
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeUtteranceRequest AWS API Documentation
1427
+ #
1428
+ class RecognizeUtteranceRequest < Struct.new(
1429
+ :bot_id,
1430
+ :bot_alias_id,
1431
+ :locale_id,
1432
+ :session_id,
1433
+ :session_state,
1434
+ :request_attributes,
1435
+ :request_content_type,
1436
+ :response_content_type,
1437
+ :input_stream)
1438
+ SENSITIVE = [:session_state, :request_attributes]
1439
+ include Aws::Structure
1440
+ end
1441
+
1442
+ # @!attribute [rw] input_mode
1443
+ # Indicates whether the input mode to the operation was text or
1444
+ # speech.
1445
+ # @return [String]
1446
+ #
1447
+ # @!attribute [rw] content_type
1448
+ # Content type as specified in the `responseContentType` in the
1449
+ # request.
1450
+ # @return [String]
1451
+ #
1452
+ # @!attribute [rw] messages
1453
+ # A list of messages that were last sent to the user. The messages are
1454
+ # ordered based on the order that you returned the messages from your
1455
+ # Lambda function or the order that the messages are defined in the
1456
+ # bot.
1457
+ # @return [String]
1458
+ #
1459
+ # @!attribute [rw] interpretations
1460
+ # A list of intents that Amazon Lex determined might satisfy the
1461
+ # user's utterance.
1462
+ #
1463
+ # Each interpretation includes the intent, a score that indicates how
1464
+ # confident Amazon Lex is that the interpretation is the correct one,
1465
+ # and an optional sentiment response that indicates the sentiment
1466
+ # expressed in the utterance.
1467
+ # @return [String]
1468
+ #
1469
+ # @!attribute [rw] session_state
1470
+ # Represents the current state of the dialog between the user and the
1471
+ # bot.
1472
+ #
1473
+ # Use this to determine the progress of the conversation and what the
1474
+ # next action might be.
1475
+ # @return [String]
1476
+ #
1477
+ # @!attribute [rw] request_attributes
1478
+ # The attributes sent in the request.
1479
+ # @return [String]
1480
+ #
1481
+ # @!attribute [rw] session_id
1482
+ # The identifier of the session in use.
1483
+ # @return [String]
1484
+ #
1485
+ # @!attribute [rw] input_transcript
1486
+ # The text used to process the request.
1487
+ #
1488
+ # If the input was an audio stream, the `inputTranscript` field
1489
+ # contains the text extracted from the audio stream. This is the text
1490
+ # that is actually processed to recognize intents and slot values. You
1491
+ # can use this information to determine if Amazon Lex is correctly
1492
+ # processing the audio that you send.
1493
+ # @return [String]
1494
+ #
1495
+ # @!attribute [rw] audio_stream
1496
+ # The prompt or statement to send to the user. This is based on the
1497
+ # bot configuration and context. For example, if Amazon Lex did not
1498
+ # understand the user intent, it sends the `clarificationPrompt`
1499
+ # configured for the bot. If the intent requires confirmation before
1500
+ # taking the fulfillment action, it sends the `confirmationPrompt`.
1501
+ # Another example: Suppose that the Lambda function successfully
1502
+ # fulfilled the intent, and sent a message to convey to the user. Then
1503
+ # Amazon Lex sends that message in the response.
1504
+ # @return [IO]
1505
+ #
1506
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeUtteranceResponse AWS API Documentation
1507
+ #
1508
+ class RecognizeUtteranceResponse < Struct.new(
1509
+ :input_mode,
1510
+ :content_type,
1511
+ :messages,
1512
+ :interpretations,
1513
+ :session_state,
1514
+ :request_attributes,
1515
+ :session_id,
1516
+ :input_transcript,
1517
+ :audio_stream)
1518
+ SENSITIVE = []
1519
+ include Aws::Structure
1520
+ end
1521
+
1522
+ # @!attribute [rw] message
1523
+ # @return [String]
1524
+ #
1525
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ResourceNotFoundException AWS API Documentation
1526
+ #
1527
+ class ResourceNotFoundException < Struct.new(
1528
+ :message,
1529
+ :event_type)
1530
+ SENSITIVE = []
1531
+ include Aws::Structure
1532
+ end
1533
+
1534
+ # Provides information about the sentiment expressed in a user's
1535
+ # response in a conversation. Sentiments are determined using Amazon
1536
+ # Comprehend. Sentiments are only returned if they are enabled for the
1537
+ # bot.
1538
+ #
1539
+ # For more information, see [ Determine Sentiment ][1] in the *Amazon
1540
+ # Comprehend developer guide*.
1541
+ #
1542
+ #
1543
+ #
1544
+ # [1]: https://docs.aws.amazon.com/comprehend/latest/dg/how-sentiment.html
1545
+ #
1546
+ # @!attribute [rw] sentiment
1547
+ # The overall sentiment expressed in the user's response. This is the
1548
+ # sentiment most likely expressed by the user based on the analysis by
1549
+ # Amazon Comprehend.
1550
+ # @return [String]
1551
+ #
1552
+ # @!attribute [rw] sentiment_score
1553
+ # The individual sentiment responses for the utterance.
1554
+ # @return [Types::SentimentScore]
1555
+ #
1556
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/SentimentResponse AWS API Documentation
1557
+ #
1558
+ class SentimentResponse < Struct.new(
1559
+ :sentiment,
1560
+ :sentiment_score)
1561
+ SENSITIVE = []
1562
+ include Aws::Structure
1563
+ end
1564
+
1565
+ # The individual sentiment responses for the utterance.
1566
+ #
1567
+ # @!attribute [rw] positive
1568
+ # The level of confidence that Amazon Comprehend has in the accuracy
1569
+ # of its detection of the `POSITIVE` sentiment.
1570
+ # @return [Float]
1571
+ #
1572
+ # @!attribute [rw] negative
1573
+ # The level of confidence that Amazon Comprehend has in the accuracy
1574
+ # of its detection of the `NEGATIVE` sentiment.
1575
+ # @return [Float]
1576
+ #
1577
+ # @!attribute [rw] neutral
1578
+ # The level of confidence that Amazon Comprehend has in the accuracy
1579
+ # of its detection of the `NEUTRAL` sentiment.
1580
+ # @return [Float]
1581
+ #
1582
+ # @!attribute [rw] mixed
1583
+ # The level of confidence that Amazon Comprehend has in the accuracy
1584
+ # of its detection of the `MIXED` sentiment.
1585
+ # @return [Float]
1586
+ #
1587
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/SentimentScore AWS API Documentation
1588
+ #
1589
+ class SentimentScore < Struct.new(
1590
+ :positive,
1591
+ :negative,
1592
+ :neutral,
1593
+ :mixed)
1594
+ SENSITIVE = []
1595
+ include Aws::Structure
1596
+ end
1597
+
1598
+ # The state of the user's session with Amazon Lex.
1599
+ #
1600
+ # @note When making an API call, you may pass SessionState
1601
+ # data as a hash:
1602
+ #
1603
+ # {
1604
+ # dialog_action: {
1605
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
1606
+ # slot_to_elicit: "NonEmptyString",
1607
+ # },
1608
+ # intent: {
1609
+ # name: "NonEmptyString", # required
1610
+ # slots: {
1611
+ # "NonEmptyString" => {
1612
+ # value: {
1613
+ # original_value: "NonEmptyString",
1614
+ # interpreted_value: "NonEmptyString", # required
1615
+ # resolved_values: ["NonEmptyString"],
1616
+ # },
1617
+ # },
1618
+ # },
1619
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
1620
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
1621
+ # },
1622
+ # active_contexts: [
1623
+ # {
1624
+ # name: "ActiveContextName", # required
1625
+ # time_to_live: { # required
1626
+ # time_to_live_in_seconds: 1, # required
1627
+ # turns_to_live: 1, # required
1628
+ # },
1629
+ # context_attributes: {
1630
+ # "ParameterName" => "Text",
1631
+ # },
1632
+ # },
1633
+ # ],
1634
+ # session_attributes: {
1635
+ # "NonEmptyString" => "String",
1636
+ # },
1637
+ # originating_request_id: "NonEmptyString",
1638
+ # }
1639
+ #
1640
+ # @!attribute [rw] dialog_action
1641
+ # The next step that Amazon Lex should take in the conversation with a
1642
+ # user.
1643
+ # @return [Types::DialogAction]
1644
+ #
1645
+ # @!attribute [rw] intent
1646
+ # The active intent that Amazon Lex is processing.
1647
+ # @return [Types::Intent]
1648
+ #
1649
+ # @!attribute [rw] active_contexts
1650
+ # One or more contexts that indicate to Amazon Lex the context of a
1651
+ # request. When a context is active, Amazon Lex considers intents with
1652
+ # the matching context as a trigger as the next intent in a session.
1653
+ # @return [Array<Types::ActiveContext>]
1654
+ #
1655
+ # @!attribute [rw] session_attributes
1656
+ # Map of key/value pairs representing session-specific context
1657
+ # information. It contains application information passed between
1658
+ # Amazon Lex and a client application.
1659
+ # @return [Hash<String,String>]
1660
+ #
1661
+ # @!attribute [rw] originating_request_id
1662
+ # @return [String]
1663
+ #
1664
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/SessionState AWS API Documentation
1665
+ #
1666
+ class SessionState < Struct.new(
1667
+ :dialog_action,
1668
+ :intent,
1669
+ :active_contexts,
1670
+ :session_attributes,
1671
+ :originating_request_id)
1672
+ SENSITIVE = []
1673
+ include Aws::Structure
1674
+ end
1675
+
1676
+ # A value that Amazon Lex uses to fulfill an intent.
1677
+ #
1678
+ # @note When making an API call, you may pass Slot
1679
+ # data as a hash:
1680
+ #
1681
+ # {
1682
+ # value: {
1683
+ # original_value: "NonEmptyString",
1684
+ # interpreted_value: "NonEmptyString", # required
1685
+ # resolved_values: ["NonEmptyString"],
1686
+ # },
1687
+ # }
1688
+ #
1689
+ # @!attribute [rw] value
1690
+ # The current value of the slot.
1691
+ # @return [Types::Value]
1692
+ #
1693
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Slot AWS API Documentation
1694
+ #
1695
+ class Slot < Struct.new(
1696
+ :value)
1697
+ SENSITIVE = []
1698
+ include Aws::Structure
1699
+ end
1700
+
1701
+ # @note When making an API call, you may pass StartConversationRequest
1702
+ # data as a hash:
1703
+ #
1704
+ # {
1705
+ # bot_id: "BotIdentifier", # required
1706
+ # bot_alias_id: "BotAliasIdentifier", # required
1707
+ # locale_id: "LocaleId", # required
1708
+ # session_id: "SessionId", # required
1709
+ # conversation_mode: "AUDIO", # accepts AUDIO, TEXT
1710
+ # input_event_stream_hander: EventStreams::StartConversationRequestEventStream.new,
1711
+ # }
1712
+ #
1713
+ # @!attribute [rw] bot_id
1714
+ # The identifier of the bot to process the request.
1715
+ # @return [String]
1716
+ #
1717
+ # @!attribute [rw] bot_alias_id
1718
+ # The alias identifier in use for the bot that processes the request.
1719
+ # @return [String]
1720
+ #
1721
+ # @!attribute [rw] locale_id
1722
+ # The locale where the session is in use.
1723
+ # @return [String]
1724
+ #
1725
+ # @!attribute [rw] session_id
1726
+ # The identifier of the user session that is having the conversation.
1727
+ # @return [String]
1728
+ #
1729
+ # @!attribute [rw] conversation_mode
1730
+ # The conversation type that you are using the Amazon Lex. If the
1731
+ # conversation mode is `AUDIO` you can send both audio and DTMF
1732
+ # information. If the mode is `TEXT` you can only send text.
1733
+ # @return [String]
1734
+ #
1735
+ # @!attribute [rw] request_event_stream
1736
+ # Represents the stream of events to Amazon Lex from your application.
1737
+ # The events are encoded as HTTP/2 data frames.
1738
+ # @return [Types::StartConversationRequestEventStream]
1739
+ #
1740
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversationRequest AWS API Documentation
1741
+ #
1742
+ class StartConversationRequest < Struct.new(
1743
+ :bot_id,
1744
+ :bot_alias_id,
1745
+ :locale_id,
1746
+ :session_id,
1747
+ :conversation_mode,
1748
+ :request_event_stream)
1749
+ SENSITIVE = []
1750
+ include Aws::Structure
1751
+ end
1752
+
1753
+ # @!attribute [rw] response_event_stream
1754
+ # Represents the stream of events from Amazon Lex to your application.
1755
+ # The events are encoded as HTTP/2 data frames.
1756
+ # @return [Types::StartConversationResponseEventStream]
1757
+ #
1758
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversationResponse AWS API Documentation
1759
+ #
1760
+ class StartConversationResponse < Struct.new(
1761
+ :response_event_stream)
1762
+ SENSITIVE = []
1763
+ include Aws::Structure
1764
+ end
1765
+
1766
+ # The event sent from your client application to Amazon Lex with text
1767
+ # input from the user.
1768
+ #
1769
+ # @note When making an API call, you may pass TextInputEvent
1770
+ # data as a hash:
1771
+ #
1772
+ # {
1773
+ # text: "Text", # required
1774
+ # event_id: "EventId",
1775
+ # client_timestamp_millis: 1,
1776
+ # }
1777
+ #
1778
+ # @!attribute [rw] text
1779
+ # The text from the user. Amazon Lex processes this as a complete
1780
+ # statement.
1781
+ # @return [String]
1782
+ #
1783
+ # @!attribute [rw] event_id
1784
+ # A unique identifier that your application assigns to the event. You
1785
+ # can use this to identify events in logs.
1786
+ # @return [String]
1787
+ #
1788
+ # @!attribute [rw] client_timestamp_millis
1789
+ # A timestamp set by the client of the date and time that the event
1790
+ # was sent to Amazon Lex.
1791
+ # @return [Integer]
1792
+ #
1793
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/TextInputEvent AWS API Documentation
1794
+ #
1795
+ class TextInputEvent < Struct.new(
1796
+ :text,
1797
+ :event_id,
1798
+ :client_timestamp_millis,
1799
+ :event_type)
1800
+ SENSITIVE = [:text]
1801
+ include Aws::Structure
1802
+ end
1803
+
1804
+ # The event sent from Amazon Lex to your application with text to
1805
+ # present to the user.
1806
+ #
1807
+ # @!attribute [rw] messages
1808
+ # A list of messages to send to the user. Messages are ordered based
1809
+ # on the order that you returned the messages from your Lambda
1810
+ # function or the order that the messages are defined in the bot.
1811
+ # @return [Array<Types::Message>]
1812
+ #
1813
+ # @!attribute [rw] event_id
1814
+ # A unique identifier of the event sent by Amazon Lex. The identifier
1815
+ # is in the form `RESPONSE-N`, where N is a number starting with one
1816
+ # and incremented for each event sent by Amazon Lex in the current
1817
+ # session.
1818
+ # @return [String]
1819
+ #
1820
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/TextResponseEvent AWS API Documentation
1821
+ #
1822
+ class TextResponseEvent < Struct.new(
1823
+ :messages,
1824
+ :event_id,
1825
+ :event_type)
1826
+ SENSITIVE = []
1827
+ include Aws::Structure
1828
+ end
1829
+
1830
+ # @!attribute [rw] message
1831
+ # @return [String]
1832
+ #
1833
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ThrottlingException AWS API Documentation
1834
+ #
1835
+ class ThrottlingException < Struct.new(
1836
+ :message,
1837
+ :event_type)
1838
+ SENSITIVE = []
1839
+ include Aws::Structure
1840
+ end
1841
+
1842
+ # Event sent from Amazon Lex to your client application that contains a
1843
+ # transcript of voice audio.
1844
+ #
1845
+ # @!attribute [rw] transcript
1846
+ # The transcript of the voice audio from the user.
1847
+ # @return [String]
1848
+ #
1849
+ # @!attribute [rw] event_id
1850
+ # A unique identifier of the event sent by Amazon Lex. The identifier
1851
+ # is in the form `RESPONSE-N`, where N is a number starting with one
1852
+ # and incremented for each event sent by Amazon Lex in the current
1853
+ # session.
1854
+ # @return [String]
1855
+ #
1856
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/TranscriptEvent AWS API Documentation
1857
+ #
1858
+ class TranscriptEvent < Struct.new(
1859
+ :transcript,
1860
+ :event_id,
1861
+ :event_type)
1862
+ SENSITIVE = []
1863
+ include Aws::Structure
1864
+ end
1865
+
1866
+ # @!attribute [rw] message
1867
+ # @return [String]
1868
+ #
1869
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/ValidationException AWS API Documentation
1870
+ #
1871
+ class ValidationException < Struct.new(
1872
+ :message,
1873
+ :event_type)
1874
+ SENSITIVE = []
1875
+ include Aws::Structure
1876
+ end
1877
+
1878
+ # The value of a slot.
1879
+ #
1880
+ # @note When making an API call, you may pass Value
1881
+ # data as a hash:
1882
+ #
1883
+ # {
1884
+ # original_value: "NonEmptyString",
1885
+ # interpreted_value: "NonEmptyString", # required
1886
+ # resolved_values: ["NonEmptyString"],
1887
+ # }
1888
+ #
1889
+ # @!attribute [rw] original_value
1890
+ # The text of the utterance from the user that was entered for the
1891
+ # slot.
1892
+ # @return [String]
1893
+ #
1894
+ # @!attribute [rw] interpreted_value
1895
+ # The value that Amazon Lex determines for the slot. The actual value
1896
+ # depends on the setting of the value selection strategy for the bot.
1897
+ # You can choose to use the value entered by the user, or you can have
1898
+ # Amazon Lex choose the first value in the `resolvedValues` list.
1899
+ # @return [String]
1900
+ #
1901
+ # @!attribute [rw] resolved_values
1902
+ # A list of additional values that have been recognized for the slot.
1903
+ # @return [Array<String>]
1904
+ #
1905
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/Value AWS API Documentation
1906
+ #
1907
+ class Value < Struct.new(
1908
+ :original_value,
1909
+ :interpreted_value,
1910
+ :resolved_values)
1911
+ SENSITIVE = []
1912
+ include Aws::Structure
1913
+ end
1914
+
1915
+ # Represents a stream of events between your application and Amazon Lex.
1916
+ #
1917
+ # @note When making an API call, you may pass StartConversationRequestEventStream
1918
+ # data as a hash:
1919
+ #
1920
+ # {
1921
+ # configuration_event: {
1922
+ # request_attributes: {
1923
+ # "NonEmptyString" => "String",
1924
+ # },
1925
+ # response_content_type: "NonEmptyString", # required
1926
+ # session_state: {
1927
+ # dialog_action: {
1928
+ # type: "Close", # required, accepts Close, ConfirmIntent, Delegate, ElicitIntent, ElicitSlot
1929
+ # slot_to_elicit: "NonEmptyString",
1930
+ # },
1931
+ # intent: {
1932
+ # name: "NonEmptyString", # required
1933
+ # slots: {
1934
+ # "NonEmptyString" => {
1935
+ # value: {
1936
+ # original_value: "NonEmptyString",
1937
+ # interpreted_value: "NonEmptyString", # required
1938
+ # resolved_values: ["NonEmptyString"],
1939
+ # },
1940
+ # },
1941
+ # },
1942
+ # state: "Failed", # accepts Failed, Fulfilled, InProgress, ReadyForFulfillment, Waiting
1943
+ # confirmation_state: "Confirmed", # accepts Confirmed, Denied, None
1944
+ # },
1945
+ # active_contexts: [
1946
+ # {
1947
+ # name: "ActiveContextName", # required
1948
+ # time_to_live: { # required
1949
+ # time_to_live_in_seconds: 1, # required
1950
+ # turns_to_live: 1, # required
1951
+ # },
1952
+ # context_attributes: {
1953
+ # "ParameterName" => "Text",
1954
+ # },
1955
+ # },
1956
+ # ],
1957
+ # session_attributes: {
1958
+ # "NonEmptyString" => "String",
1959
+ # },
1960
+ # originating_request_id: "NonEmptyString",
1961
+ # },
1962
+ # welcome_messages: [
1963
+ # {
1964
+ # content: "Text",
1965
+ # content_type: "CustomPayload", # accepts CustomPayload, ImageResponseCard, PlainText, SSML
1966
+ # image_response_card: {
1967
+ # title: "AttachmentTitle", # required
1968
+ # subtitle: "AttachmentTitle",
1969
+ # image_url: "AttachmentUrl",
1970
+ # buttons: [
1971
+ # {
1972
+ # text: "ButtonText", # required
1973
+ # value: "ButtonValue", # required
1974
+ # },
1975
+ # ],
1976
+ # },
1977
+ # },
1978
+ # ],
1979
+ # disable_playback: false,
1980
+ # event_id: "EventId",
1981
+ # client_timestamp_millis: 1,
1982
+ # },
1983
+ # audio_input_event: {
1984
+ # audio_chunk: "data",
1985
+ # content_type: "NonEmptyString", # required
1986
+ # event_id: "EventId",
1987
+ # client_timestamp_millis: 1,
1988
+ # },
1989
+ # dtmf_input_event: {
1990
+ # input_character: "DTMFRegex", # required
1991
+ # event_id: "EventId",
1992
+ # client_timestamp_millis: 1,
1993
+ # },
1994
+ # text_input_event: {
1995
+ # text: "Text", # required
1996
+ # event_id: "EventId",
1997
+ # client_timestamp_millis: 1,
1998
+ # },
1999
+ # playback_completion_event: {
2000
+ # event_id: "EventId",
2001
+ # client_timestamp_millis: 1,
2002
+ # },
2003
+ # disconnection_event: {
2004
+ # event_id: "EventId",
2005
+ # client_timestamp_millis: 1,
2006
+ # },
2007
+ # }
2008
+ #
2009
+ # EventStream is an Enumerator of Events.
2010
+ # #event_types #=> Array, returns all modeled event types in the stream
2011
+ #
2012
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversationRequestEventStream AWS API Documentation
2013
+ #
2014
+ class StartConversationRequestEventStream < Enumerator
2015
+
2016
+ def event_types
2017
+ [
2018
+ :configuration_event,
2019
+ :audio_input_event,
2020
+ :dtmf_input_event,
2021
+ :text_input_event,
2022
+ :playback_completion_event,
2023
+ :disconnection_event
2024
+ ]
2025
+ end
2026
+
2027
+ end
2028
+
2029
+ # Represents a stream of events between Amazon Lex and your application.
2030
+ #
2031
+ # EventStream is an Enumerator of Events.
2032
+ # #event_types #=> Array, returns all modeled event types in the stream
2033
+ #
2034
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversationResponseEventStream AWS API Documentation
2035
+ #
2036
+ class StartConversationResponseEventStream < Enumerator
2037
+
2038
+ def event_types
2039
+ [
2040
+ :playback_interruption_event,
2041
+ :transcript_event,
2042
+ :intent_result_event,
2043
+ :text_response_event,
2044
+ :audio_response_event,
2045
+ :heartbeat_event,
2046
+ :access_denied_exception,
2047
+ :resource_not_found_exception,
2048
+ :validation_exception,
2049
+ :throttling_exception,
2050
+ :internal_server_exception,
2051
+ :conflict_exception,
2052
+ :dependency_failed_exception,
2053
+ :bad_gateway_exception
2054
+ ]
2055
+ end
2056
+
2057
+ end
2058
+
2059
+ end
2060
+ end