LexModelsV2 / Client / start_import

start_import#

LexModelsV2.Client.start_import(**kwargs)#

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

response = 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'
        }
    },
    mergeStrategy='Overwrite'|'FailOnConflict'|'Append',
    filePassword='string'
)
Parameters:
  • importId (string) –

    [REQUIRED]

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

  • resourceSpecification (dict) –

    [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 engine parameter of the SynthesizeSpeech operation 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.

  • mergeStrategy (string) –

    [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.

  • filePassword (string) – 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.

Return type:

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'
        }
    },
    '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 engine parameter of the SynthesizeSpeech operation 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.

    • 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.

Exceptions

  • LexModelsV2.Client.exceptions.ThrottlingException

  • LexModelsV2.Client.exceptions.ServiceQuotaExceededException

  • LexModelsV2.Client.exceptions.ValidationException

  • LexModelsV2.Client.exceptions.ResourceNotFoundException

  • LexModelsV2.Client.exceptions.ConflictException

  • LexModelsV2.Client.exceptions.InternalServerException