SDK for PHP 3.x

Client: Aws\LexRuntimeV2\LexRuntimeV2Client
Service ID: runtime.lex.v2
Version: 2020-08-07

This page describes the parameters and results for the operations of the Amazon Lex Runtime V2 (2020-08-07), and shows how to use the Aws\LexRuntimeV2\LexRuntimeV2Client object to call the described operations. This documentation is specific to the 2020-08-07 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

DeleteSession ( array $params = [] )
Removes session information for a specified bot, alias, and user ID.
GetSession ( array $params = [] )
Returns session information for a specified bot, alias, and user.
PutSession ( array $params = [] )
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
RecognizeText ( array $params = [] )
Sends user input to Amazon Lex V2.
RecognizeUtterance ( array $params = [] )
Sends user input to Amazon Lex V2.

Operations

DeleteSession

$result = $client->deleteSession([/* ... */]);
$promise = $client->deleteSessionAsync([/* ... */]);

Removes session information for a specified bot, alias, and user ID.

You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.

You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.

If you specify a bot or alias ID that doesn't exist, you receive a BadRequestException.

If the locale doesn't exist in the bot, or if the locale hasn't been enables for the alias, you receive a BadRequestException.

Parameter Syntax

$result = $client->deleteSession([
    'botAliasId' => '<string>', // REQUIRED
    'botId' => '<string>', // REQUIRED
    'localeId' => '<string>', // REQUIRED
    'sessionId' => '<string>', // REQUIRED
]);

Parameter Details

Members
botAliasId
Required: Yes
Type: string

The alias identifier in use for the bot that contains the session data.

botId
Required: Yes
Type: string

The identifier of the bot that contains the session data.

localeId
Required: Yes
Type: string

The locale where the session is in use.

sessionId
Required: Yes
Type: string

The identifier of the session to delete.

Result Syntax

[
    'botAliasId' => '<string>',
    'botId' => '<string>',
    'localeId' => '<string>',
    'sessionId' => '<string>',
]

Result Details

Members
botAliasId
Type: string

The alias identifier in use for the bot that contained the session data.

botId
Type: string

The identifier of the bot that contained the session data.

localeId
Type: string

The locale where the session was used.

sessionId
Type: string

The identifier of the deleted session.

Errors

AccessDeniedException:

ResourceNotFoundException:

ValidationException:

ThrottlingException:

InternalServerException:

ConflictException:

GetSession

$result = $client->getSession([/* ... */]);
$promise = $client->getSessionAsync([/* ... */]);

Returns session information for a specified bot, alias, and user.

For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.

If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns a BadRequestException. If the locale doesn't exist or is not enabled for the alias, you receive a BadRequestException.

Parameter Syntax

$result = $client->getSession([
    'botAliasId' => '<string>', // REQUIRED
    'botId' => '<string>', // REQUIRED
    'localeId' => '<string>', // REQUIRED
    'sessionId' => '<string>', // REQUIRED
]);

Parameter Details

Members
botAliasId
Required: Yes
Type: string

The alias identifier in use for the bot that contains the session data.

botId
Required: Yes
Type: string

The identifier of the bot that contains the session data.

localeId
Required: Yes
Type: string

The locale where the session is in use.

sessionId
Required: Yes
Type: string

The identifier of the session to return.

Result Syntax

