line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Paws::LexRuntime::PostContentResponse; |
3
|
1
|
|
|
1
|
|
570
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
4
|
|
|
|
|
|
|
has AudioStream => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'audioStream'); |
5
|
|
|
|
|
|
|
has ContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'contentType'); |
6
|
|
|
|
|
|
|
has DialogState => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'dialogState'); |
7
|
|
|
|
|
|
|
has InputTranscript => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'inputTranscript'); |
8
|
|
|
|
|
|
|
has IntentName => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'intentName'); |
9
|
|
|
|
|
|
|
has Message => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'message'); |
10
|
|
|
|
|
|
|
has SessionAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'sessionAttributes'); |
11
|
|
|
|
|
|
|
has Slots => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'slots'); |
12
|
|
|
|
|
|
|
has SlotToElicit => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'slotToElicit'); |
13
|
1
|
|
|
1
|
|
6401
|
use MooseX::ClassAttribute; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
14
|
|
|
|
|
|
|
class_has _stream_param => (is => 'ro', default => 'AudioStream'); |
15
|
|
|
|
|
|
|
has _request_id => (is => 'ro', isa => 'Str'); |
16
|
|
|
|
|
|
|
1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
### main pod documentation begin ### |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Paws::LexRuntime::PostContentResponse |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 AudioStream => Str |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
The prompt (or statement) to convey to the user. This is based on the |
30
|
|
|
|
|
|
|
bot configuration and context. For example, if Amazon Lex did not |
31
|
|
|
|
|
|
|
understand the user intent, it sends the C<clarificationPrompt> |
32
|
|
|
|
|
|
|
configured for the bot. If the intent requires confirmation before |
33
|
|
|
|
|
|
|
taking the fulfillment action, it sends the C<confirmationPrompt>. |
34
|
|
|
|
|
|
|
Another example: Suppose that the Lambda function successfully |
35
|
|
|
|
|
|
|
fulfilled the intent, and sent a message to convey to the user. Then |
36
|
|
|
|
|
|
|
Amazon Lex sends that message in the response. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 ContentType => Str |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Content type as specified in the C<Accept> HTTP header in the request. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 DialogState => Str |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Identifies the current state of the user interaction. Amazon Lex |
47
|
|
|
|
|
|
|
returns one of the following values as C<dialogState>. The client can |
48
|
|
|
|
|
|
|
optionally use this information to customize the user interface. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=over |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item * |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
C<ElicitIntent> - Amazon Lex wants to elicit the user's intent. |
55
|
|
|
|
|
|
|
Consider the following examples: |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
For example, a user might utter an intent ("I want to order a pizza"). |
58
|
|
|
|
|
|
|
If Amazon Lex cannot infer the user intent from this utterance, it will |
59
|
|
|
|
|
|
|
return this dialog state. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
C<ConfirmIntent> - Amazon Lex is expecting a "yes" or "no" response. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
For example, Amazon Lex wants user confirmation before fulfilling an |
66
|
|
|
|
|
|
|
intent. Instead of a simple "yes" or "no" response, a user might |
67
|
|
|
|
|
|
|
respond with additional information. For example, "yes, but make it a |
68
|
|
|
|
|
|
|
thick crust pizza" or "no, I want to order a drink." Amazon Lex can |
69
|
|
|
|
|
|
|
process such additional information (in these examples, update the |
70
|
|
|
|
|
|
|
crust type slot or change the intent from OrderPizza to OrderDrink). |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
C<ElicitSlot> - Amazon Lex is expecting the value of a slot for the |
75
|
|
|
|
|
|
|
current intent. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
For example, suppose that in the response Amazon Lex sends this |
78
|
|
|
|
|
|
|
message: "What size pizza would you like?". A user might reply with the |
79
|
|
|
|
|
|
|
slot value (e.g., "medium"). The user might also provide additional |
80
|
|
|
|
|
|
|
information in the response (e.g., "medium thick crust pizza"). Amazon |
81
|
|
|
|
|
|
|
Lex can process such additional information appropriately. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
C<Fulfilled> - Conveys that the Lambda function has successfully |
86
|
|
|
|
|
|
|
fulfilled the intent. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
C<ReadyForFulfillment> - Conveys that the client has to fulfill the |
91
|
|
|
|
|
|
|
request. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item * |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
C<Failed> - Conveys that the conversation with the user failed. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This can happen for various reasons, including that the user does not |
98
|
|
|
|
|
|
|
provide an appropriate response to prompts from the service (you can |
99
|
|
|
|
|
|
|
configure how many times Amazon Lex can prompt a user for specific |
100
|
|
|
|
|
|
|
information), or if the Lambda function fails to fulfill the intent. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=back |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Valid values are: C<"ElicitIntent">, C<"ConfirmIntent">, C<"ElicitSlot">, C<"Fulfilled">, C<"ReadyForFulfillment">, C<"Failed"> |
106
|
|
|
|
|
|
|
=head2 InputTranscript => Str |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The text used to process the request. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
If the input was an audio stream, the C<inputTranscript> field contains |
111
|
|
|
|
|
|
|
the text extracted from the audio stream. This is the text that is |
112
|
|
|
|
|
|
|
actually processed to recognize intents and slot values. You can use |
113
|
|
|
|
|
|
|
this information to determine if Amazon Lex is correctly processing the |
114
|
|
|
|
|
|
|
audio that you send. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 IntentName => Str |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Current user intent that Amazon Lex is aware of. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head2 Message => Str |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Message to convey to the user. It can come from the bot's configuration |
125
|
|
|
|
|
|
|
or a code hook (Lambda function). If the current intent is not |
126
|
|
|
|
|
|
|
configured with a code hook or if the code hook returned C<Delegate> as |
127
|
|
|
|
|
|
|
the C<dialogAction.type> in its response, then Amazon Lex decides the |
128
|
|
|
|
|
|
|
next course of action and selects an appropriate message from the bot |
129
|
|
|
|
|
|
|
configuration based on the current user interaction context. For |
130
|
|
|
|
|
|
|
example, if Amazon Lex is not able to understand the user input, it |
131
|
|
|
|
|
|
|
uses a clarification prompt message (For more information, see the |
132
|
|
|
|
|
|
|
Error Handling section in the Amazon Lex console). Another example: if |
133
|
|
|
|
|
|
|
the intent requires confirmation before fulfillment, then Amazon Lex |
134
|
|
|
|
|
|
|
uses the confirmation prompt message in the intent configuration. If |
135
|
|
|
|
|
|
|
the code hook returns a message, Amazon Lex passes it as-is in its |
136
|
|
|
|
|
|
|
response to the client. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 SessionAttributes => Str |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Map of key/value pairs representing the session-specific context |
142
|
|
|
|
|
|
|
information. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head2 Slots => Str |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Map of zero or more intent slots (name/value pairs) Amazon Lex detected |
148
|
|
|
|
|
|
|
from the user input during the conversation. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Amazon Lex creates a resolution list containing likely values for a |
151
|
|
|
|
|
|
|
slot. The value that it returns is determined by the |
152
|
|
|
|
|
|
|
C<valueSelectionStrategy> selected when the slot type was created or |
153
|
|
|
|
|
|
|
updated. If C<valueSelectionStrategy> is set to C<ORIGINAL_VALUE>, the |
154
|
|
|
|
|
|
|
value provided by the user is returned, if the user value is similar to |
155
|
|
|
|
|
|
|
the slot values. If C<valueSelectionStrategy> is set to |
156
|
|
|
|
|
|
|
C<TOP_RESOLUTION> Amazon Lex returns the first value in the resolution |
157
|
|
|
|
|
|
|
list or, if there is no resolution list, null. If you don't specify a |
158
|
|
|
|
|
|
|
C<valueSelectionStrategy>, the default is C<ORIGINAL_VALUE>. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head2 SlotToElicit => Str |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
If the C<dialogState> value is C<ElicitSlot>, returns the name of the |
164
|
|
|
|
|
|
|
slot for which Amazon Lex is eliciting a value. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 _request_id => Str |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
171
|
|
|
|
|
|
|
|