« blib/lib/Paws/LexRuntimeV2/RecognizeTextResponse.pm
↑ Summary
blib/lib/Paws/LexRuntimeV2/RecognizeUtteranceResponse.pm »
| 1 | |||
| 2 | package Paws::LexRuntimeV2::RecognizeUtterance; | ||
| 3 | use Moose; | ||
| 4 | has BotAliasId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botAliasId', required => 1); | ||
| 5 | has BotId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botId', required => 1); | ||
| 6 | has InputStream => (is => 'ro', isa => 'Str', traits => ['ParamInBody']); | ||
| 7 | has LocaleId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'localeId', required => 1); | ||
| 8 | has RequestAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'x-amz-lex-request-attributes'); | ||
| 9 | has RequestContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'Content-Type', required => 1); | ||
| 10 | has ResponseContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'Response-Content-Type'); | ||
| 11 | has SessionId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'sessionId', required => 1); | ||
| 12 | has SessionState => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'x-amz-lex-session-state'); | ||
| 13 | |||
| 14 | use MooseX::ClassAttribute; | ||
| 15 | class_has _stream_param => (is => 'ro', default => 'InputStream'); | ||
| 16 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'RecognizeUtterance'); | ||
| 17 | class_has _api_uri => (isa => 'Str', is => 'ro', default => '/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance'); | ||
| 18 | class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST'); | ||
| 19 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::LexRuntimeV2::RecognizeUtteranceResponse'); | ||
| 20 | 1; | ||
| 21 | |||
| 22 | ### main pod documentation begin ### | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Paws::LexRuntimeV2::RecognizeUtterance - Arguments for method RecognizeUtterance on L<Paws::LexRuntimeV2> | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | This class represents the parameters used for calling the method RecognizeUtterance on the | ||
| 31 | L<Amazon Lex Runtime V2|Paws::LexRuntimeV2> service. Use the attributes of this class | ||
| 32 | as arguments to method RecognizeUtterance. | ||
| 33 | |||
| 34 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RecognizeUtterance. | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | my $runtime-v2-lex = Paws->service('LexRuntimeV2'); | ||
| 39 | my $RecognizeUtteranceResponse = $runtime - v2 -lex->RecognizeUtterance( | ||
| 40 | BotAliasId => 'MyBotAliasIdentifier', | ||
| 41 | BotId => 'MyBotIdentifier', | ||
| 42 | LocaleId => 'MyLocaleId', | ||
| 43 | RequestContentType => 'MyNonEmptyString', | ||
| 44 | SessionId => 'MySessionId', | ||
| 45 | InputStream => 'BlobBlobStream', # OPTIONAL | ||
| 46 | RequestAttributes => 'MySensitiveNonEmptyString', # OPTIONAL | ||
| 47 | ResponseContentType => 'MyNonEmptyString', # OPTIONAL | ||
| 48 | SessionState => 'MySensitiveNonEmptyString', # OPTIONAL | ||
| 49 | ); | ||
| 50 | |||
| 51 | # Results: | ||
| 52 | my $AudioStream = $RecognizeUtteranceResponse->AudioStream; | ||
| 53 | my $ContentType = $RecognizeUtteranceResponse->ContentType; | ||
| 54 | my $InputMode = $RecognizeUtteranceResponse->InputMode; | ||
| 55 | my $InputTranscript = $RecognizeUtteranceResponse->InputTranscript; | ||
| 56 | my $Interpretations = $RecognizeUtteranceResponse->Interpretations; | ||
| 57 | my $Messages = $RecognizeUtteranceResponse->Messages; | ||
| 58 | my $RequestAttributes = $RecognizeUtteranceResponse->RequestAttributes; | ||
| 59 | my $SessionId = $RecognizeUtteranceResponse->SessionId; | ||
| 60 | my $SessionState = $RecognizeUtteranceResponse->SessionState; | ||
| 61 | |||
| 62 | # Returns a L<Paws::LexRuntimeV2::RecognizeUtteranceResponse> object. | ||
| 63 | |||
| 64 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 65 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/runtime-v2-lex/RecognizeUtterance> | ||
| 66 | |||
| 67 | =head1 ATTRIBUTES | ||
| 68 | |||
| 69 | |||
| 70 | =head2 B<REQUIRED> BotAliasId => Str | ||
| 71 | |||
| 72 | The alias identifier in use for the bot that should receive the | ||
| 73 | request. | ||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | =head2 B<REQUIRED> BotId => Str | ||
| 78 | |||
| 79 | The identifier of the bot that should receive the request. | ||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | =head2 InputStream => Str | ||
| 84 | |||
| 85 | User input in PCM or Opus audio format or text format as described in | ||
| 86 | the C<requestContentType> parameter. | ||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | =head2 B<REQUIRED> LocaleId => Str | ||
| 91 | |||
| 92 | The locale where the session is in use. | ||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | =head2 RequestAttributes => Str | ||
| 97 | |||
| 98 | Request-specific information passed between the client application and | ||
| 99 | Amazon Lex V2 | ||
| 100 | |||
| 101 | The namespace C<x-amz-lex:> is reserved for special attributes. Don't | ||
| 102 | create any request attributes for prefix C<x-amz-lex:>. | ||
| 103 | |||
| 104 | The C<requestAttributes> field must be compressed using gzip and then | ||
| 105 | base64 encoded before sending to Amazon Lex V2. | ||
| 106 | |||
| 107 | |||
| 108 | |||
| 109 | =head2 B<REQUIRED> RequestContentType => Str | ||
| 110 | |||
| 111 | Indicates the format for audio input or that the content is text. The | ||
| 112 | header must start with one of the following prefixes: | ||
| 113 | |||
| 114 | =over | ||
| 115 | |||
| 116 | =item * | ||
| 117 | |||
| 118 | PCM format, audio data must be in little-endian byte order. | ||
| 119 | |||
| 120 | =over | ||
| 121 | |||
| 122 | =item * | ||
| 123 | |||
| 124 | audio/l16; rate=16000; channels=1 | ||
| 125 | |||
| 126 | =item * | ||
| 127 | |||
| 128 | audio/x-l16; sample-rate=16000; channel-count=1 | ||
| 129 | |||
| 130 | =item * | ||
| 131 | |||
| 132 | audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; | ||
| 133 | is-big-endian=false | ||
| 134 | |||
| 135 | =back | ||
| 136 | |||
| 137 | =item * | ||
| 138 | |||
| 139 | Opus format | ||
| 140 | |||
| 141 | =over | ||
| 142 | |||
| 143 | =item * | ||
| 144 | |||
| 145 | audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 | ||
| 146 | |||
| 147 | =back | ||
| 148 | |||
| 149 | =item * | ||
| 150 | |||
| 151 | Text format | ||
| 152 | |||
| 153 | =over | ||
| 154 | |||
| 155 | =item * | ||
| 156 | |||
| 157 | text/plain; charset=utf-8 | ||
| 158 | |||
| 159 | =back | ||
| 160 | |||
| 161 | =back | ||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | =head2 ResponseContentType => Str | ||
| 167 | |||
| 168 | The message that Amazon Lex V2 returns in the response can be either | ||
| 169 | text or speech based on the C<responseContentType> value. | ||
| 170 | |||
| 171 | =over | ||
| 172 | |||
| 173 | =item * | ||
| 174 | |||
| 175 | If the value is C<text/plain;charset=utf-8>, Amazon Lex V2 returns text | ||
| 176 | in the response. | ||
| 177 | |||
| 178 | =item * | ||
| 179 | |||
| 180 | If the value begins with C<audio/>, Amazon Lex V2 returns speech in the | ||
| 181 | response. Amazon Lex V2 uses Amazon Polly to generate the speech using | ||
| 182 | the configuration that you specified in the C<requestContentType> | ||
| 183 | parameter. For example, if you specify C<audio/mpeg> as the value, | ||
| 184 | Amazon Lex V2 returns speech in the MPEG format. | ||
| 185 | |||
| 186 | =item * | ||
| 187 | |||
| 188 | If the value is C<audio/pcm>, the speech returned is C<audio/pcm> at 16 | ||
| 189 | KHz in 16-bit, little-endian format. | ||
| 190 | |||
| 191 | =item * | ||
| 192 | |||
| 193 | The following are the accepted values: | ||
| 194 | |||
| 195 | =over | ||
| 196 | |||
| 197 | =item * | ||
| 198 | |||
| 199 | audio/mpeg | ||
| 200 | |||
| 201 | =item * | ||
| 202 | |||
| 203 | audio/ogg | ||
| 204 | |||
| 205 | =item * | ||
| 206 | |||
| 207 | audio/pcm (16 KHz) | ||
| 208 | |||
| 209 | =item * | ||
| 210 | |||
| 211 | audio/* (defaults to mpeg) | ||
| 212 | |||
| 213 | =item * | ||
| 214 | |||
| 215 | text/plain; charset=utf-8 | ||
| 216 | |||
| 217 | =back | ||
| 218 | |||
| 219 | =back | ||
| 220 | |||
| 221 | |||
| 222 | |||
| 223 | |||
| 224 | =head2 B<REQUIRED> SessionId => Str | ||
| 225 | |||
| 226 | The identifier of the session in use. | ||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | =head2 SessionState => Str | ||
| 231 | |||
| 232 | Sets the state of the session with the user. You can use this to set | ||
| 233 | the current intent, attributes, context, and dialog action. Use the | ||
| 234 | dialog action to determine the next step that Amazon Lex V2 should use | ||
| 235 | in the conversation with the user. | ||
| 236 | |||
| 237 | The C<sessionState> field must be compressed using gzip and then base64 | ||
| 238 | encoded before sending to Amazon Lex V2. | ||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | |||
| 243 | =head1 SEE ALSO | ||
| 244 | |||
| 245 | This class forms part of L<Paws>, documenting arguments for method RecognizeUtterance in L<Paws::LexRuntimeV2> | ||
| 246 | |||
| 247 | =head1 BUGS and CONTRIBUTIONS | ||
| 248 | |||
| 249 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 250 | |||
| 251 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 252 | |||
| 253 | =cut | ||
| 254 |