Skip to main content

bots

Creates, updates, deletes, gets or lists a bots resource.

Overview

Namebots
TypeResource
Idaws.lex_models.bots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the bot. (pattern: <code>^([A-Za-z]_?)+$</code>)
abort_statementobjectThe message that Amazon Lex returns when the user elects to end the conversation without completing it. For more information, see PutBot.
checksumstringChecksum of the bot used to identify a specific revision of the bot's $LATEST version.
child_directedbooleanFor 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.
clarification_promptobjectThe message Amazon Lex uses when it doesn't understand the user's request. For more information, see PutBot.
created_datestring (date-time)The date that the bot was created.
descriptionstringA description of the bot.
detect_sentimentbooleanIndicates whether user utterances should be sent to Amazon Comprehend for sentiment analysis.
enable_model_improvementsbooleanIndicates whether the bot uses accuracy improvements. true indicates that the bot is using the improvements, otherwise, false.
failure_reasonstringIf status is FAILED, Amazon Lex explains why it failed to build the bot.
idle_session_ttl_in_secondsintegerThe maximum time in seconds that Amazon Lex retains the data gathered in a conversation. For more information, see PutBot.
intentsarrayAn array of intent objects. For more information, see PutBot.
last_updated_datestring (date-time)The date that the bot was updated. When you create a resource, the creation date and last updated date are the same.
localestringThe target locale for the bot. (de-DE, en-AU, en-GB, en-IN, en-US, es-419, es-ES, es-US, fr-FR, fr-CA, it-IT, ja-JP, ko-KR)
nlu_intent_confidence_thresholdnumber (double)The score that determines where Amazon Lex inserts the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a PostContent or PostText response. AMAZON.FallbackIntent is inserted if the confidence score for all intents is below this value. AMAZON.KendraSearchIntent is only inserted if it is configured for the bot.
statusstringThe status of the bot. When the status is BUILDING Amazon Lex is building the bot for testing and use. If the status of the bot is READY_BASIC_TESTING, you can test the bot using the exact utterances specified in the bot's intents. When the bot is ready for full testing or to run, the status is READY. If there was a problem with building the bot, the status is FAILED and the failureReason field explains why the bot did not build. If the bot was saved but not built, the status is NOT_BUILT. (BUILDING, READY, READY_BASIC_TESTING, FAILED, NOT_BUILT)
versionstringThe version of the bot. For a new bot, the version is always $LATEST. (pattern: <code>$LATEST|[0-9]+</code>)
voice_idstringThe Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user. For more information, see PutBot.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_botselectname, versionoralias, regionReturns metadata information for a specific bot. You must provide the bot name and the bot version or alias. This operation requires permissions for the lex:GetBot action.
get_botsselectregionnextToken, maxResults, nameContainsReturns bot information as follows: If you provide the nameContains field, the response includes information for the $LATEST version of all bots whose name contains the specified string. If you don't specify the nameContains field, the operation returns information about the $LATEST version of all of your bots. This operation requires permission for the lex:GetBots action.
put_botreplacename, region, locale, childDirectedCreates an Amazon Lex conversational bot or replaces an existing bot. When you create or update a bot you are only required to specify a name, a locale, and whether the bot is directed toward children under age 13. You can use this to add intents later, or to remove intents from an existing bot. When you create a bot with the minimum information, the bot is created or updated but Amazon Lex returns the response FAILED. You can build the bot after you add one or more intents. For more information about Amazon Lex bots, see how-it-works. If you specify the name of an existing bot, the fields in the request replace the existing values in the $LATEST version of the bot. Amazon Lex removes any fields that you don't provide values for in the request, except for the idleTTLInSeconds and privacySettings fields, which are set to their default values. If you don't specify values for required fields, Amazon Lex throws an exception. This operation requires permissions for the lex:PutBot action. For more information, see security-iam.
delete_utterancesdeletebot_name, user_id, regionDeletes stored utterances. Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the GetUtterancesView operation, and then stored indefinitely for use in improving the ability of your bot to respond to user input. Use the DeleteUtterances operation to manually delete stored utterances for a specific user. When you use the DeleteUtterances operation, utterances stored for improving your bot's ability to respond to user input are deleted immediately. Utterances stored for use with the GetUtterancesView operation are deleted after 15 days. This operation requires permissions for the lex:DeleteUtterances action.
delete_botdeletename, regionDeletes all versions of the bot, including the $LATEST version. To delete a specific version of the bot, use the DeleteBotVersion operation. The DeleteBot operation doesn't immediately remove the bot schema. Instead, it is marked for deletion and removed later. Amazon Lex stores utterances indefinitely for improving the ability of your bot to respond to user inputs. These utterances are not removed when the bot is deleted. To remove the utterances, use the DeleteUtterances operation. If a bot has an alias, you can't delete it. Instead, the DeleteBot operation returns a ResourceInUseException exception that includes a reference to the alias that refers to the bot. To remove the reference to the bot, delete the alias. If you get the same exception again, delete the referring alias until the DeleteBot operation is successful. This operation requires permissions for the lex:DeleteBot action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
bot_namestringThe name of the bot that stored the utterances.
namestringThe name of the bot. The name is case sensitive.
regionstringAWS region (default: us-east-1)
user_idstringThe unique identifier for the user that made the utterances. This is the user ID that was sent in the PostContent or PostText operation request that contained the utterance.
versionoraliasstringThe version or alias of the bot.
maxResultsintegerThe maximum number of bots to return in the response that the request will return. The default is 10.
nameContainsstringSubstring to match in bot names. A bot will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."
nextTokenstringA pagination token that fetches the next page of bots. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of bots, specify the pagination token in the next request.