[
    'interpretations' => [
        [
            'intent' => [
                'confirmationState' => 'Confirmed|Denied|None',
                'name' => '<string>',
                'slots' => [
                    '<NonEmptyString>' => [
                        'shape' => 'Scalar|List|Composite',
                        'subSlots' => [...], // RECURSIVE
                        'value' => [
                            'interpretedValue' => '<string>',
                            'originalValue' => '<string>',
                            'resolvedValues' => ['<string>', ...],
                        ],
                        'values' => [
                            [...], // RECURSIVE
                            // ...
                        ],
                    ],
                    // ...
                ],
                'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
            ],
            'interpretationSource' => 'Bedrock|Lex',
            'nluConfidence' => [
                'score' => <float>,
            ],
            'sentimentResponse' => [
                'sentiment' => 'MIXED|NEGATIVE|NEUTRAL|POSITIVE',
                'sentimentScore' => [
                    'mixed' => <float>,
                    'negative' => <float>,
                    'neutral' => <float>,
                    'positive' => <float>,
                ],
            ],
        ],
        // ...
    ],
    'messages' => [
        [
            'content' => '<string>',
            'contentType' => 'CustomPayload|ImageResponseCard|PlainText|SSML',
            'imageResponseCard' => [
                'buttons' => [
                    [
                        'text' => '<string>',
                        'value' => '<string>',
                    ],
                    // ...
                ],
                'imageUrl' => '<string>',
                'subtitle' => '<string>',
                'title' => '<string>',
            ],
        ],
        // ...
    ],
    'sessionId' => '<string>',
    'sessionState' => [
        'activeContexts' => [
            [
                'contextAttributes' => ['<string>', ...],
                'name' => '<string>',
                'timeToLive' => [
                    'timeToLiveInSeconds' => <integer>,
                    'turnsToLive' => <integer>,
                ],
            ],
            // ...
        ],
        'dialogAction' => [
            'slotElicitationStyle' => 'Default|SpellByLetter|SpellByWord',
            'slotToElicit' => '<string>',
            'subSlotToElicit' => [
                'name' => '<string>',
                'subSlotToElicit' => [...], // RECURSIVE
            ],
            'type' => 'Close|ConfirmIntent|Delegate|ElicitIntent|ElicitSlot|None',
        ],
        'intent' => [
            'confirmationState' => 'Confirmed|Denied|None',
            'name' => '<string>',
            'slots' => [
                '<NonEmptyString>' => [
                    'shape' => 'Scalar|List|Composite',
                    'subSlots' => [...], // RECURSIVE
                    'value' => [
                        'interpretedValue' => '<string>',
                        'originalValue' => '<string>',
                        'resolvedValues' => ['<string>', ...],
                    ],
                    'values' => [
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                // ...
            ],
            'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
        ],
        'originatingRequestId' => '<string>',
        'runtimeHints' => [
            'slotHints' => [
                '<Name>' => [
                    '<Name>' => [
                        'runtimeHintValues' => [
                            [
                                'phrase' => '<string>',
                            ],
                            // ...
                        ],
                        'subSlotHints' => [...], // RECURSIVE
                    ],
                    // ...
                ],
                // ...
            ],
        ],
        'sessionAttributes' => ['<string>', ...],
    ],
]

Result Details

Members
interpretations
Type: Array of Interpretation structures

A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.

messages
Type: Array of Message structures

A list of messages that were last sent to the user. The messages are ordered based on the order that your returned the messages from your Lambda function or the order that messages are defined in the bot.

sessionId
Type: string

The identifier of the returned session.

sessionState
Type: SessionState structure

Represents the current state of the dialog between the user and the bot.

You can use this to determine the progress of the conversation and what the next action might be.

Errors

AccessDeniedException:

ResourceNotFoundException:

ValidationException:

ThrottlingException:

InternalServerException:

PutSession

$result = $client->putSession([/* ... */]);
$promise = $client->putSessionAsync([/* ... */]);

Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.

Parameter Syntax

$result = $client->putSession([
    'botAliasId' => '<string>', // REQUIRED
    'botId' => '<string>', // REQUIRED
    'localeId' => '<string>', // REQUIRED
    'messages' => [
        [
            'content' => '<string>',
            'contentType' => 'CustomPayload|ImageResponseCard|PlainText|SSML', // REQUIRED
            'imageResponseCard' => [
                'buttons' => [
                    [
                        'text' => '<string>', // REQUIRED
                        'value' => '<string>', // REQUIRED
                    ],
                    // ...
                ],
                'imageUrl' => '<string>',
                'subtitle' => '<string>',
                'title' => '<string>', // REQUIRED
            ],
        ],
        // ...
    ],
    'requestAttributes' => ['<string>', ...],
    'responseContentType' => '<string>',
    'sessionId' => '<string>', // REQUIRED
    'sessionState' => [ // REQUIRED
        'activeContexts' => [
            [
                'contextAttributes' => ['<string>', ...], // REQUIRED
                'name' => '<string>', // REQUIRED
                'timeToLive' => [ // REQUIRED
                    'timeToLiveInSeconds' => <integer>, // REQUIRED
                    'turnsToLive' => <integer>, // REQUIRED
                ],
            ],
            // ...
        ],
        'dialogAction' => [
            'slotElicitationStyle' => 'Default|SpellByLetter|SpellByWord',
            'slotToElicit' => '<string>',
            'subSlotToElicit' => [
                'name' => '<string>', // REQUIRED
                'subSlotToElicit' => [...], // RECURSIVE
            ],
            'type' => 'Close|ConfirmIntent|Delegate|ElicitIntent|ElicitSlot|None', // REQUIRED
        ],
        'intent' => [
            'confirmationState' => 'Confirmed|Denied|None',
            'name' => '<string>', // REQUIRED
            'slots' => [
                '<NonEmptyString>' => [
                    'shape' => 'Scalar|List|Composite',
                    'subSlots' => [...], // RECURSIVE
                    'value' => [
                        'interpretedValue' => '<string>', // REQUIRED
                        'originalValue' => '<string>',
                        'resolvedValues' => ['<string>', ...],
                    ],
                    'values' => [
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                // ...
            ],
            'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
        ],
        'originatingRequestId' => '<string>',
        'runtimeHints' => [
            'slotHints' => [
                '<Name>' => [
                    '<Name>' => [
                        'runtimeHintValues' => [
                            [
                                'phrase' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                        'subSlotHints' => [...], // RECURSIVE
                    ],
                    // ...
                ],
                // ...
            ],
        ],
        'sessionAttributes' => ['<string>', ...],
    ],
]);

Parameter Details

Members
botAliasId
Required: Yes
Type: string

The alias identifier of the bot that receives the session data.

botId
Required: Yes
Type: string

The identifier of the bot that receives the session data.

localeId
Required: Yes
Type: string

The locale where the session is in use.

messages
Type: Array of Message structures

A list of messages to send to the user. Messages are sent in the order that they are defined in the list.

requestAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

Request-specific information passed between Amazon Lex V2 and the client application.

The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes with the prefix x-amz-lex:.

responseContentType
Type: string

The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter.

  • If the value is text/plain; charset=utf-8, Amazon Lex V2 returns text in the response.

sessionId
Required: Yes
Type: string

The identifier of the session that receives the session data.

sessionState
Required: Yes
Type: SessionState structure

Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.

Result Syntax

[
    'audioStream' => <string || resource || Psr\Http\Message\StreamInterface>,
    'contentType' => '<string>',
    'messages' => '<string>',
    'requestAttributes' => '<string>',
    'sessionId' => '<string>',
    'sessionState' => '<string>',
]

Result Details

Members
audioStream
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

If the requested content type was audio, the audio version of the message to convey to the user.

contentType
Type: string

The type of response. Same as the type specified in the responseContentType field in the request.

messages
Type: string

A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.

requestAttributes
Type: string

A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the requestAttribute parameter in the call to the PutSession operation.

sessionId
Type: string

The identifier of the session that received the data.

sessionState
Type: string

A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.

Errors

AccessDeniedException:

ResourceNotFoundException:

ValidationException:

ThrottlingException:

InternalServerException:

ConflictException:

DependencyFailedException:

BadGatewayException:

RecognizeText

$result = $client->recognizeText([/* ... */]);
$promise = $client->recognizeTextAsync([/* ... */]);

Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.

In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.

If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.

  • Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.

  • Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.

  • Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.

For more information, see Completion message.

Parameter Syntax

$result = $client->recognizeText([
    'botAliasId' => '<string>', // REQUIRED
    'botId' => '<string>', // REQUIRED
    'localeId' => '<string>', // REQUIRED
    'requestAttributes' => ['<string>', ...],
    'sessionId' => '<string>', // REQUIRED
    'sessionState' => [
        'activeContexts' => [
            [
                'contextAttributes' => ['<string>', ...], // REQUIRED
                'name' => '<string>', // REQUIRED
                'timeToLive' => [ // REQUIRED
                    'timeToLiveInSeconds' => <integer>, // REQUIRED
                    'turnsToLive' => <integer>, // REQUIRED
                ],
            ],
            // ...
        ],
        'dialogAction' => [
            'slotElicitationStyle' => 'Default|SpellByLetter|SpellByWord',
            'slotToElicit' => '<string>',
            'subSlotToElicit' => [
                'name' => '<string>', // REQUIRED
                'subSlotToElicit' => [...], // RECURSIVE
            ],
            'type' => 'Close|ConfirmIntent|Delegate|ElicitIntent|ElicitSlot|None', // REQUIRED
        ],
        'intent' => [
            'confirmationState' => 'Confirmed|Denied|None',
            'name' => '<string>', // REQUIRED
            'slots' => [
                '<NonEmptyString>' => [
                    'shape' => 'Scalar|List|Composite',
                    'subSlots' => [...], // RECURSIVE
                    'value' => [
                        'interpretedValue' => '<string>', // REQUIRED
                        'originalValue' => '<string>',
                        'resolvedValues' => ['<string>', ...],
                    ],
                    'values' => [
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                // ...
            ],
            'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
        ],
        'originatingRequestId' => '<string>',
        'runtimeHints' => [
            'slotHints' => [
                '<Name>' => [
                    '<Name>' => [
                        'runtimeHintValues' => [
                            [
                                'phrase' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                        'subSlotHints' => [...], // RECURSIVE
                    ],
                    // ...
                ],
                // ...
            ],
        ],
        'sessionAttributes' => ['<string>', ...],
    ],
    'text' => '<string>', // REQUIRED
]);

Parameter Details

Members
botAliasId
Required: Yes
Type: string

The alias identifier in use for the bot that processes the request.

botId
Required: Yes
Type: string

The identifier of the bot that processes the request.

localeId
Required: Yes
Type: string

The locale where the session is in use.

requestAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

Request-specific information passed between the client application and Amazon Lex V2

The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes with the prefix x-amz-lex:.

sessionId
Required: Yes
Type: string

The identifier of the user session that is having the conversation.

sessionState
Type: SessionState structure

The current state of the dialog between the user and the bot.

text
Required: Yes
Type: string

The text that the user entered. Amazon Lex V2 interprets this text.

Result Syntax

[
    'interpretations' => [
        [
            'intent' => [
                'confirmationState' => 'Confirmed|Denied|None',
                'name' => '<string>',
                'slots' => [
                    '<NonEmptyString>' => [
                        'shape' => 'Scalar|List|Composite',
                        'subSlots' => [...], // RECURSIVE
                        'value' => [
                            'interpretedValue' => '<string>',
                            'originalValue' => '<string>',
                            'resolvedValues' => ['<string>', ...],
                        ],
                        'values' => [
                            [...], // RECURSIVE
                            // ...
                        ],
                    ],
                    // ...
                ],
                'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
            ],
            'interpretationSource' => 'Bedrock|Lex',
            'nluConfidence' => [
                'score' => <float>,
            ],
            'sentimentResponse' => [
                'sentiment' => 'MIXED|NEGATIVE|NEUTRAL|POSITIVE',
                'sentimentScore' => [
                    'mixed' => <float>,
                    'negative' => <float>,
                    'neutral' => <float>,
                    'positive' => <float>,
                ],
            ],
        ],
        // ...
    ],
    'messages' => [
        [
            'content' => '<string>',
            'contentType' => 'CustomPayload|ImageResponseCard|PlainText|SSML',
            'imageResponseCard' => [
                'buttons' => [
                    [
                        'text' => '<string>',
                        'value' => '<string>',
                    ],
                    // ...
                ],
                'imageUrl' => '<string>',
                'subtitle' => '<string>',
                'title' => '<string>',
            ],
        ],
        // ...
    ],
    'recognizedBotMember' => [
        'botId' => '<string>',
        'botName' => '<string>',
    ],
    'requestAttributes' => ['<string>', ...],
    'sessionId' => '<string>',
    'sessionState' => [
        'activeContexts' => [
            [
                'contextAttributes' => ['<string>', ...],
                'name' => '<string>',
                'timeToLive' => [
                    'timeToLiveInSeconds' => <integer>,
                    'turnsToLive' => <integer>,
                ],
            ],
            // ...
        ],
        'dialogAction' => [
            'slotElicitationStyle' => 'Default|SpellByLetter|SpellByWord',
            'slotToElicit' => '<string>',
            'subSlotToElicit' => [
                'name' => '<string>',
                'subSlotToElicit' => [...], // RECURSIVE
            ],
            'type' => 'Close|ConfirmIntent|Delegate|ElicitIntent|ElicitSlot|None',
        ],
        'intent' => [
            'confirmationState' => 'Confirmed|Denied|None',
            'name' => '<string>',
            'slots' => [
                '<NonEmptyString>' => [
                    'shape' => 'Scalar|List|Composite',
                    'subSlots' => [...], // RECURSIVE
                    'value' => [
                        'interpretedValue' => '<string>',
                        'originalValue' => '<string>',
                        'resolvedValues' => ['<string>', ...],
                    ],
                    'values' => [
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                // ...
            ],
            'state' => 'Failed|Fulfilled|InProgress|ReadyForFulfillment|Waiting|FulfillmentInProgress',
        ],
        'originatingRequestId' => '<string>',
        'runtimeHints' => [
            'slotHints' => [
                '<Name>' => [
                    '<Name>' => [
                        'runtimeHintValues' => [
                            [
                                'phrase' => '<string>',
                            ],
                            // ...
                        ],
                        'subSlotHints' => [...], // RECURSIVE
                    ],
                    // ...
                ],
                // ...
            ],
        ],
        'sessionAttributes' => ['<string>', ...],
    ],
]

Result Details

Members
interpretations
Type: Array of Interpretation structures

A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

Each interpretation includes the intent, a score that indicates now confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.

messages
Type: Array of Message structures

A list of messages last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.

recognizedBotMember
Type: RecognizedBotMember structure

The bot member that recognized the text.

requestAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

The attributes sent in the request.

sessionId
Type: string

The identifier of the session in use.

sessionState
Type: SessionState structure

Represents the current state of the dialog between the user and the bot.

Use this to determine the progress of the conversation and what the next action may be.

Errors

AccessDeniedException:

ResourceNotFoundException:

ValidationException:

ThrottlingException:

InternalServerException:

ConflictException:

DependencyFailedException:

BadGatewayException:

RecognizeUtterance

$result = $client->recognizeUtterance([/* ... */]);
$promise = $client->recognizeUtteranceAsync([/* ... */]);

Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.

The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.

  • requestAttributes

  • sessionState

The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.

  • inputTranscript

  • interpretations

  • messages

  • requestAttributes

  • sessionState

The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.

If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.

  • Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.

  • Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.

  • Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.

For more information, see Completion message.

Parameter Syntax

$result = $client->recognizeUtterance([
    'botAliasId' => '<string>', // REQUIRED
    'botId' => '<string>', // REQUIRED
    'inputStream' => <string || resource || Psr\Http\Message\StreamInterface>,
    'localeId' => '<string>', // REQUIRED
    'requestAttributes' => '<string>',
    'requestContentType' => '<string>', // REQUIRED
    'responseContentType' => '<string>',
    'sessionId' => '<string>', // REQUIRED
    'sessionState' => '<string>',
]);

Parameter Details

Members
botAliasId
Required: Yes
Type: string

The alias identifier in use for the bot that should receive the request.

botId
Required: Yes
Type: string

The identifier of the bot that should receive the request.

inputStream
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

User input in PCM or Opus audio format or text format as described in the requestContentType parameter.

localeId
Required: Yes
Type: string

The locale where the session is in use.

requestAttributes
Type: string

Request-specific information passed between the client application and Amazon Lex V2

The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes for prefix x-amz-lex:.

The requestAttributes field must be compressed using gzip and then base64 encoded before sending to Amazon Lex V2.

requestContentType
Required: Yes
Type: string

Indicates the format for audio input or that the content is text. The header must start with one of the following prefixes:

  • PCM format, audio data must be in little-endian byte order.

    • audio/l16; rate=16000; channels=1

    • audio/x-l16; sample-rate=16000; channel-count=1

    • audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

  • Opus format

    • audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4

  • Text format

    • text/plain; charset=utf-8

responseContentType
Type: string

The message that Amazon Lex V2 returns in the response can be either text or speech based on the responseContentType value.

  • If the value is text/plain;charset=utf-8, Amazon Lex V2 returns text in the response.

  • If the value begins with audio/, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses Amazon Polly to generate the speech using the configuration that you specified in the responseContentType parameter. For example, if you specify audio/mpeg as the value, Amazon Lex V2 returns speech in the MPEG format.

  • If the value is audio/pcm, the speech returned is audio/pcm at 16 KHz in 16-bit, little-endian format.

  • The following are the accepted values:

    • audio/mpeg

    • audio/ogg

    • audio/pcm (16 KHz)

    • audio/* (defaults to mpeg)

    • text/plain; charset=utf-8

sessionId
Required: Yes
Type: string

The identifier of the session in use.

sessionState
Type: string

Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.

The sessionState field must be compressed using gzip and then base64 encoded before sending to Amazon Lex V2.

Result Syntax

[
    'audioStream' => <string || resource || Psr\Http\Message\StreamInterface>,
    'contentType' => '<string>',
    'inputMode' => '<string>',
    'inputTranscript' => '<string>',
    'interpretations' => '<string>',
    'messages' => '<string>',
    'recognizedBotMember' => '<string>',
    'requestAttributes' => '<string>',
    'sessionId' => '<string>',
    'sessionState' => '<string>',
]

Result Details

Members
audioStream
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the clarificationPrompt configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.

contentType
Type: string

Content type as specified in the responseContentType in the request.

inputMode
Type: string

Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.

inputTranscript
Type: string

The text used to process the request.

If the input was an audio stream, the inputTranscript field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.

The inputTranscript field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.

interpretations
Type: string

A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.

The interpretations field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.

messages
Type: string

A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.

The messages field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.

recognizedBotMember
Type: string

The bot member that recognized the utterance.

requestAttributes
Type: string

The attributes sent in the request.

The requestAttributes field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.

sessionId
Type: string

The identifier of the session in use.

sessionState
Type: string

Represents the current state of the dialog between the user and the bot.

Use this to determine the progress of the conversation and what the next action might be.

The sessionState field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.

Errors

AccessDeniedException:

ResourceNotFoundException:

ValidationException:

ThrottlingException:

InternalServerException:

ConflictException:

DependencyFailedException:

BadGatewayException:

Shapes

AccessDeniedException

Description

Members
message
Required: Yes
Type: string

ActiveContext

Description

Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.

Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.

Members
contextAttributes
Required: Yes
Type: Associative array of custom strings keys (ParameterName) to strings

A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.

If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.

name
Required: Yes
Type: string

The name of the context.

timeToLive
Required: Yes
Type: ActiveContextTimeToLive structure

Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.

ActiveContextTimeToLive

Description

The time that a context is active. You can specify the time to live in seconds or in conversation turns.

Members
timeToLiveInSeconds
Required: Yes
Type: int

The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).

turnsToLive
Required: Yes
Type: int

The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.

AudioInputEvent

Description

Represents a chunk of audio sent from the client application to Amazon Lex V2. The audio is all or part of an utterance from the user.

Amazon Lex V2 accumulates audio chunks until it recognizes a natural pause in speech before processing the input.

Members
audioChunk
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

An encoded stream of audio.

clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

contentType
Required: Yes
Type: string

The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit mono-channel little-endian format. The value of the field should be:

audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

AudioResponseEvent

Description

An event sent from Amazon Lex V2 to your client application containing audio to play to the user.

Members
audioChunk
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

A chunk of the audio to play.

contentType
Type: string

The encoding of the audio chunk. This is the same as the encoding configure in the contentType field of the ConfigurationEvent.

eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

BadGatewayException

Description

Members
message
Required: Yes
Type: string

Button

Description

A button that appears on a response card show to the user.

Members
text
Required: Yes
Type: string

The text that is displayed on the button.

value
Required: Yes
Type: string

The value returned to Amazon Lex V2 when a user chooses the button.

ConfidenceScore

Description

Provides a score that indicates the confidence that Amazon Lex V2 has that an intent is the one that satisfies the user's intent.

Members
score
Type: double

A score that indicates how confident Amazon Lex V2 is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.

ConfigurationEvent

Description

The initial event sent from the application to Amazon Lex V2 to configure the conversation, including session and request attributes and the response content type.

Members
clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

disablePlayback
Type: boolean

Determines whether Amazon Lex V2 should send audio responses to the client application.

Set this field to false when the client is operating in a playback mode where audio responses are played to the user. If the client isn't operating in playback mode, such as a text chat application, set this to true so that Amazon Lex V2 doesn't wait for the prompt to finish playing on the client.

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

requestAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

Request-specific information passed between the client application and Amazon Lex V2.

The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes for prefix x-amz-lex:.

responseContentType
Required: Yes
Type: string

The message that Amazon Lex V2 returns in the response can be either text or speech based on the responseContentType value.

  • If the value is text/plain;charset=utf-8, Amazon Lex V2 returns text in the response.

  • If the value begins with audio/, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses Amazon Polly to generate the speech using the configuration that you specified in the requestContentType parameter. For example, if you specify audio/mpeg as the value, Amazon Lex V2 returns speech in the MPEG format.

  • If the value is audio/pcm, the speech returned is audio/pcm in 16-bit, little-endian format.

  • The following are the accepted values:

    • audio/mpeg

    • audio/ogg

    • audio/pcm

    • audio/* (defaults to mpeg)

    • text/plain; charset=utf-8

sessionState
Type: SessionState structure

The state of the user's session with Amazon Lex V2.

welcomeMessages
Type: Array of Message structures

A list of messages to send to the user.

If you set the welcomeMessage field, you must also set the DialogAction structure's type field.

ConflictException

Description

Members
message
Required: Yes
Type: string

DTMFInputEvent

Description

A DTMF character sent from the client application. DTMF characters are typically sent from a phone keypad to represent numbers. For example, you can have Amazon Lex V2 process a credit card number input from a phone.

Members
clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

inputCharacter
Required: Yes
Type: string

The DTMF character that the user pressed. The allowed characters are A - D, 0 - 9, # and *.

DependencyFailedException

Description

Members
message
Required: Yes
Type: string

DialogAction

Description

The next action that Amazon Lex V2 should take.

Members
slotElicitationStyle
Type: string

Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.

  • Spell by letter - "b" "o" "b"

  • Spell by word - "b as in boy" "o as in oscar" "b as in boy"

For more information, see Using spelling to enter slot values .

slotToElicit
Type: string

The name of the slot that should be elicited from the user.

subSlotToElicit
Type: ElicitSubSlot structure

The name of the constituent sub slot of the composite slot specified in slotToElicit that should be elicited from the user.

type
Required: Yes
Type: string

The next action that the bot should take in its interaction with the user. The following values are possible:

  • Close – Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.

  • ConfirmIntent – The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"

  • Delegate – The next action is determined by Amazon Lex V2.

  • ElicitIntent – The next action is to elicit an intent from the user.

  • ElicitSlot – The next action is to elicit a slot value from the user.

DisconnectionEvent

Description

A notification from the client that it is disconnecting from Amazon Lex V2. Sending a DisconnectionEvent event is optional, but can help identify a conversation in logs.

Members
clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

ElicitSubSlot

Description

The specific constituent sub slot of the composite slot to elicit in dialog action.

Members
name
Required: Yes
Type: string

The name of the slot that should be elicited from the user.

subSlotToElicit
Type: ElicitSubSlot structure

The field is not supported.

HeartbeatEvent

Description

Event that Amazon Lex V2 sends to indicate that the stream is still open between the client application and Amazon Lex V2

Members
eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

ImageResponseCard

Description

A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.

When you use a response card, the response from the user is constrained to the text associated with a button on the card.

Members
buttons
Type: Array of Button structures

A list of buttons that should be displayed on the response card. The arrangement of the buttons is determined by the platform that displays the button.

imageUrl
Type: string

The URL of an image to display on the response card. The image URL must be publicly available so that the platform displaying the response card has access to the image.

subtitle
Type: string

The subtitle to display on the response card. The format of the subtitle is determined by the platform displaying the response card.

title
Required: Yes
Type: string

The title to display on the response card. The format of the title is determined by the platform displaying the response card.

Intent

Description

The current intent that Amazon Lex V2 is attempting to fulfill.

Members
confirmationState
Type: string

Indicates whether the intent has been Confirmed, Denied, or None if the confirmation stage has not yet been reached.

name
Required: Yes
Type: string

The name of the intent.

slots
Type: Associative array of custom strings keys (NonEmptyString) to Slot structures

A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.

state
Type: string

Indicates the fulfillment state for the intent. The meanings of each value are as follows:

  • Failed – The bot failed to fulfill the intent.

  • Fulfilled – The bot has completed fulfillment of the intent.

  • FulfillmentInProgress – The bot is in the middle of fulfilling the intent.

  • InProgress – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.

  • ReadyForFulfillment – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.

  • Waiting – The bot is waiting for a response from the user (limited to streaming conversations).

IntentResultEvent

Description

Contains the current state of the conversation between the client application and Amazon Lex V2.

Members
eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

inputMode
Type: string

Indicates whether the input to the operation was text, speech, or from a touch-tone keypad.

interpretations
Type: Array of Interpretation structures

A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.

Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.

recognizedBotMember
Type: RecognizedBotMember structure

The bot member that is processing the intent.

requestAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

The attributes sent in the request.

sessionId
Type: string

The identifier of the session in use.

sessionState
Type: SessionState structure

The state of the user's session with Amazon Lex V2.

InternalServerException

Description

Members
message
Required: Yes
Type: string

Interpretation

Description

An object containing information about an intent that Amazon Lex V2 determined might satisfy the user's utterance. The intents are ordered by the confidence score.

Members
intent
Type: Intent structure

A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.

interpretationSource
Type: string

Specifies the service that interpreted the input.

nluConfidence
Type: ConfidenceScore structure

Determines the threshold where Amazon Lex V2 will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.

sentimentResponse
Type: SentimentResponse structure

The sentiment expressed in an utterance.

When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.

Message

Description

Container for text that is returned to the customer..

Members
content
Type: string

The text of the message.

contentType
Required: Yes
Type: string

Indicates the type of response.

imageResponseCard
Type: ImageResponseCard structure

A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.

When you use a response card, the response from the user is constrained to the text associated with a button on the card.

PlaybackCompletionEvent

Description

Event sent from the client application to Amazon Lex V2 to indicate that playback of audio is complete and that Amazon Lex V2 should start processing the user's input.

Members
clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

PlaybackInterruptionEvent

Description

Event sent from Amazon Lex V2 to indicate to the client application should stop playback of audio. For example, if the client is playing a prompt that asks for the user's telephone number, the user might start to say the phone number before the prompt is complete. Amazon Lex V2 sends this event to the client application to indicate that the user is responding and that Amazon Lex V2 is processing their input.

Members
causedByEventId
Type: string

The identifier of the event that contained the audio, DTMF, or text that caused the interruption.

eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

eventReason
Type: string

Indicates the type of user input that Amazon Lex V2 detected.

RecognizedBotMember

Description

The bot member that processes the request.

Members
botId
Required: Yes
Type: string

The identifier of the bot member that processes the request.

botName
Type: string

The name of the bot member that processes the request.

ResourceNotFoundException

Description

Members
message
Required: Yes
Type: string

RuntimeHintDetails

Description

Provides an array of phrases that should be given preference when resolving values for a slot.

Members
runtimeHintValues
Type: Array of RuntimeHintValue structures

One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.

subSlotHints
Type: Associative array of custom strings keys (Name) to RuntimeHintDetails structures

A map of constituent sub slot names inside a composite slot in the intent and the phrases that should be added for each sub slot. Inside each composite slot hints, this structure provides a mechanism to add granular sub slot phrases. Only sub slot hints are supported for composite slots. The intent name, composite slot name and the constituent sub slot names must exist.

RuntimeHintValue

Description

Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.

Members
phrase
Required: Yes
Type: string

The phrase that Amazon Lex V2 should look for in the user's input to the bot.

RuntimeHints

Description

You can provide Amazon Lex V2 with hints to the phrases that a customer is likely to use for a slot. When a slot with hints is resolved, the phrases in the runtime hints are preferred in the resolution. You can provide hints for a maximum of 100 intents. You can provide a maximum of 100 slots.

Before you can use runtime hints with an existing bot, you must first rebuild the bot.

For more information, see Using runtime hints to improve recognition of slot values.

Members
slotHints
Type: Associative array of custom strings keys (Name) to RuntimeHintDetails structuress

A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.

The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.

The intent name and slot name must exist.

SentimentResponse

Description

Provides information about the sentiment expressed in a user's response in a conversation. Sentiments are determined using Amazon Comprehend. Sentiments are only returned if they are enabled for the bot.

For more information, see Determine Sentiment in the Amazon Comprehend developer guide.

Members
sentiment
Type: string

The overall sentiment expressed in the user's response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend.

sentimentScore
Type: SentimentScore structure

The individual sentiment responses for the utterance.

SentimentScore

Description

The individual sentiment responses for the utterance.

Members
mixed
Type: double

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED sentiment.

negative
Type: double

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE sentiment.

neutral
Type: double

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL sentiment.

positive
Type: double

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE sentiment.

SessionState

Description

The state of the user's session with Amazon Lex V2.

Members
activeContexts
Type: Array of ActiveContext structures

One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.

dialogAction
Type: DialogAction structure

The next step that Amazon Lex V2 should take in the conversation with a user.

intent
Type: Intent structure

The active intent that Amazon Lex V2 is processing.

originatingRequestId
Type: string

A unique identifier for a specific request.

runtimeHints
Type: RuntimeHints structure

Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.

sessionAttributes
Type: Associative array of custom strings keys (NonEmptyString) to strings

Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.

Slot

Description

A value that Amazon Lex V2 uses to fulfill an intent.

Members
shape
Type: string

When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.

subSlots
Type: Associative array of custom strings keys (NonEmptyString) to Slot structures

The constituent sub slots of a composite slot.

value
Type: Value structure

The current value of the slot.

values
Type: Array of Slot structures

A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."

StartConversationRequest

Members
botAliasId
Required: Yes
Type: string

The alias identifier in use for the bot that processes the request.

botId
Required: Yes
Type: string

The identifier of the bot to process the request.

conversationMode
Type: string

The conversation type that you are using the Amazon Lex V2. If the conversation mode is AUDIO you can send both audio and DTMF information. If the mode is TEXT you can only send text.

localeId
Required: Yes
Type: string

The locale where the session is in use.

requestEventStream
Required: Yes
Type: EventParsingIterator supplying the following structures: ConfigurationEvent, AudioInputEvent, DTMFInputEvent, TextInputEvent, PlaybackCompletionEvent, DisconnectionEvent

Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.

sessionId
Required: Yes
Type: string

The identifier of the user session that is having the conversation.

StartConversationRequestEventStream

Description

Represents a stream of events between your application and Amazon Lex V2.

Members
AudioInputEvent
Type: AudioInputEvent structure

Speech audio sent from your client application to Amazon Lex V2. Audio starts accumulating when Amazon Lex V2 identifies a voice and continues until a natural pause in the speech is found before processing.

ConfigurationEvent
Type: ConfigurationEvent structure

Configuration information sent from your client application to Amazon Lex V2

DTMFInputEvent
Type: DTMFInputEvent structure

DTMF information sent to Amazon Lex V2 by your application. Amazon Lex V2 accumulates the DMTF information from when the user sends the first character and ends

  • when there's a pause longer that the value configured for the end timeout.

  • when there's a digit that is the configured end character.

  • when Amazon Lex V2 accumulates characters equal to the maximum DTMF character configuration.

DisconnectionEvent
Type: DisconnectionEvent structure

Event sent from the client application to indicate to Amazon Lex V2 that the conversation is over.

PlaybackCompletionEvent
Type: PlaybackCompletionEvent structure

Event sent from the client application to Amazon Lex V2 to indicate that it has finished playing audio and that Amazon Lex V2 should start listening for user input.

TextInputEvent
Type: TextInputEvent structure

Text sent from your client application to Amazon Lex V2. Each TextInputEvent is processed individually.

StartConversationResponse

Members
responseEventStream

Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.

StartConversationResponseEventStream

Description

Represents a stream of events between Amazon Lex V2 and your application.

Members
AccessDeniedException
Type: AccessDeniedException structure

Exception thrown when the credentials passed with the request are invalid or expired. Also thrown when the credentials in the request do not have permission to access the StartConversation operation.

AudioResponseEvent
Type: AudioResponseEvent structure

An event sent from Amazon Lex V2 to your client application containing audio to play to the user.

BadGatewayException
Type: BadGatewayException structure

ConflictException
Type: ConflictException structure

Exception thrown when two clients are using the same AWS account, Amazon Lex V2 bot, and session ID.

DependencyFailedException
Type: DependencyFailedException structure

HeartbeatEvent
Type: HeartbeatEvent structure

Event that Amazon Lex V2 sends to indicate that the stream is still open between the client application and Amazon Lex V2

IntentResultEvent
Type: IntentResultEvent structure

Event sent from Amazon Lex V2 to the client application containing the current state of the conversation between the user and Amazon Lex V2.

InternalServerException
Type: InternalServerException structure

An error occurred with Amazon Lex V2.

PlaybackInterruptionEvent
Type: PlaybackInterruptionEvent structure

Event sent from Amazon Lex V2 to indicate to the client application should stop playback of audio. For example, if the client is playing a prompt that asks for the user's telephone number, the user might start to say the phone number before the prompt is complete. Amazon Lex V2 sends this event to the client application to indicate that the user is responding and that Amazon Lex V2 is processing their input.

ResourceNotFoundException
Type: ResourceNotFoundException structure

Exception thrown if one of the input parameters points to a resource that does not exist. For example, if the bot ID specified does not exist.

TextResponseEvent
Type: TextResponseEvent structure

The event sent from Amazon Lex V2 to your application with text to present to the user.

ThrottlingException
Type: ThrottlingException structure

Exception thrown when your application exceeds the maximum number of concurrent requests.

TranscriptEvent
Type: TranscriptEvent structure

Event sent from Amazon Lex V2 to your client application that contains a transcript of voice audio.

ValidationException
Type: ValidationException structure

Exception thrown when one or more parameters could not be validated. The message contains the name of the field that isn't valid.

TextInputEvent

Description

The event sent from your client application to Amazon Lex V2 with text input from the user.

Members
clientTimestampMillis
Type: long (int|float)

A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.

eventId
Type: string

A unique identifier that your application assigns to the event. You can use this to identify events in logs.

text
Required: Yes
Type: string

The text from the user. Amazon Lex V2 processes this as a complete statement.

TextResponseEvent

Description

The event sent from Amazon Lex V2 to your application with text to present to the user.

Members
eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

messages
Type: Array of Message structures

A list of messages to send to the user. Messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.

ThrottlingException

Description

Members
message
Required: Yes
Type: string

TranscriptEvent

Description

Event sent from Amazon Lex V2 to your client application that contains a transcript of voice audio.

Members
eventId
Type: string

A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.

transcript
Type: string

The transcript of the voice audio from the user.

ValidationException

Description

Members
message
Required: Yes
Type: string

Value

Description

Information about the value provided for a slot and Amazon Lex V2's interpretation.

Members
interpretedValue
Required: Yes
Type: string

The value that Amazon Lex V2 determines for the slot, given the user input. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.

originalValue
Type: string

The part of the user's response to the slot elicitation that Amazon Lex V2 determines is relevant to the slot value.

resolvedValues
Type: Array of strings

A list of values that Amazon Lex V2 determines are possible resolutions for the user input. The first value matches the interpretedValue.