Amazon Lex Model Building V2

2023/06/06 - Amazon Lex Model Building V2 - 14 new 7 updated api methods

Changes  This release adds support for Lex Developers to create test sets and to execute those test-sets against their bots.

StartTestSetGeneration (new) Link ¶

The action to start the generation of test set.

See also: AWS API Documentation

Request Syntax

client.start_test_set_generation(
    testSetName='string',
    description='string',
    storageLocation={
        's3BucketName': 'string',
        's3Path': 'string',
        'kmsKeyArn': 'string'
    },
    generationDataSource={
        'conversationLogsDataSource': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string',
            'filter': {
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1),
                'inputMode': 'Speech'|'Text'
            }
        }
    },
    roleArn='string',
    testSetTags={
        'string': 'string'
    }
)
type testSetName

string

param testSetName

[REQUIRED]

The test set name for the test set generation request.

type description

string

param description

The test set description for the test set generation request.

type storageLocation

dict

param storageLocation

[REQUIRED]

The Amazon S3 storage location for the test set generation.

  • s3BucketName (string) -- [REQUIRED]

    The name of the Amazon S3 bucket in which the test set is stored.

  • s3Path (string) -- [REQUIRED]

    The path inside the Amazon S3 bucket where the test set is stored.

  • kmsKeyArn (string) --

    The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

type generationDataSource

dict

param generationDataSource

[REQUIRED]

The data source for the test set generation.

  • conversationLogsDataSource (dict) --

    Contains information about the bot from which the conversation logs are sourced.

    • botId (string) -- [REQUIRED]

      The bot Id from the conversation logs.

    • botAliasId (string) -- [REQUIRED]

      The bot alias Id from the conversation logs.

    • localeId (string) -- [REQUIRED]

      The locale Id of the conversation log.

    • filter (dict) -- [REQUIRED]

      The filter for the data source of the conversation log.

      • startTime (datetime) -- [REQUIRED]

        The start time for the conversation log.

      • endTime (datetime) -- [REQUIRED]

        The end time for the conversation log.

      • inputMode (string) -- [REQUIRED]

        The selection to filter by input mode for the conversation logs.

type roleArn

string

param roleArn

[REQUIRED]

The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.

type testSetTags

dict

param testSetTags

A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the UpdateTestSet operation to update tags. To update tags, use the TagResource operation.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'testSetGenerationId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'testSetGenerationStatus': 'Generating'|'Ready'|'Failed'|'Pending',
    'testSetName': 'string',
    'description': 'string',
    'storageLocation': {
        's3BucketName': 'string',
        's3Path': 'string',
        'kmsKeyArn': 'string'
    },
    'generationDataSource': {
        'conversationLogsDataSource': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string',
            'filter': {
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1),
                'inputMode': 'Speech'|'Text'
            }
        }
    },
    'roleArn': 'string',
    'testSetTags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • testSetGenerationId (string) --

      The unique identifier of the test set generation to describe.

    • creationDateTime (datetime) --

      The creation date and time for the test set generation.

    • testSetGenerationStatus (string) --

      The status for the test set generation.

    • testSetName (string) --

      The test set name used for the test set generation.

    • description (string) --

      The description used for the test set generation.

    • storageLocation (dict) --

      The Amazon S3 storage location for the test set generation.

      • s3BucketName (string) --

        The name of the Amazon S3 bucket in which the test set is stored.

      • s3Path (string) --

        The path inside the Amazon S3 bucket where the test set is stored.

      • kmsKeyArn (string) --

        The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

    • generationDataSource (dict) --

      The data source for the test set generation.

      • conversationLogsDataSource (dict) --

        Contains information about the bot from which the conversation logs are sourced.

        • botId (string) --

          The bot Id from the conversation logs.

        • botAliasId (string) --

          The bot alias Id from the conversation logs.

        • localeId (string) --

          The locale Id of the conversation log.

        • filter (dict) --

          The filter for the data source of the conversation log.

          • startTime (datetime) --

            The start time for the conversation log.

          • endTime (datetime) --

            The end time for the conversation log.

          • inputMode (string) --

            The selection to filter by input mode for the conversation logs.

    • roleArn (string) --

      The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.

    • testSetTags (dict) --

      A list of tags that was used for the test set that is being generated.

      • (string) --

        • (string) --

UpdateTestSet (new) Link ¶

The action to update the test set.

See also: AWS API Documentation

Request Syntax

client.update_test_set(
    testSetId='string',
    testSetName='string',
    description='string'
)
type testSetId

string

param testSetId

[REQUIRED]

The test set Id for which update test operation to be performed.

type testSetName

string

param testSetName

[REQUIRED]

The new test set name.

type description

string

param description

The new test set description.

rtype

dict

returns

Response Syntax