SELECT examples

Returns metadata information for a specific bot. You must provide the bot name and the bot version or alias. This operation requires permissions for the lex:GetBot action.

SELECT
name,
abort_statement,
checksum,
child_directed,
clarification_prompt,
created_date,
description,
detect_sentiment,
enable_model_improvements,
failure_reason,
idle_session_ttl_in_seconds,
intents,
last_updated_date,
locale,
nlu_intent_confidence_threshold,
status,
version,
voice_id
FROM aws.lex_models.bots
WHERE name = '{{ name }}' -- required
AND versionoralias = '{{ versionoralias }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Creates an Amazon Lex conversational bot or replaces an existing bot. When you create or update a bot you are only required to specify a name, a locale, and whether the bot is directed toward children under age 13. You can use this to add intents later, or to remove intents from an existing bot. When you create a bot with the minimum information, the bot is created or updated but Amazon Lex returns the response FAILED. You can build the bot after you add one or more intents. For more information about Amazon Lex bots, see how-it-works. If you specify the name of an existing bot, the fields in the request replace the existing values in the $LATEST version of the bot. Amazon Lex removes any fields that you don't provide values for in the request, except for the idleTTLInSeconds and privacySettings fields, which are set to their default values. If you don't specify values for required fields, Amazon Lex throws an exception. This operation requires permissions for the lex:PutBot action. For more information, see security-iam.

REPLACE aws.lex_models.bots
SET
description = '{{ description }}',
intents = '{{ intents }}',
enableModelImprovements = {{ enableModelImprovements }},
nluIntentConfidenceThreshold = {{ nluIntentConfidenceThreshold }},
clarificationPrompt = '{{ clarificationPrompt }}',
abortStatement = '{{ abortStatement }}',
idleSessionTTLInSeconds = {{ idleSessionTTLInSeconds }},
voiceId = '{{ voiceId }}',
checksum = '{{ checksum }}',
processBehavior = '{{ processBehavior }}',
locale = '{{ locale }}',
childDirected = {{ childDirected }},
detectSentiment = {{ detectSentiment }},
createVersion = {{ createVersion }},
tags = '{{ tags }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND locale = '{{ locale }}' --required
AND childDirected = {{ childDirected }} --required
RETURNING
name,
abort_statement,
checksum,
child_directed,
clarification_prompt,
create_version,
created_date,
description,
detect_sentiment,
enable_model_improvements,
failure_reason,
idle_session_ttl_in_seconds,
intents,
last_updated_date,
locale,
nlu_intent_confidence_threshold,
status,
tags,
version,
voice_id;

DELETE examples

Deletes stored utterances. Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the GetUtterancesView operation, and then stored indefinitely for use in improving the ability of your bot to respond to user input. Use the DeleteUtterances operation to manually delete stored utterances for a specific user. When you use the DeleteUtterances operation, utterances stored for improving your bot's ability to respond to user input are deleted immediately. Utterances stored for use with the GetUtterancesView operation are deleted after 15 days. This operation requires permissions for the lex:DeleteUtterances action.

DELETE FROM aws.lex_models.bots
WHERE bot_name = '{{ bot_name }}' --required
AND user_id = '{{ user_id }}' --required
AND region = '{{ region }}' --required
;