{
    'testSetId': 'string',
    'testSetName': 'string',
    'description': 'string',
    'modality': 'Text'|'Audio',
    'status': 'Importing'|'PendingAnnotation'|'Deleting'|'ValidationError'|'Ready',
    'roleArn': 'string',
    'numTurns': 123,
    'storageLocation': {
        's3BucketName': 'string',
        's3Path': 'string',
        'kmsKeyArn': 'string'
    },
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • testSetId (string) --

      The test set Id for which update test operation to be performed.

    • testSetName (string) --

      The test set name for the updated test set.

    • description (string) --

      The test set description for the updated test set.

    • modality (string) --

      Indicates whether audio or text is used for the updated test set.

    • status (string) --

      The status for the updated test set.

    • roleArn (string) --

      The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.

    • numTurns (integer) --

      The number of conversation turns from the updated test set.

    • storageLocation (dict) --

      The Amazon S3 storage location for the updated test set.

      • s3BucketName (string) --

        The name of the Amazon S3 bucket in which the test set is stored.

      • s3Path (string) --

        The path inside the Amazon S3 bucket where the test set is stored.

      • kmsKeyArn (string) --

        The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

    • creationDateTime (datetime) --

      The creation date and time for the updated test set.

    • lastUpdatedDateTime (datetime) --

      The date and time of the last update for the updated test set.

DeleteTestSet (new) Link ¶

The action to delete the selected test set.

See also: AWS API Documentation

Request Syntax

client.delete_test_set(
    testSetId='string'
)
type testSetId

string

param testSetId

[REQUIRED]

The test set Id of the test set to be deleted.

returns

None

ListTestSets (new) Link ¶

The list of the test sets

See also: AWS API Documentation

Request Syntax

client.list_test_sets(
    sortBy={
        'attribute': 'TestSetName'|'LastUpdatedDateTime',
        'order': 'Ascending'|'Descending'
    },
    maxResults=123,
    nextToken='string'
)
type sortBy

dict

param sortBy

The sort order for the list of test sets.

  • attribute (string) -- [REQUIRED]

    Specifies whether to sort the test sets by name or by the time they were last updated.

  • order (string) -- [REQUIRED]

    Specifies whether to sort in ascending or descending order.

type maxResults

integer

param maxResults

The maximum number of test sets to return in each page. If there are fewer results than the max page size, only the actual number of results are returned.

type nextToken

string

param nextToken

If the response from the ListTestSets operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

rtype

dict

returns

Response Syntax

{
    'testSets': [
        {
            'testSetId': 'string',
            'testSetName': 'string',
            'description': 'string',
            'modality': 'Text'|'Audio',
            'status': 'Importing'|'PendingAnnotation'|'Deleting'|'ValidationError'|'Ready',
            'roleArn': 'string',
            'numTurns': 123,
            'storageLocation': {
                's3BucketName': 'string',
                's3Path': 'string',
                'kmsKeyArn': 'string'
            },
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • testSets (list) --

      The selected test sets in a list of test sets.

      • (dict) --

        Contains summary information about the test set.

        • testSetId (string) --

          The unique identifier of the test set.

        • testSetName (string) --

          The name of the test set.

        • description (string) --

          The description of the test set.

        • modality (string) --

          Specifies whether the test set contains written or spoken data.

        • status (string) --

          The status of the test set.

        • roleArn (string) --

          The Amazon Resource Name (ARN) of an IAM role that has permission to access the test set.

        • numTurns (integer) --

          The number of turns in the test set.

        • storageLocation (dict) --

          Contains information about the location at which the test set is stored.

          • s3BucketName (string) --

            The name of the Amazon S3 bucket in which the test set is stored.

          • s3Path (string) --

            The path inside the Amazon S3 bucket where the test set is stored.

          • kmsKeyArn (string) --

            The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

        • creationDateTime (datetime) --

          The date and time at which the test set was created.

        • lastUpdatedDateTime (datetime) --

          The date and time at which the test set was last updated.

    • nextToken (string) --

      A token that indicates whether there are more results to return in a response to the ListTestSets operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListTestSets operation request to get the next page of results.

CreateTestSetDiscrepancyReport (new) Link ¶

Create a report that describes the differences between the bot and the test set.

See also: AWS API Documentation

Request Syntax

client.create_test_set_discrepancy_report(
    testSetId='string',
    target={
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    }
)
type testSetId

string

param testSetId

[REQUIRED]

The test set Id for the test set discrepancy report.

type target

dict

param target

[REQUIRED]

The target bot for the test set discrepancy report.

  • botAliasTarget (dict) --

    Contains information about the bot alias used as the resource for the test set discrepancy report.

    • botId (string) -- [REQUIRED]

      The unique identifier for the bot alias.

    • botAliasId (string) -- [REQUIRED]

      The unique identifier for the bot associated with the bot alias.

    • localeId (string) -- [REQUIRED]

      The unique identifier of the locale associated with the bot alias.

rtype

dict

returns

Response Syntax

{
    'testSetDiscrepancyReportId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'testSetId': 'string',
    'target': {
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • testSetDiscrepancyReportId (string) --

      The unique identifier of the test set discrepancy report to describe.

    • creationDateTime (datetime) --

      The creation date and time for the test set discrepancy report.

    • testSetId (string) --

      The test set Id for the test set discrepancy report.

    • target (dict) --

      The target bot for the test set discrepancy report.

      • botAliasTarget (dict) --

        Contains information about the bot alias used as the resource for the test set discrepancy report.

        • botId (string) --

          The unique identifier for the bot alias.

        • botAliasId (string) --

          The unique identifier for the bot associated with the bot alias.

        • localeId (string) --

          The unique identifier of the locale associated with the bot alias.

DescribeTestSet (new) Link ¶

Gets metadata information about the test set.

See also: AWS API Documentation

Request Syntax

client.describe_test_set(
    testSetId='string'
)
type testSetId

string

param testSetId

[REQUIRED]

The test set Id for the test set request.

rtype

dict

returns

Response Syntax

{
    'testSetId': 'string',
    'testSetName': 'string',
    'description': 'string',
    'modality': 'Text'|'Audio',
    'status': 'Importing'|'PendingAnnotation'|'Deleting'|'ValidationError'|'Ready',
    'roleArn': 'string',
    'numTurns': 123,
    'storageLocation': {
        's3BucketName': 'string',
        's3Path': 'string',
        'kmsKeyArn': 'string'
    },
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • testSetId (string) --

      The test set Id for the test set response.

    • testSetName (string) --

      The test set name of the test set.

    • description (string) --

      The description of the test set.

    • modality (string) --

      Indicates whether the test set is audio or text data.

    • status (string) --

      The status of the test set.

    • roleArn (string) --

      The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.

    • numTurns (integer) --

      The total number of agent and user turn in the test set.

    • storageLocation (dict) --

      The Amazon S3 storage location for the test set data.

      • s3BucketName (string) --

        The name of the Amazon S3 bucket in which the test set is stored.

      • s3Path (string) --

        The path inside the Amazon S3 bucket where the test set is stored.

      • kmsKeyArn (string) --

        The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

    • creationDateTime (datetime) --

      The creation date and time for the test set data.

    • lastUpdatedDateTime (datetime) --

      The date and time for the last update of the test set data.

StartTestExecution (new) Link ¶

The action to start test set execution.

See also: AWS API Documentation

Request Syntax

client.start_test_execution(
    testSetId='string',
    target={
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    },
    apiMode='Streaming'|'NonStreaming',
    testExecutionModality='Text'|'Audio'
)
type testSetId

string

param testSetId

[REQUIRED]

The test set Id for the test set execution.

type target

dict

param target

[REQUIRED]

The target bot for the test set execution.

  • botAliasTarget (dict) --

    Contains information about the bot alias used for the test execution.

    • botId (string) -- [REQUIRED]

      The bot Id of the bot alias used in the test set execution.

    • botAliasId (string) -- [REQUIRED]

      The bot alias Id of the bot alias used in the test set execution.

    • localeId (string) -- [REQUIRED]

      The locale Id of the bot alias used in the test set execution.

type apiMode

string

param apiMode

[REQUIRED]

Indicates whether we use streaming or non-streaming APIs for the test set execution. For streaming, StartConversation Runtime API is used. Whereas, for non-streaming, RecognizeUtterance and RecognizeText Amazon Lex Runtime API are used.

type testExecutionModality

string

param testExecutionModality

Indicates whether audio or text is used.

rtype

dict

returns

Response Syntax

{
    'testExecutionId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'testSetId': 'string',
    'target': {
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    },
    'apiMode': 'Streaming'|'NonStreaming',
    'testExecutionModality': 'Text'|'Audio'
}

Response Structure

  • (dict) --

    • testExecutionId (string) --

      The unique identifier of the test set execution.

    • creationDateTime (datetime) --

      The creation date and time for the test set execution.

    • testSetId (string) --

      The test set Id for the test set execution.

    • target (dict) --

      The target bot for the test set execution.

      • botAliasTarget (dict) --

        Contains information about the bot alias used for the test execution.

        • botId (string) --

          The bot Id of the bot alias used in the test set execution.

        • botAliasId (string) --

          The bot alias Id of the bot alias used in the test set execution.

        • localeId (string) --

          The locale Id of the bot alias used in the test set execution.

    • apiMode (string) --

      Indicates whether we use streaming or non-streaming APIs for the test set execution. For streaming, StartConversation Amazon Lex Runtime API is used. Whereas for non-streaming, RecognizeUtterance and RecognizeText Amazon Lex Runtime API are used.

    • testExecutionModality (string) --

      Indicates whether audio or text is used.

ListTestSetRecords (new) Link ¶

The list of test set records.

See also: AWS API Documentation

Request Syntax

client.list_test_set_records(
    testSetId='string',
    maxResults=123,
    nextToken='string'
)
type testSetId

string

param testSetId

[REQUIRED]

The identifier of the test set to list its test set records.

type maxResults

integer

param maxResults

The maximum number of test set records to return in each page. If there are fewer records than the max page size, only the actual number of records are returned.

type nextToken

string

param nextToken

If the response from the ListTestSetRecords operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

rtype

dict

returns

Response Syntax

{
    'testSetRecords': [
        {
            'recordNumber': 123,
            'conversationId': 'string',
            'turnNumber': 123,
            'turnSpecification': {
                'agentTurn': {
                    'agentPrompt': 'string'
                },
                'userTurn': {
                    'input': {
                        'utteranceInput': {
                            'textInput': 'string',
                            'audioInput': {
                                'audioFileS3Location': 'string'
                            }
                        },
                        'requestAttributes': {
                            'string': 'string'
                        },
                        'sessionState': {
                            'sessionAttributes': {
                                'string': 'string'
                            },
                            'activeContexts': [
                                {
                                    'name': 'string'
                                },
                            ],
                            'runtimeHints': {
                                'slotHints': {
                                    'string': {
                                        'string': {
                                            'runtimeHintValues': [
                                                {
                                                    'phrase': 'string'
                                                },
                                            ],
                                            'subSlotHints': {'... recursive ...'}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    'expected': {
                        'intent': {
                            'name': 'string',
                            'slots': {
                                'string': {
                                    'value': 'string',
                                    'values': [
                                        {'... recursive ...'},
                                    ],
                                    'subSlots': {'... recursive ...'}
                                }
                            }
                        },
                        'activeContexts': [
                            {
                                'name': 'string'
                            },
                        ],
                        'transcript': 'string'
                    }
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • testSetRecords (list) --

      The list of records from the test set.

      • (dict) --

        Contains information about a turn in a test set.

        • recordNumber (integer) --

          The record number associated with the turn.

        • conversationId (string) --

          The unique identifier for the conversation associated with the turn.

        • turnNumber (integer) --

          The number of turns that has elapsed up to that turn.

        • turnSpecification (dict) --

          Contains information about the agent or user turn depending upon type of turn.

          • agentTurn (dict) --

            Contains information about the agent messages in the turn.

            • agentPrompt (string) --

              The agent prompt for the agent turn in a test set.

          • userTurn (dict) --

            Contains information about the user messages in the turn.

            • input (dict) --

              Contains information about the user messages in the turn in the input.

              • utteranceInput (dict) --

                The utterance input in the user turn.

                • textInput (string) --

                  A text input transcription of the utterance. It is only applicable for test-sets containing text data.

                • audioInput (dict) --

                  Contains information about the audio input for an utterance.

                  • audioFileS3Location (string) --

                    Amazon S3 file pointing to the audio.

              • requestAttributes (dict) --

                Request attributes of the user turn.

                • (string) --

                  • (string) --

              • sessionState (dict) --

                Contains information about the session state in the input.

                • sessionAttributes (dict) --

                  Session attributes for the session state.

                  • (string) --

                    • (string) --

                • activeContexts (list) --

                  Active contexts for the session state.

                  • (dict) --

                    The active context used in the test execution.

                    • name (string) --

                      The name of active context.

                • runtimeHints (dict) --

                  Runtime hints for the session state.

                  • slotHints (dict) --

                    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.

                    • (string) --

                      • (dict) --

                        • (string) --

                          • (dict) --

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

                            • runtimeHintValues (list) --

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

                              • (dict) --

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

                                • phrase (string) --

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

                            • subSlotHints (dict) --

                              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.

            • expected (dict) --

              Contains results about the expected output for the user turn.

              • intent (dict) --

                Contains information about the intent.

                • name (string) --

                  The name of the intent.

                • slots (dict) --

                  The slots associated with the intent.

                  • (string) --

                    • (dict) --

                      Contains information about a slot output by the test set execution.

                      • value (string) --

                        The value output by the slot recognition.

                      • values (list) --

                        Values that are output by the slot recognition.

                        • (dict) --

                          Contains information about a slot output by the test set execution.

                      • subSlots (dict) --

                        A list of items mapping the name of the subslots to information about those subslots.

              • activeContexts (list) --

                The contexts that are active in the turn.

                • (dict) --

                  The active context used in the test execution.

                  • name (string) --

                    The name of active context.

              • transcript (string) --

                The transcript that is output for the user turn by the test execution.

    • nextToken (string) --

      A token that indicates whether there are more records to return in a response to the ListTestSetRecords operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListTestSetRecords operation request to get the next page of records.

DescribeTestSetGeneration (new) Link ¶

Gets metadata information about the test set generation.

See also: AWS API Documentation

Request Syntax

client.describe_test_set_generation(
    testSetGenerationId='string'
)
type testSetGenerationId

string

param testSetGenerationId

[REQUIRED]

The unique identifier of the test set generation.

rtype

dict

returns

Response Syntax

{
    'testSetGenerationId': 'string',
    'testSetGenerationStatus': 'Generating'|'Ready'|'Failed'|'Pending',
    'failureReasons': [
        'string',
    ],
    'testSetId': 'string',
    'testSetName': 'string',
    'description': 'string',
    'storageLocation': {
        's3BucketName': 'string',
        's3Path': 'string',
        'kmsKeyArn': 'string'
    },
    'generationDataSource': {
        'conversationLogsDataSource': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string',
            'filter': {
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1),
                'inputMode': 'Speech'|'Text'
            }
        }
    },
    'roleArn': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • testSetGenerationId (string) --

      The unique identifier of the test set generation.

    • testSetGenerationStatus (string) --

      The status for the test set generation.

    • failureReasons (list) --

      The reasons the test set generation failed.

      • (string) --

    • testSetId (string) --

      The unique identifier for the test set created for the generated test set.

    • testSetName (string) --

      The test set name for the generated test set.

    • description (string) --

      The test set description for the test set generation.

    • storageLocation (dict) --

      The Amazon S3 storage location for the test set generation.

      • s3BucketName (string) --

        The name of the Amazon S3 bucket in which the test set is stored.

      • s3Path (string) --

        The path inside the Amazon S3 bucket where the test set is stored.

      • kmsKeyArn (string) --

        The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

    • generationDataSource (dict) --

      The data source of the test set used for the test set generation.

      • conversationLogsDataSource (dict) --

        Contains information about the bot from which the conversation logs are sourced.

        • botId (string) --

          The bot Id from the conversation logs.

        • botAliasId (string) --

          The bot alias Id from the conversation logs.

        • localeId (string) --

          The locale Id of the conversation log.

        • filter (dict) --

          The filter for the data source of the conversation log.

          • startTime (datetime) --

            The start time for the conversation log.

          • endTime (datetime) --

            The end time for the conversation log.

          • inputMode (string) --

            The selection to filter by input mode for the conversation logs.

    • roleArn (string) --

      The roleARN of the test set used for the test set generation.

    • creationDateTime (datetime) --

      The creation date and time for the test set generation.

    • lastUpdatedDateTime (datetime) --

      The date and time of the last update for the test set generation.

ListTestExecutionResultItems (new) Link ¶

Gets a list of test execution result items.

See also: AWS API Documentation

Request Syntax

client.list_test_execution_result_items(
    testExecutionId='string',
    resultFilterBy={
        'resultTypeFilter': 'OverallTestResults'|'ConversationLevelTestResults'|'IntentClassificationTestResults'|'SlotResolutionTestResults'|'UtteranceLevelResults',
        'conversationLevelTestResultsFilterBy': {
            'endToEndResult': 'Matched'|'Mismatched'|'ExecutionError'
        }
    },
    maxResults=123,
    nextToken='string'
)
type testExecutionId

string

param testExecutionId

[REQUIRED]

The unique identifier of the test execution to list the result items.

type resultFilterBy

dict

param resultFilterBy

[REQUIRED]

The filter for the list of results from the test set execution.

  • resultTypeFilter (string) -- [REQUIRED]

    Specifies which results to filter. See Test result details">Test results details for details about different types of results.

  • conversationLevelTestResultsFilterBy (dict) --

    Contains information about the method for filtering Conversation level test results.

    • endToEndResult (string) --

      The selection of matched or mismatched end-to-end status to filter test set results data at the conversation level.

type maxResults

integer

param maxResults

The maximum number of test execution result items to return in each page. If there are fewer results than the max page size, only the actual number of results are returned.

type nextToken

string

param nextToken

If the response from the ListTestExecutionResultItems operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

rtype

dict

returns

Response Syntax

{
    'testExecutionResults': {
        'overallTestResults': {
            'items': [
                {
                    'multiTurnConversation': True|False,
                    'totalResultCount': 123,
                    'speechTranscriptionResultCounts': {
                        'string': 123
                    },
                    'endToEndResultCounts': {
                        'string': 123
                    }
                },
            ]
        },
        'conversationLevelTestResults': {
            'items': [
                {
                    'conversationId': 'string',
                    'endToEndResult': 'Matched'|'Mismatched'|'ExecutionError',
                    'speechTranscriptionResult': 'Matched'|'Mismatched'|'ExecutionError',
                    'intentClassificationResults': [
                        {
                            'intentName': 'string',
                            'matchResult': 'Matched'|'Mismatched'|'ExecutionError'
                        },
                    ],
                    'slotResolutionResults': [
                        {
                            'intentName': 'string',
                            'slotName': 'string',
                            'matchResult': 'Matched'|'Mismatched'|'ExecutionError'
                        },
                    ]
                },
            ]
        },
        'intentClassificationTestResults': {
            'items': [
                {
                    'intentName': 'string',
                    'multiTurnConversation': True|False,
                    'resultCounts': {
                        'totalResultCount': 123,
                        'speechTranscriptionResultCounts': {
                            'string': 123
                        },
                        'intentMatchResultCounts': {
                            'string': 123
                        }
                    }
                },
            ]
        },
        'intentLevelSlotResolutionTestResults': {
            'items': [
                {
                    'intentName': 'string',
                    'multiTurnConversation': True|False,
                    'slotResolutionResults': [
                        {
                            'slotName': 'string',
                            'resultCounts': {
                                'totalResultCount': 123,
                                'speechTranscriptionResultCounts': {
                                    'string': 123
                                },
                                'slotMatchResultCounts': {
                                    'string': 123
                                }
                            }
                        },
                    ]
                },
            ]
        },
        'utteranceLevelTestResults': {
            'items': [
                {
                    'recordNumber': 123,
                    'conversationId': 'string',
                    'turnResult': {
                        'agent': {
                            'expectedAgentPrompt': 'string',
                            'actualAgentPrompt': 'string',
                            'errorDetails': {
                                'errorCode': 'string',
                                'errorMessage': 'string'
                            },
                            'actualElicitedSlot': 'string',
                            'actualIntent': 'string'
                        },
                        'user': {
                            'input': {
                                'utteranceInput': {
                                    'textInput': 'string',
                                    'audioInput': {
                                        'audioFileS3Location': 'string'
                                    }
                                },
                                'requestAttributes': {
                                    'string': 'string'
                                },
                                'sessionState': {
                                    'sessionAttributes': {
                                        'string': 'string'
                                    },
                                    'activeContexts': [
                                        {
                                            'name': 'string'
                                        },
                                    ],
                                    'runtimeHints': {
                                        'slotHints': {
                                            'string': {
                                                'string': {
                                                    'runtimeHintValues': [
                                                        {
                                                            'phrase': 'string'
                                                        },
                                                    ],
                                                    'subSlotHints': {'... recursive ...'}
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            'expectedOutput': {
                                'intent': {
                                    'name': 'string',
                                    'slots': {
                                        'string': {
                                            'value': 'string',
                                            'values': [
                                                {'... recursive ...'},
                                            ],
                                            'subSlots': {'... recursive ...'}
                                        }
                                    }
                                },
                                'activeContexts': [
                                    {
                                        'name': 'string'
                                    },
                                ],
                                'transcript': 'string'
                            },
                            'actualOutput': {
                                'intent': {
                                    'name': 'string',
                                    'slots': {
                                        'string': {
                                            'value': 'string',
                                            'values': [
                                                {'... recursive ...'},
                                            ],
                                            'subSlots': {'... recursive ...'}
                                        }
                                    }
                                },
                                'activeContexts': [
                                    {
                                        'name': 'string'
                                    },
                                ],
                                'transcript': 'string'
                            },
                            'errorDetails': {
                                'errorCode': 'string',
                                'errorMessage': 'string'
                            },
                            'endToEndResult': 'Matched'|'Mismatched'|'ExecutionError',
                            'intentMatchResult': 'Matched'|'Mismatched'|'ExecutionError',
                            'slotMatchResult': 'Matched'|'Mismatched'|'ExecutionError',
                            'speechTranscriptionResult': 'Matched'|'Mismatched'|'ExecutionError',
                            'conversationLevelResult': {
                                'endToEndResult': 'Matched'|'Mismatched'|'ExecutionError',
                                'speechTranscriptionResult': 'Matched'|'Mismatched'|'ExecutionError'
                            }
                        }
                    }
                },
            ]
        }
    },
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • testExecutionResults (dict) --

      The list of results from the test execution.

      • overallTestResults (dict) --

        Overall results for the test execution, including the breakdown of conversations and single-input utterances.

        • items (list) --

          A list of the overall test results.

          • (dict) --

            Information about the overall results for a test execution result.

            • multiTurnConversation (boolean) --

              Indicates whether the conversation contains multiple turns or not.

            • totalResultCount (integer) --

              The total number of overall results in the result of the test execution.

            • speechTranscriptionResultCounts (dict) --

              The number of speech transcription results in the overall test.

              • (string) --

                • (integer) --

            • endToEndResultCounts (dict) --

              The number of results that succeeded.

              • (string) --

                • (integer) --

      • conversationLevelTestResults (dict) --

        Results related to conversations in the test set, including metrics about success and failure of conversations and intent and slot failures.

        • items (list) --

          The item list in the test set results data at the conversation level.

          • (dict) --

            The test result evaluation item at the conversation level.

            • conversationId (string) --

              The conversation Id of the test result evaluation item.

            • endToEndResult (string) --

              The end-to-end success or failure of the test result evaluation item.

            • speechTranscriptionResult (string) --

              The speech transcription success or failure of the test result evaluation item.

            • intentClassificationResults (list) --

              The intent classification of the test result evaluation item.

              • (dict) --

                The item listing the evaluation of intent level success or failure.

                • intentName (string) --

                  The intent name used in the evaluation of intent level success or failure.

                • matchResult (string) --

                  The number of times the specific intent is used in the evaluation of intent level success or failure.

            • slotResolutionResults (list) --

              The slot success or failure of the test result evaluation item.

              • (dict) --

                The slots used for the slot resolution in the conversation.

                • intentName (string) --

                  The intents used in the slots list for the slot resolution details.

                • slotName (string) --

                  The slot name in the slots list for the slot resolution details.

                • matchResult (string) --

                  The number of matching slots used in the slots listings for the slot resolution evaluation.

      • intentClassificationTestResults (dict) --

        Intent recognition results aggregated by intent name. The aggregated results contain success and failure rates of intent recognition, speech transcriptions, and end-to-end conversations.

        • items (list) --

          A list of the results for the intent classification test.

          • (dict) --

            Information for an intent that is classified by the test workbench.

            • intentName (string) --

              The name of the intent.

            • multiTurnConversation (boolean) --

              Indicates whether the conversation involves multiple turns or not.

            • resultCounts (dict) --

              The result of the intent classification test.

              • totalResultCount (integer) --

                The total number of results in the intent classification test.

              • speechTranscriptionResultCounts (dict) --

                The number of matched, mismatched, and execution error results for speech transcription for the intent.

                • (string) --

                  • (integer) --

              • intentMatchResultCounts (dict) --

                The number of matched and mismatched results for intent recognition for the intent.

                • (string) --

                  • (integer) --

      • intentLevelSlotResolutionTestResults (dict) --

        Slot resolution results aggregated by intent and slot name. The aggregated results contain success and failure rates of slot resolution, speech transcriptions, and end-to-end conversations

        • items (list) --

          Indicates the items for the slot level resolution for the intents.

          • (dict) --

            Information about intent-level slot resolution in a test result.

            • intentName (string) --

              The name of the intent that was recognized.

            • multiTurnConversation (boolean) --

              Indicates whether the conversation involves multiple turns or not.

            • slotResolutionResults (list) --

              The results for the slot resolution in the test execution result.

              • (dict) --

                Information about the success and failure rate of slot resolution in the results of a test execution.

                • slotName (string) --

                  The name of the slot.

                • resultCounts (dict) --

                  A result for slot resolution in the results of a test execution.

                  • totalResultCount (integer) --

                    The total number of results.

                  • speechTranscriptionResultCounts (dict) --

                    The number of matched, mismatched and execution error results for speech transcription for the slot.

                    • (string) --

                      • (integer) --

                  • slotMatchResultCounts (dict) --

                    The number of matched and mismatched results for slot resolution for the slot.

                    • (string) --

                      • (integer) --

      • utteranceLevelTestResults (dict) --

        Results related to utterances in the test set.

        • items (list) --

          Contains information about an utterance in the results of the test set execution.

          • (dict) --

            Contains information about multiple utterances in the results of a test set execution.

            • recordNumber (integer) --

              The record number of the result.

            • conversationId (string) --

              The unique identifier for the conversation associated with the result.

            • turnResult (dict) --

              Contains information about the turn associated with the result.

              • agent (dict) --

                Contains information about the agent messages in the turn.

                • expectedAgentPrompt (string) --

                  The expected agent prompt for the agent turn in a test set execution.

                • actualAgentPrompt (string) --

                  The actual agent prompt for the agent turn in a test set execution.

                • errorDetails (dict) --

                  Details about an error in an execution of a test set.

                  • errorCode (string) --

                    The error code for the error.

                  • errorMessage (string) --

                    The message describing the error.

                • actualElicitedSlot (string) --

                  The actual elicited slot for the agent turn in a test set execution.

                • actualIntent (string) --

                  The actual intent for the agent turn in a test set execution.

              • user (dict) --

                Contains information about the user messages in the turn.

                • input (dict) --

                  Contains information about the user messages in the turn in the input.

                  • utteranceInput (dict) --

                    The utterance input in the user turn.

                    • textInput (string) --

                      A text input transcription of the utterance. It is only applicable for test-sets containing text data.

                    • audioInput (dict) --

                      Contains information about the audio input for an utterance.

                      • audioFileS3Location (string) --

                        Amazon S3 file pointing to the audio.

                  • requestAttributes (dict) --

                    Request attributes of the user turn.

                    • (string) --

                      • (string) --

                  • sessionState (dict) --

                    Contains information about the session state in the input.

                    • sessionAttributes (dict) --

                      Session attributes for the session state.

                      • (string) --

                        • (string) --

                    • activeContexts (list) --

                      Active contexts for the session state.

                      • (dict) --

                        The active context used in the test execution.

                        • name (string) --

                          The name of active context.

                    • runtimeHints (dict) --

                      Runtime hints for the session state.

                      • slotHints (dict) --

                        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.

                        • (string) --

                          • (dict) --

                            • (string) --

                              • (dict) --

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

                                • runtimeHintValues (list) --

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

                                  • (dict) --

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

                                    • phrase (string) --

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

                                • subSlotHints (dict) --

                                  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.

                • expectedOutput (dict) --

                  Contains information about the expected output for the user turn.

                  • intent (dict) --

                    Contains information about the intent.

                    • name (string) --

                      The name of the intent.

                    • slots (dict) --

                      The slots associated with the intent.

                      • (string) --

                        • (dict) --

                          Contains information about a slot output by the test set execution.

                          • value (string) --

                            The value output by the slot recognition.

                          • values (list) --

                            Values that are output by the slot recognition.

                            • (dict) --

                              Contains information about a slot output by the test set execution.

                          • subSlots (dict) --

                            A list of items mapping the name of the subslots to information about those subslots.

                  • activeContexts (list) --

                    The contexts that are active in the turn.

                    • (dict) --

                      The active context used in the test execution.

                      • name (string) --

                        The name of active context.

                  • transcript (string) --

                    The transcript that is output for the user turn by the test execution.

                • actualOutput (dict) --

                  Contains information about the actual output for the user turn.

                  • intent (dict) --

                    Contains information about the intent.

                    • name (string) --

                      The name of the intent.

                    • slots (dict) --

                      The slots associated with the intent.

                      • (string) --

                        • (dict) --

                          Contains information about a slot output by the test set execution.

                          • value (string) --

                            The value output by the slot recognition.

                          • values (list) --

                            Values that are output by the slot recognition.

                            • (dict) --

                              Contains information about a slot output by the test set execution.

                          • subSlots (dict) --

                            A list of items mapping the name of the subslots to information about those subslots.

                  • activeContexts (list) --

                    The contexts that are active in the turn.

                    • (dict) --

                      The active context used in the test execution.

                      • name (string) --

                        The name of active context.

                  • transcript (string) --

                    The transcript that is output for the user turn by the test execution.

                • errorDetails (dict) --

                  Details about an error in an execution of a test set.

                  • errorCode (string) --

                    The error code for the error.

                  • errorMessage (string) --

                    The message describing the error.

                • endToEndResult (string) --

                  Specifies whether the expected and actual outputs match or not, or if there is an error in execution.

                • intentMatchResult (string) --

                  Specifies whether the expected and actual intents match or not.

                • slotMatchResult (string) --

                  Specifies whether the expected and actual slots match or not.

                • speechTranscriptionResult (string) --

                  Specifies whether the expected and actual speech transcriptions match or not, or if there is an error in execution.

                • conversationLevelResult (dict) --

                  Contains information about the results related to the conversation associated with the user turn.

                  • endToEndResult (string) --

                    The success or failure of the streaming of the conversation.

                  • speechTranscriptionResult (string) --

                    The speech transcription success or failure details of the conversation.

    • nextToken (string) --

      A token that indicates whether there are more results to return in a response to the ListTestExecutionResultItems operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListTestExecutionResultItems operation request to get the next page of results.

DescribeTestSetDiscrepancyReport (new) Link ¶

Gets metadata information about the test set discrepancy report.

See also: AWS API Documentation

Request Syntax

client.describe_test_set_discrepancy_report(
    testSetDiscrepancyReportId='string'
)
type testSetDiscrepancyReportId

string

param testSetDiscrepancyReportId

[REQUIRED]

The unique identifier of the test set discrepancy report.

rtype

dict

returns

Response Syntax

{
    'testSetDiscrepancyReportId': 'string',
    'testSetId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'target': {
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    },
    'testSetDiscrepancyReportStatus': 'InProgress'|'Completed'|'Failed',
    'lastUpdatedDataTime': datetime(2015, 1, 1),
    'testSetDiscrepancyTopErrors': {
        'intentDiscrepancies': [
            {
                'intentName': 'string',
                'errorMessage': 'string'
            },
        ],
        'slotDiscrepancies': [
            {
                'intentName': 'string',
                'slotName': 'string',
                'errorMessage': 'string'
            },
        ]
    },
    'testSetDiscrepancyRawOutputUrl': 'string',
    'failureReasons': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • testSetDiscrepancyReportId (string) --

      The unique identifier of the test set discrepancy report to describe.

    • testSetId (string) --

      The test set Id for the test set discrepancy report.

    • creationDateTime (datetime) --

      The time and date of creation for the test set discrepancy report.

    • target (dict) --

      The target bot location for the test set discrepancy report.

      • botAliasTarget (dict) --

        Contains information about the bot alias used as the resource for the test set discrepancy report.

        • botId (string) --

          The unique identifier for the bot alias.

        • botAliasId (string) --

          The unique identifier for the bot associated with the bot alias.

        • localeId (string) --

          The unique identifier of the locale associated with the bot alias.

    • testSetDiscrepancyReportStatus (string) --

      The status for the test set discrepancy report.

    • lastUpdatedDataTime (datetime) --

      The date and time of the last update for the test set discrepancy report.

    • testSetDiscrepancyTopErrors (dict) --

      The top 200 error results from the test set discrepancy report.

      • intentDiscrepancies (list) --

        Contains information about discrepancies found for intents between the test set and the bot.

        • (dict) --

          Contains information about discrepancy in an intent information between the test set and the bot.

          • intentName (string) --

            The name of the intent in the discrepancy report.

          • errorMessage (string) --

            The error message for a discrepancy for an intent between the test set and the bot.

      • slotDiscrepancies (list) --

        Contains information about discrepancies found for slots between the test set and the bot.

        • (dict) --

          Contains information about discrepancy in a slot information between the test set and the bot.

          • intentName (string) --

            The name of the intent associated with the slot in the discrepancy report.

          • slotName (string) --

            The name of the slot in the discrepancy report.

          • errorMessage (string) --

            The error message for a discrepancy for an intent between the test set and the bot.

    • testSetDiscrepancyRawOutputUrl (string) --

      Pre-signed Amazon S3 URL to download the test set discrepancy report.

    • failureReasons (list) --

      The failure report for the test set discrepancy report generation action.

      • (string) --

GetTestExecutionArtifactsUrl (new) Link ¶

The pre-signed Amazon S3 URL to download the test execution result artifacts.

See also: AWS API Documentation

Request Syntax

client.get_test_execution_artifacts_url(
    testExecutionId='string'
)
type testExecutionId

string

param testExecutionId

[REQUIRED]

The unique identifier of the completed test execution.

rtype

dict

returns

Response Syntax

{
    'testExecutionId': 'string',
    'downloadArtifactsUrl': 'string'
}

Response Structure

  • (dict) --

    • testExecutionId (string) --

      The unique identifier of the completed test execution.

    • downloadArtifactsUrl (string) --

      The pre-signed Amazon S3 URL to download completed test execution.

ListTestExecutions (new) Link ¶

The list of test set executions.

See also: AWS API Documentation

Request Syntax

client.list_test_executions(
    sortBy={
        'attribute': 'TestSetName'|'CreationDateTime',
        'order': 'Ascending'|'Descending'
    },
    maxResults=123,
    nextToken='string'
)
type sortBy

dict

param sortBy

The sort order of the test set executions.

  • attribute (string) -- [REQUIRED]

    Specifies whether to sort the test set executions by the date and time at which the test sets were created.

  • order (string) -- [REQUIRED]

    Specifies whether to sort in ascending or descending order.

type maxResults

integer

param maxResults

The maximum number of test executions to return in each page. If there are fewer results than the max page size, only the actual number of results are returned.

type nextToken

string

param nextToken

If the response from the ListTestExecutions operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

rtype

dict

returns

Response Syntax

{
    'testExecutions': [
        {
            'testExecutionId': 'string',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'testExecutionStatus': 'Pending'|'Waiting'|'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
            'testSetId': 'string',
            'testSetName': 'string',
            'target': {
                'botAliasTarget': {
                    'botId': 'string',
                    'botAliasId': 'string',
                    'localeId': 'string'
                }
            },
            'apiMode': 'Streaming'|'NonStreaming',
            'testExecutionModality': 'Text'|'Audio'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • testExecutions (list) --

      The list of test executions.

      • (dict) --

        Summarizes metadata about the test execution.

        • testExecutionId (string) --

          The unique identifier of the test execution.

        • creationDateTime (datetime) --

          The date and time at which the test execution was created.

        • lastUpdatedDateTime (datetime) --

          The date and time at which the test execution was last updated.

        • testExecutionStatus (string) --

          The current status of the test execution.

        • testSetId (string) --

          The unique identifier of the test set used in the test execution.

        • testSetName (string) --

          The name of the test set used in the test execution.

        • target (dict) --

          Contains information about the bot used for the test execution..

          • botAliasTarget (dict) --

            Contains information about the bot alias used for the test execution.

            • botId (string) --

              The bot Id of the bot alias used in the test set execution.

            • botAliasId (string) --

              The bot alias Id of the bot alias used in the test set execution.

            • localeId (string) --

              The locale Id of the bot alias used in the test set execution.

        • apiMode (string) --

          Specifies whether the API mode for the test execution is streaming or non-streaming.

        • testExecutionModality (string) --

          Specifies whether the data used for the test execution is written or spoken.

    • nextToken (string) --

      A token that indicates whether there are more results to return in a response to the ListTestExecutions operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListTestExecutions operation request to get the next page of results.

DescribeTestExecution (new) Link ¶

Gets metadata information about the test execution.

See also: AWS API Documentation

Request Syntax

client.describe_test_execution(
    testExecutionId='string'
)
type testExecutionId

string

param testExecutionId

[REQUIRED]

The execution Id of the test set execution.

rtype

dict

returns

Response Syntax

{
    'testExecutionId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1),
    'testExecutionStatus': 'Pending'|'Waiting'|'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    'testSetId': 'string',
    'testSetName': 'string',
    'target': {
        'botAliasTarget': {
            'botId': 'string',
            'botAliasId': 'string',
            'localeId': 'string'
        }
    },
    'apiMode': 'Streaming'|'NonStreaming',
    'testExecutionModality': 'Text'|'Audio',
    'failureReasons': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • testExecutionId (string) --

      The execution Id for the test set execution.

    • creationDateTime (datetime) --

      The execution creation date and time for the test set execution.

    • lastUpdatedDateTime (datetime) --

      The date and time of the last update for the execution.

    • testExecutionStatus (string) --

      The test execution status for the test execution.

    • testSetId (string) --

      The test set Id for the test set execution.

    • testSetName (string) --

      The test set name of the test set execution.

    • target (dict) --

      The target bot for the test set execution details.

      • botAliasTarget (dict) --

        Contains information about the bot alias used for the test execution.

        • botId (string) --

          The bot Id of the bot alias used in the test set execution.

        • botAliasId (string) --

          The bot alias Id of the bot alias used in the test set execution.

        • localeId (string) --

          The locale Id of the bot alias used in the test set execution.

    • apiMode (string) --

      Indicates whether we use streaming or non-streaming APIs are used for the test set execution. For streaming, StartConversation Amazon Lex Runtime API is used. Whereas for non-streaming, RecognizeUtterance and RecognizeText Amazon Lex Runtime API is used.

    • testExecutionModality (string) --

      Indicates whether test set is audio or text.

    • failureReasons (list) --

      Reasons for the failure of the test set execution.

      • (string) --

CreateExport (updated) Link ¶
Changes (both)
{'fileFormat': {'CSV'},
 'resourceSpecification': {'testSetExportSpecification': {'testSetId': 'string'}}}

Creates a zip archive containing the contents of a bot or a bot locale. The archive contains a directory structure that contains JSON files that define the bot.

You can create an archive that contains the complete definition of a bot, or you can specify that the archive contain only the definition of a single bot locale.

For more information about exporting bots, and about the structure of the export archive, see Importing and exporting bots

See also: AWS API Documentation

Request Syntax

client.create_export(
    resourceSpecification={
        'botExportSpecification': {
            'botId': 'string',
            'botVersion': 'string'
        },
        'botLocaleExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'customVocabularyExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetExportSpecification': {
            'testSetId': 'string'
        }
    },
    fileFormat='LexJson'|'TSV'|'CSV',
    filePassword='string'
)
type resourceSpecification

dict

param resourceSpecification

[REQUIRED]

Specifies the type of resource to export, either a bot or a bot locale. You can only specify one type of resource to export.

  • botExportSpecification (dict) --

    Parameters for exporting a bot.

    • botId (string) -- [REQUIRED]

      The identifier of the bot assigned by Amazon Lex.

    • botVersion (string) -- [REQUIRED]

      The version of the bot that was exported. This will be either DRAFT or the version number.

  • botLocaleExportSpecification (dict) --

    Parameters for exporting a bot locale.

    • botId (string) -- [REQUIRED]

      The identifier of the bot to create the locale for.

    • botVersion (string) -- [REQUIRED]

      The version of the bot to export.

    • localeId (string) -- [REQUIRED]

      The identifier of the language and locale to export. The string must match one of the locales in the bot.

  • customVocabularyExportSpecification (dict) --

    The parameters required to export a custom vocabulary.

    • botId (string) -- [REQUIRED]

      The identifier of the bot that contains the custom vocabulary to export.

    • botVersion (string) -- [REQUIRED]

      The version of the bot that contains the custom vocabulary to export.

    • localeId (string) -- [REQUIRED]

      The locale of the bot that contains the custom vocabulary to export.

  • testSetExportSpecification (dict) --

    Specifications for the test set that is exported as a resource.

    • testSetId (string) -- [REQUIRED]

      The unique identifier of the test set.

type fileFormat

string

param fileFormat

[REQUIRED]

The file format of the bot or bot locale definition files.

type filePassword

string

param filePassword

An password to use to encrypt the exported archive. Using a password is optional, but you should encrypt the archive to protect the data in transit between Amazon Lex and your local computer.

rtype

dict

returns

Response Syntax

{
    'exportId': 'string',
    'resourceSpecification': {
        'botExportSpecification': {
            'botId': 'string',
            'botVersion': 'string'
        },
        'botLocaleExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'customVocabularyExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetExportSpecification': {
            'testSetId': 'string'
        }
    },
    'fileFormat': 'LexJson'|'TSV'|'CSV',
    'exportStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
    'creationDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • exportId (string) --

      An identifier for a specific request to create an export.

    • resourceSpecification (dict) --

      A description of the type of resource that was exported, either a bot or a bot locale.

      • botExportSpecification (dict) --

        Parameters for exporting a bot.

        • botId (string) --

          The identifier of the bot assigned by Amazon Lex.

        • botVersion (string) --

          The version of the bot that was exported. This will be either DRAFT or the version number.

      • botLocaleExportSpecification (dict) --

        Parameters for exporting a bot locale.

        • botId (string) --

          The identifier of the bot to create the locale for.

        • botVersion (string) --

          The version of the bot to export.

        • localeId (string) --

          The identifier of the language and locale to export. The string must match one of the locales in the bot.

      • customVocabularyExportSpecification (dict) --

        The parameters required to export a custom vocabulary.

        • botId (string) --

          The identifier of the bot that contains the custom vocabulary to export.

        • botVersion (string) --

          The version of the bot that contains the custom vocabulary to export.

        • localeId (string) --

          The locale of the bot that contains the custom vocabulary to export.

      • testSetExportSpecification (dict) --

        Specifications for the test set that is exported as a resource.

        • testSetId (string) --

          The unique identifier of the test set.

    • fileFormat (string) --

      The file format used for the bot or bot locale definition files.

    • exportStatus (string) --

      The status of the export. When the status is Completed , you can use the DescribeExport operation to get the pre-signed S3 URL link to your exported bot or bot locale.

    • creationDateTime (datetime) --

      The date and time that the request to export a bot was created.

DescribeExport (updated) Link ¶
Changes (response)
{'fileFormat': {'CSV'},
 'resourceSpecification': {'testSetExportSpecification': {'testSetId': 'string'}}}

Gets information about a specific export.

See also: AWS API Documentation

Request Syntax

client.describe_export(
    exportId='string'
)
type exportId

string

param exportId

[REQUIRED]

The unique identifier of the export to describe.

rtype

dict

returns

Response Syntax

{
    'exportId': 'string',
    'resourceSpecification': {
        'botExportSpecification': {
            'botId': 'string',
            'botVersion': 'string'
        },
        'botLocaleExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'customVocabularyExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetExportSpecification': {
            'testSetId': 'string'
        }
    },
    'fileFormat': 'LexJson'|'TSV'|'CSV',
    'exportStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
    'failureReasons': [
        'string',
    ],
    'downloadUrl': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • exportId (string) --

      The unique identifier of the described export.

    • resourceSpecification (dict) --

      The bot, bot ID, and optional locale ID of the exported bot or bot locale.

      • botExportSpecification (dict) --

        Parameters for exporting a bot.

        • botId (string) --

          The identifier of the bot assigned by Amazon Lex.

        • botVersion (string) --

          The version of the bot that was exported. This will be either DRAFT or the version number.

      • botLocaleExportSpecification (dict) --

        Parameters for exporting a bot locale.

        • botId (string) --

          The identifier of the bot to create the locale for.

        • botVersion (string) --

          The version of the bot to export.

        • localeId (string) --

          The identifier of the language and locale to export. The string must match one of the locales in the bot.

      • customVocabularyExportSpecification (dict) --

        The parameters required to export a custom vocabulary.

        • botId (string) --

          The identifier of the bot that contains the custom vocabulary to export.

        • botVersion (string) --

          The version of the bot that contains the custom vocabulary to export.

        • localeId (string) --

          The locale of the bot that contains the custom vocabulary to export.

      • testSetExportSpecification (dict) --

        Specifications for the test set that is exported as a resource.

        • testSetId (string) --

          The unique identifier of the test set.

    • fileFormat (string) --

      The file format used in the files that describe the resource.

    • exportStatus (string) --

      The status of the export. When the status is Complete the export archive file is available for download.

    • failureReasons (list) --

      If the exportStatus is failed, contains one or more reasons why the export could not be completed.

      • (string) --

    • downloadUrl (string) --

      A pre-signed S3 URL that points to the bot or bot locale archive. The URL is only available for 5 minutes after calling the DescribeExport operation.

    • creationDateTime (datetime) --

      The date and time that the export was created.

    • lastUpdatedDateTime (datetime) --

      The last date and time that the export was updated.

DescribeImport (updated) Link ¶
Changes (response)
{'resourceSpecification': {'testSetImportResourceSpecification': {'description': 'string',
                                                                  'importInputLocation': {'s3BucketName': 'string',
                                                                                          's3Path': 'string'},
                                                                  'modality': 'Text '
                                                                              '| '
                                                                              'Audio',
                                                                  'roleArn': 'string',
                                                                  'storageLocation': {'kmsKeyArn': 'string',
                                                                                      's3BucketName': 'string',
                                                                                      's3Path': 'string'},
                                                                  'testSetName': 'string',
                                                                  'testSetTags': {'string': 'string'}}}}

Gets information about a specific import.

See also: AWS API Documentation

Request Syntax

client.describe_import(
    importId='string'
)
type importId

string

param importId

[REQUIRED]

The unique identifier of the import to describe.

rtype

dict

returns

Response Syntax

{
    'importId': 'string',
    'resourceSpecification': {
        'botImportSpecification': {
            'botName': 'string',
            'roleArn': 'string',
            'dataPrivacy': {
                'childDirected': True|False
            },
            'idleSessionTTLInSeconds': 123,
            'botTags': {
                'string': 'string'
            },
            'testBotAliasTags': {
                'string': 'string'
            }
        },
        'botLocaleImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string',
            'nluIntentConfidenceThreshold': 123.0,
            'voiceSettings': {
                'voiceId': 'string',
                'engine': 'standard'|'neural'
            }
        },
        'customVocabularyImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetImportResourceSpecification': {
            'testSetName': 'string',
            'description': 'string',
            'roleArn': 'string',
            'storageLocation': {
                's3BucketName': 'string',
                's3Path': 'string',
                'kmsKeyArn': 'string'
            },
            'importInputLocation': {
                's3BucketName': 'string',
                's3Path': 'string'
            },
            'modality': 'Text'|'Audio',
            'testSetTags': {
                'string': 'string'
            }
        }
    },
    'importedResourceId': 'string',
    'importedResourceName': 'string',
    'mergeStrategy': 'Overwrite'|'FailOnConflict'|'Append',
    'importStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
    'failureReasons': [
        'string',
    ],
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • importId (string) --

      The unique identifier of the described import.

    • resourceSpecification (dict) --

      The specifications of the imported bot, bot locale, or custom vocabulary.

      • botImportSpecification (dict) --

        Parameters for importing a bot.

        • botName (string) --

          The name that Amazon Lex should use for the bot.

        • roleArn (string) --

          The Amazon Resource Name (ARN) of the IAM role used to build and run the bot.

        • dataPrivacy (dict) --

          By default, data stored by Amazon Lex is encrypted. The DataPrivacy structure provides settings that determine how Amazon Lex handles special cases of securing the data for your bot.

          • childDirected (boolean) --

            For each Amazon Lex bot created with the Amazon Lex Model Building Service, you must specify whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to the Children's Online Privacy Protection Act (COPPA) by specifying true or false in the childDirected field. By specifying true in the childDirected field, you confirm that your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. By specifying false in the childDirected field, you confirm that your use of Amazon Lex is not related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. You may not specify a default value for the childDirected field that does not accurately reflect whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. If your use of Amazon Lex relates to a website, program, or other application that is directed in whole or in part, to children under age 13, you must obtain any required verifiable parental consent under COPPA. For information regarding the use of Amazon Lex in connection with websites, programs, or other applications that are directed or targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ.

        • idleSessionTTLInSeconds (integer) --

          The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.

          You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

        • botTags (dict) --

          A list of tags to add to the bot. You can only add tags when you import a bot. You can't use the UpdateBot operation to update tags. To update tags, use the TagResource operation.

          • (string) --

            • (string) --

        • testBotAliasTags (dict) --

          A list of tags to add to the test alias for a bot. You can only add tags when you import a bot. You can't use the UpdateAlias operation to update tags. To update tags on the test alias, use the TagResource operation.

          • (string) --

            • (string) --

      • botLocaleImportSpecification (dict) --

        Parameters for importing a bot locale.

        • botId (string) --

          The identifier of the bot to import the locale to.

        • botVersion (string) --

          The version of the bot to import the locale to. This can only be the DRAFT version of the bot.

        • localeId (string) --

          The identifier of the language and locale that the bot will be used in. The string must match one of the supported locales. All of the intents, slot types, and slots used in the bot must have the same locale. For more information, see Supported languages.

        • nluIntentConfidenceThreshold (float) --

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

          For example, suppose a bot is configured with the confidence threshold of 0.80 and the AMAZON.FallbackIntent . Amazon Lex returns three alternative intents with the following confidence scores: IntentA (0.70), IntentB (0.60), IntentC (0.50). The response from the PostText operation would be:

          • AMAZON.FallbackIntent

          • IntentA

          • IntentB

          • IntentC

        • voiceSettings (dict) --

          Defines settings for using an Amazon Polly voice to communicate with a user.

          • voiceId (string) --

            The identifier of the Amazon Polly voice to use.

          • engine (string) --

            Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

            If you do not specify a value, the default is standard .

      • customVocabularyImportSpecification (dict) --

        Provides the parameters required for importing a custom vocabulary.

        • botId (string) --

          The identifier of the bot to import the custom vocabulary to.

        • botVersion (string) --

          The version of the bot to import the custom vocabulary to.

        • localeId (string) --

          The identifier of the local to import the custom vocabulary to. The value must be en_GB .

      • testSetImportResourceSpecification (dict) --

        Specifications for the test set that is imported.

        • testSetName (string) --

          The name of the test set.

        • description (string) --

          The description of the test set.

        • roleArn (string) --

          The Amazon Resource Name (ARN) of an IAM role that has permission to access the test set.

        • storageLocation (dict) --

          Contains information about the location that Amazon Lex uses to store the test-set.

          • s3BucketName (string) --

            The name of the Amazon S3 bucket in which the test set is stored.

          • s3Path (string) --

            The path inside the Amazon S3 bucket where the test set is stored.

          • kmsKeyArn (string) --

            The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

        • importInputLocation (dict) --

          Contains information about the input location from where test-set should be imported.

          • s3BucketName (string) --

            The name of the Amazon S3 bucket.

          • s3Path (string) --

            The path inside the Amazon S3 bucket pointing to the test-set CSV file.

        • modality (string) --

          Specifies whether the test-set being imported contains written or spoken data.

        • testSetTags (dict) --

          A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the UpdateTestSet operation to update tags. To update tags, use the TagResource operation.

          • (string) --

            • (string) --

    • importedResourceId (string) --

      The unique identifier that Amazon Lex assigned to the resource created by the import.

    • importedResourceName (string) --

      The name of the imported resource.

    • mergeStrategy (string) --

      The strategy used when there was a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

    • importStatus (string) --

      The status of the import process. When the status is Completed the resource is imported and ready for use.

    • failureReasons (list) --

      If the importStatus field is Failed , this provides one or more reasons for the failure.

      • (string) --

    • creationDateTime (datetime) --

      The date and time that the import was created.

    • lastUpdatedDateTime (datetime) --

      The date and time that the import was last updated.

ListExports (updated) Link ¶
Changes (response)
{'exportSummaries': {'fileFormat': {'CSV'},
                     'resourceSpecification': {'testSetExportSpecification': {'testSetId': 'string'}}}}

Lists the exports for a bot, bot locale, or custom vocabulary. Exports are kept in the list for 7 days.

See also: AWS API Documentation

Request Syntax

client.list_exports(
    botId='string',
    botVersion='string',
    sortBy={
        'attribute': 'LastUpdatedDateTime',
        'order': 'Ascending'|'Descending'
    },
    filters=[
        {
            'name': 'ExportResourceType',
            'values': [
                'string',
            ],
            'operator': 'CO'|'EQ'
        },
    ],
    maxResults=123,
    nextToken='string',
    localeId='string'
)
type botId

string

param botId

The unique identifier that Amazon Lex assigned to the bot.

type botVersion

string

param botVersion

The version of the bot to list exports for.

type sortBy

dict

param sortBy

Determines the field that the list of exports is sorted by. You can sort by the LastUpdatedDateTime field in ascending or descending order.

  • attribute (string) -- [REQUIRED]

    The export field to use for sorting.

  • order (string) -- [REQUIRED]

    The order to sort the list.

type filters

list

param filters

Provides the specification of a filter used to limit the exports in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.

  • (dict) --

    Filters the response form the ListExports operation

    • name (string) -- [REQUIRED]

      The name of the field to use for filtering.

    • values (list) -- [REQUIRED]

      The values to use to filter the response. The values must be Bot , BotLocale , or CustomVocabulary .

      • (string) --

    • operator (string) -- [REQUIRED]

      The operator to use for the filter. Specify EQ when the ListExports operation should return only resource types that equal the specified value. Specify CO when the ListExports operation should return resource types that contain the specified value.

type maxResults

integer

param maxResults

The maximum number of exports to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned.

type nextToken

string

param nextToken

If the response from the ListExports operation contains more results that specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListExports request to return the next page of results. For a complete set of results, call the ListExports operation until the nextToken returned in the response is null.

type localeId

string

param localeId

Specifies the resources that should be exported. If you don't specify a resource type in the filters parameter, both bot locales and custom vocabularies are exported.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'exportSummaries': [
        {
            'exportId': 'string',
            'resourceSpecification': {
                'botExportSpecification': {
                    'botId': 'string',
                    'botVersion': 'string'
                },
                'botLocaleExportSpecification': {
                    'botId': 'string',
                    'botVersion': 'string',
                    'localeId': 'string'
                },
                'customVocabularyExportSpecification': {
                    'botId': 'string',
                    'botVersion': 'string',
                    'localeId': 'string'
                },
                'testSetExportSpecification': {
                    'testSetId': 'string'
                }
            },
            'fileFormat': 'LexJson'|'TSV'|'CSV',
            'exportStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string',
    'localeId': 'string'
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier assigned to the bot by Amazon Lex.

    • botVersion (string) --

      The version of the bot that was exported.

    • exportSummaries (list) --

      Summary information for the exports that meet the filter criteria specified in the request. The length of the list is specified in the maxResults parameter. If there are more exports available, the nextToken field contains a token to get the next page of results.

      • (dict) --

        Provides summary information about an export in an export list.

        • exportId (string) --

          The unique identifier that Amazon Lex assigned to the export.

        • resourceSpecification (dict) --

          Information about the bot or bot locale that was exported.

          • botExportSpecification (dict) --

            Parameters for exporting a bot.

            • botId (string) --

              The identifier of the bot assigned by Amazon Lex.

            • botVersion (string) --

              The version of the bot that was exported. This will be either DRAFT or the version number.

          • botLocaleExportSpecification (dict) --

            Parameters for exporting a bot locale.

            • botId (string) --

              The identifier of the bot to create the locale for.

            • botVersion (string) --

              The version of the bot to export.

            • localeId (string) --

              The identifier of the language and locale to export. The string must match one of the locales in the bot.

          • customVocabularyExportSpecification (dict) --

            The parameters required to export a custom vocabulary.

            • botId (string) --

              The identifier of the bot that contains the custom vocabulary to export.

            • botVersion (string) --

              The version of the bot that contains the custom vocabulary to export.

            • localeId (string) --

              The locale of the bot that contains the custom vocabulary to export.

          • testSetExportSpecification (dict) --

            Specifications for the test set that is exported as a resource.

            • testSetId (string) --

              The unique identifier of the test set.

        • fileFormat (string) --

          The file format used in the export files.

        • exportStatus (string) --

          The status of the export. When the status is Completed the export is ready to download.

        • creationDateTime (datetime) --

          The date and time that the export was created.

        • lastUpdatedDateTime (datetime) --

          The date and time that the export was last updated.

    • nextToken (string) --

      A token that indicates whether there are more results to return in a response to the ListExports operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListExports operation request to get the next page of results.

    • localeId (string) --

      The locale specified in the request.

ListImports (updated) Link ¶
Changes (response)
{'importSummaries': {'importedResourceType': {'TestSet'}}}

Lists the imports for a bot, bot locale, or custom vocabulary. Imports are kept in the list for 7 days.

See also: AWS API Documentation

Request Syntax

client.list_imports(
    botId='string',
    botVersion='string',
    sortBy={
        'attribute': 'LastUpdatedDateTime',
        'order': 'Ascending'|'Descending'
    },
    filters=[
        {
            'name': 'ImportResourceType',
            'values': [
                'string',
            ],
            'operator': 'CO'|'EQ'
        },
    ],
    maxResults=123,
    nextToken='string',
    localeId='string'
)
type botId

string

param botId

The unique identifier that Amazon Lex assigned to the bot.

type botVersion

string

param botVersion

The version of the bot to list imports for.

type sortBy

dict

param sortBy

Determines the field that the list of imports is sorted by. You can sort by the LastUpdatedDateTime field in ascending or descending order.

  • attribute (string) -- [REQUIRED]

    The export field to use for sorting.

  • order (string) -- [REQUIRED]

    The order to sort the list.

type filters

list

param filters

Provides the specification of a filter used to limit the bots in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.

  • (dict) --

    Filters the response from the ListImports operation.

    • name (string) -- [REQUIRED]

      The name of the field to use for filtering.

    • values (list) -- [REQUIRED]

      The values to use to filter the response. The values must be Bot , BotLocale , or CustomVocabulary .

      • (string) --

    • operator (string) -- [REQUIRED]

      The operator to use for the filter. Specify EQ when the ListImports operation should return only resource types that equal the specified value. Specify CO when the ListImports operation should return resource types that contain the specified value.

type maxResults

integer

param maxResults

The maximum number of imports to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned.

type nextToken

string

param nextToken

If the response from the ListImports operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListImports request to return the next page of results. For a complete set of results, call the ListImports operation until the nextToken returned in the response is null.

type localeId

string

param localeId

Specifies the locale that should be present in the list. If you don't specify a resource type in the filters parameter, the list contains both bot locales and custom vocabularies.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'importSummaries': [
        {
            'importId': 'string',
            'importedResourceId': 'string',
            'importedResourceName': 'string',
            'importStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
            'mergeStrategy': 'Overwrite'|'FailOnConflict'|'Append',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'importedResourceType': 'Bot'|'BotLocale'|'CustomVocabulary'|'TestSet'
        },
    ],
    'nextToken': 'string',
    'localeId': 'string'
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier assigned by Amazon Lex to the bot.

    • botVersion (string) --

      The version of the bot that was imported. It will always be DRAFT .

    • importSummaries (list) --

      Summary information for the imports that meet the filter criteria specified in the request. The length of the list is specified in the maxResults parameter. If there are more imports available, the nextToken field contains a token to get the next page of results.

      • (dict) --

        Provides summary information about an import in an import list.

        • importId (string) --

          The unique identifier that Amazon Lex assigned to the import.

        • importedResourceId (string) --

          The unique identifier that Amazon Lex assigned to the imported resource.

        • importedResourceName (string) --

          The name that you gave the imported resource.

        • importStatus (string) --

          The status of the resource. When the status is Completed the resource is ready to build.

        • mergeStrategy (string) --

          The strategy used to merge existing bot or bot locale definitions with the imported definition.

        • creationDateTime (datetime) --

          The date and time that the import was created.

        • lastUpdatedDateTime (datetime) --

          The date and time that the import was last updated.

        • importedResourceType (string) --

          The type of resource that was imported.

    • nextToken (string) --

      A token that indicates whether there are more results to return in a response to the ListImports operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListImports operation request to get the next page of results.

    • localeId (string) --

      The locale specified in the request.

StartImport (updated) Link ¶
Changes (both)
{'resourceSpecification': {'testSetImportResourceSpecification': {'description': 'string',
                                                                  'importInputLocation': {'s3BucketName': 'string',
                                                                                          's3Path': 'string'},
                                                                  'modality': 'Text '
                                                                              '| '
                                                                              'Audio',
                                                                  'roleArn': 'string',
                                                                  'storageLocation': {'kmsKeyArn': 'string',
                                                                                      's3BucketName': 'string',
                                                                                      's3Path': 'string'},
                                                                  'testSetName': 'string',
                                                                  'testSetTags': {'string': 'string'}}}}

Starts importing a bot, bot locale, or custom vocabulary from a zip archive that you uploaded to an S3 bucket.

See also: AWS API Documentation

Request Syntax

client.start_import(
    importId='string',
    resourceSpecification={
        'botImportSpecification': {
            'botName': 'string',
            'roleArn': 'string',
            'dataPrivacy': {
                'childDirected': True|False
            },
            'idleSessionTTLInSeconds': 123,
            'botTags': {
                'string': 'string'
            },
            'testBotAliasTags': {
                'string': 'string'
            }
        },
        'botLocaleImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string',
            'nluIntentConfidenceThreshold': 123.0,
            'voiceSettings': {
                'voiceId': 'string',
                'engine': 'standard'|'neural'
            }
        },
        'customVocabularyImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetImportResourceSpecification': {
            'testSetName': 'string',
            'description': 'string',
            'roleArn': 'string',
            'storageLocation': {
                's3BucketName': 'string',
                's3Path': 'string',
                'kmsKeyArn': 'string'
            },
            'importInputLocation': {
                's3BucketName': 'string',
                's3Path': 'string'
            },
            'modality': 'Text'|'Audio',
            'testSetTags': {
                'string': 'string'
            }
        }
    },
    mergeStrategy='Overwrite'|'FailOnConflict'|'Append',
    filePassword='string'
)
type importId

string

param importId

[REQUIRED]

The unique identifier for the import. It is included in the response from the CreateUploadUrl operation.

type resourceSpecification

dict

param resourceSpecification

[REQUIRED]

Parameters for creating the bot, bot locale or custom vocabulary.

  • botImportSpecification (dict) --

    Parameters for importing a bot.

    • botName (string) -- [REQUIRED]

      The name that Amazon Lex should use for the bot.

    • roleArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the IAM role used to build and run the bot.

    • dataPrivacy (dict) -- [REQUIRED]

      By default, data stored by Amazon Lex is encrypted. The DataPrivacy structure provides settings that determine how Amazon Lex handles special cases of securing the data for your bot.

      • childDirected (boolean) -- [REQUIRED]

        For each Amazon Lex bot created with the Amazon Lex Model Building Service, you must specify whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to the Children's Online Privacy Protection Act (COPPA) by specifying true or false in the childDirected field. By specifying true in the childDirected field, you confirm that your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. By specifying false in the childDirected field, you confirm that your use of Amazon Lex is not related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. You may not specify a default value for the childDirected field that does not accurately reflect whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. If your use of Amazon Lex relates to a website, program, or other application that is directed in whole or in part, to children under age 13, you must obtain any required verifiable parental consent under COPPA. For information regarding the use of Amazon Lex in connection with websites, programs, or other applications that are directed or targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ.

    • idleSessionTTLInSeconds (integer) --

      The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.

      A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.

      You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

    • botTags (dict) --

      A list of tags to add to the bot. You can only add tags when you import a bot. You can't use the UpdateBot operation to update tags. To update tags, use the TagResource operation.

      • (string) --

        • (string) --

    • testBotAliasTags (dict) --

      A list of tags to add to the test alias for a bot. You can only add tags when you import a bot. You can't use the UpdateAlias operation to update tags. To update tags on the test alias, use the TagResource operation.

      • (string) --

        • (string) --

  • botLocaleImportSpecification (dict) --

    Parameters for importing a bot locale.

    • botId (string) -- [REQUIRED]

      The identifier of the bot to import the locale to.

    • botVersion (string) -- [REQUIRED]

      The version of the bot to import the locale to. This can only be the DRAFT version of the bot.

    • localeId (string) -- [REQUIRED]

      The identifier of the language and locale that the bot will be used in. The string must match one of the supported locales. All of the intents, slot types, and slots used in the bot must have the same locale. For more information, see Supported languages.

    • nluIntentConfidenceThreshold (float) --

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

      For example, suppose a bot is configured with the confidence threshold of 0.80 and the AMAZON.FallbackIntent . Amazon Lex returns three alternative intents with the following confidence scores: IntentA (0.70), IntentB (0.60), IntentC (0.50). The response from the PostText operation would be:

      • AMAZON.FallbackIntent

      • IntentA

      • IntentB

      • IntentC

    • voiceSettings (dict) --

      Defines settings for using an Amazon Polly voice to communicate with a user.

      • voiceId (string) -- [REQUIRED]

        The identifier of the Amazon Polly voice to use.

      • engine (string) --

        Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

        If you do not specify a value, the default is standard .

  • customVocabularyImportSpecification (dict) --

    Provides the parameters required for importing a custom vocabulary.

    • botId (string) -- [REQUIRED]

      The identifier of the bot to import the custom vocabulary to.

    • botVersion (string) -- [REQUIRED]

      The version of the bot to import the custom vocabulary to.

    • localeId (string) -- [REQUIRED]

      The identifier of the local to import the custom vocabulary to. The value must be en_GB .

  • testSetImportResourceSpecification (dict) --

    Specifications for the test set that is imported.

    • testSetName (string) -- [REQUIRED]

      The name of the test set.

    • description (string) --

      The description of the test set.

    • roleArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of an IAM role that has permission to access the test set.

    • storageLocation (dict) -- [REQUIRED]

      Contains information about the location that Amazon Lex uses to store the test-set.

      • s3BucketName (string) -- [REQUIRED]

        The name of the Amazon S3 bucket in which the test set is stored.

      • s3Path (string) -- [REQUIRED]

        The path inside the Amazon S3 bucket where the test set is stored.

      • kmsKeyArn (string) --

        The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

    • importInputLocation (dict) -- [REQUIRED]

      Contains information about the input location from where test-set should be imported.

      • s3BucketName (string) -- [REQUIRED]

        The name of the Amazon S3 bucket.

      • s3Path (string) -- [REQUIRED]

        The path inside the Amazon S3 bucket pointing to the test-set CSV file.

    • modality (string) -- [REQUIRED]

      Specifies whether the test-set being imported contains written or spoken data.

    • testSetTags (dict) --

      A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the UpdateTestSet operation to update tags. To update tags, use the TagResource operation.

      • (string) --

        • (string) --

type mergeStrategy

string

param mergeStrategy

[REQUIRED]

The strategy to use when there is a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

type filePassword

string

param filePassword

The password used to encrypt the zip archive that contains the resource definition. You should always encrypt the zip archive to protect it during transit between your site and Amazon Lex.

rtype

dict

returns

Response Syntax

{
    'importId': 'string',
    'resourceSpecification': {
        'botImportSpecification': {
            'botName': 'string',
            'roleArn': 'string',
            'dataPrivacy': {
                'childDirected': True|False
            },
            'idleSessionTTLInSeconds': 123,
            'botTags': {
                'string': 'string'
            },
            'testBotAliasTags': {
                'string': 'string'
            }
        },
        'botLocaleImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string',
            'nluIntentConfidenceThreshold': 123.0,
            'voiceSettings': {
                'voiceId': 'string',
                'engine': 'standard'|'neural'
            }
        },
        'customVocabularyImportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetImportResourceSpecification': {
            'testSetName': 'string',
            'description': 'string',
            'roleArn': 'string',
            'storageLocation': {
                's3BucketName': 'string',
                's3Path': 'string',
                'kmsKeyArn': 'string'
            },
            'importInputLocation': {
                's3BucketName': 'string',
                's3Path': 'string'
            },
            'modality': 'Text'|'Audio',
            'testSetTags': {
                'string': 'string'
            }
        }
    },
    'mergeStrategy': 'Overwrite'|'FailOnConflict'|'Append',
    'importStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
    'creationDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • importId (string) --

      A unique identifier for the import.

    • resourceSpecification (dict) --

      The parameters used when importing the resource.

      • botImportSpecification (dict) --

        Parameters for importing a bot.

        • botName (string) --

          The name that Amazon Lex should use for the bot.

        • roleArn (string) --

          The Amazon Resource Name (ARN) of the IAM role used to build and run the bot.

        • dataPrivacy (dict) --

          By default, data stored by Amazon Lex is encrypted. The DataPrivacy structure provides settings that determine how Amazon Lex handles special cases of securing the data for your bot.

          • childDirected (boolean) --

            For each Amazon Lex bot created with the Amazon Lex Model Building Service, you must specify whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to the Children's Online Privacy Protection Act (COPPA) by specifying true or false in the childDirected field. By specifying true in the childDirected field, you confirm that your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. By specifying false in the childDirected field, you confirm that your use of Amazon Lex is not related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. You may not specify a default value for the childDirected field that does not accurately reflect whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. If your use of Amazon Lex relates to a website, program, or other application that is directed in whole or in part, to children under age 13, you must obtain any required verifiable parental consent under COPPA. For information regarding the use of Amazon Lex in connection with websites, programs, or other applications that are directed or targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ.

        • idleSessionTTLInSeconds (integer) --

          The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.

          You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

        • botTags (dict) --

          A list of tags to add to the bot. You can only add tags when you import a bot. You can't use the UpdateBot operation to update tags. To update tags, use the TagResource operation.

          • (string) --

            • (string) --

        • testBotAliasTags (dict) --

          A list of tags to add to the test alias for a bot. You can only add tags when you import a bot. You can't use the UpdateAlias operation to update tags. To update tags on the test alias, use the TagResource operation.

          • (string) --

            • (string) --

      • botLocaleImportSpecification (dict) --

        Parameters for importing a bot locale.

        • botId (string) --

          The identifier of the bot to import the locale to.

        • botVersion (string) --

          The version of the bot to import the locale to. This can only be the DRAFT version of the bot.

        • localeId (string) --

          The identifier of the language and locale that the bot will be used in. The string must match one of the supported locales. All of the intents, slot types, and slots used in the bot must have the same locale. For more information, see Supported languages.

        • nluIntentConfidenceThreshold (float) --

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

          For example, suppose a bot is configured with the confidence threshold of 0.80 and the AMAZON.FallbackIntent . Amazon Lex returns three alternative intents with the following confidence scores: IntentA (0.70), IntentB (0.60), IntentC (0.50). The response from the PostText operation would be:

          • AMAZON.FallbackIntent

          • IntentA

          • IntentB

          • IntentC

        • voiceSettings (dict) --

          Defines settings for using an Amazon Polly voice to communicate with a user.

          • voiceId (string) --

            The identifier of the Amazon Polly voice to use.

          • engine (string) --

            Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

            If you do not specify a value, the default is standard .

      • customVocabularyImportSpecification (dict) --

        Provides the parameters required for importing a custom vocabulary.

        • botId (string) --

          The identifier of the bot to import the custom vocabulary to.

        • botVersion (string) --

          The version of the bot to import the custom vocabulary to.

        • localeId (string) --

          The identifier of the local to import the custom vocabulary to. The value must be en_GB .

      • testSetImportResourceSpecification (dict) --

        Specifications for the test set that is imported.

        • testSetName (string) --

          The name of the test set.

        • description (string) --

          The description of the test set.

        • roleArn (string) --

          The Amazon Resource Name (ARN) of an IAM role that has permission to access the test set.

        • storageLocation (dict) --

          Contains information about the location that Amazon Lex uses to store the test-set.

          • s3BucketName (string) --

            The name of the Amazon S3 bucket in which the test set is stored.

          • s3Path (string) --

            The path inside the Amazon S3 bucket where the test set is stored.

          • kmsKeyArn (string) --

            The Amazon Resource Name (ARN) of an Amazon Web Services Key Management Service (KMS) key for encrypting the test set.

        • importInputLocation (dict) --

          Contains information about the input location from where test-set should be imported.

          • s3BucketName (string) --

            The name of the Amazon S3 bucket.

          • s3Path (string) --

            The path inside the Amazon S3 bucket pointing to the test-set CSV file.

        • modality (string) --

          Specifies whether the test-set being imported contains written or spoken data.

        • testSetTags (dict) --

          A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the UpdateTestSet operation to update tags. To update tags, use the TagResource operation.

          • (string) --

            • (string) --

    • mergeStrategy (string) --

      The strategy used when there was a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

    • importStatus (string) --

      The current status of the import. When the status is Complete the bot, bot alias, or custom vocabulary is ready to use.

    • creationDateTime (datetime) --

      The date and time that the import request was created.

UpdateExport (updated) Link ¶
Changes (response)
{'fileFormat': {'CSV'},
 'resourceSpecification': {'testSetExportSpecification': {'testSetId': 'string'}}}

Updates the password used to protect an export zip archive.

The password is not required. If you don't supply a password, Amazon Lex generates a zip file that is not protected by a password. This is the archive that is available at the pre-signed S3 URL provided by the DescribeExport operation.

See also: AWS API Documentation

Request Syntax

client.update_export(
    exportId='string',
    filePassword='string'
)
type exportId

string

param exportId

[REQUIRED]

The unique identifier Amazon Lex assigned to the export.

type filePassword

string

param filePassword

The new password to use to encrypt the export zip archive.

rtype

dict

returns

Response Syntax

{
    'exportId': 'string',
    'resourceSpecification': {
        'botExportSpecification': {
            'botId': 'string',
            'botVersion': 'string'
        },
        'botLocaleExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'customVocabularyExportSpecification': {
            'botId': 'string',
            'botVersion': 'string',
            'localeId': 'string'
        },
        'testSetExportSpecification': {
            'testSetId': 'string'
        }
    },
    'fileFormat': 'LexJson'|'TSV'|'CSV',
    'exportStatus': 'InProgress'|'Completed'|'Failed'|'Deleting',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • exportId (string) --

      The unique identifier Amazon Lex assigned to the export.

    • resourceSpecification (dict) --

      A description of the type of resource that was exported, either a bot or a bot locale.

      • botExportSpecification (dict) --

        Parameters for exporting a bot.

        • botId (string) --

          The identifier of the bot assigned by Amazon Lex.

        • botVersion (string) --

          The version of the bot that was exported. This will be either DRAFT or the version number.

      • botLocaleExportSpecification (dict) --

        Parameters for exporting a bot locale.

        • botId (string) --

          The identifier of the bot to create the locale for.

        • botVersion (string) --

          The version of the bot to export.

        • localeId (string) --

          The identifier of the language and locale to export. The string must match one of the locales in the bot.

      • customVocabularyExportSpecification (dict) --

        The parameters required to export a custom vocabulary.

        • botId (string) --

          The identifier of the bot that contains the custom vocabulary to export.

        • botVersion (string) --

          The version of the bot that contains the custom vocabulary to export.

        • localeId (string) --

          The locale of the bot that contains the custom vocabulary to export.

      • testSetExportSpecification (dict) --

        Specifications for the test set that is exported as a resource.

        • testSetId (string) --

          The unique identifier of the test set.

    • fileFormat (string) --

      The file format used for the files that define the resource. The TSV format is required to export a custom vocabulary only; otherwise use LexJson format.

    • exportStatus (string) --

      The status of the export. When the status is Completed the export archive is available for download.

    • creationDateTime (datetime) --

      The date and time that the export was created.

    • lastUpdatedDateTime (datetime) --

      The date and time that the export was last updated.