bots
Creates, updates, deletes, gets or lists a bots resource.
Overview
| Name | bots |
| Type | Resource |
| Id | aws.lex_models.bots |
Fields
The following fields are returned by SELECT queries:
- get_bot
- get_bots
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the bot. (pattern: <code>^([A-Za-z]_?)+$</code>) |
abort_statement | object | The message that Amazon Lex returns when the user elects to end the conversation without completing it. For more information, see PutBot. |
checksum | string | Checksum of the bot used to identify a specific revision of the bot's $LATEST version. |
child_directed | 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. |
clarification_prompt | object | The message Amazon Lex uses when it doesn't understand the user's request. For more information, see PutBot. |
created_date | string (date-time) | The date that the bot was created. |
description | string | A description of the bot. |
detect_sentiment | boolean | Indicates whether user utterances should be sent to Amazon Comprehend for sentiment analysis. |
enable_model_improvements | boolean | Indicates whether the bot uses accuracy improvements. true indicates that the bot is using the improvements, otherwise, false. |
failure_reason | string | If status is FAILED, Amazon Lex explains why it failed to build the bot. |
idle_session_ttl_in_seconds | integer | The maximum time in seconds that Amazon Lex retains the data gathered in a conversation. For more information, see PutBot. |
intents | array | An array of intent objects. For more information, see PutBot. |
last_updated_date | string (date-time) | The date that the bot was updated. When you create a resource, the creation date and last updated date are the same. |
locale | string | The 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_threshold | number (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. |
status | string | The 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) |
version | string | The version of the bot. For a new bot, the version is always $LATEST. (pattern: <code>$LATEST|[0-9]+</code>) |
voice_id | string | The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user. For more information, see PutBot. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the bot. (pattern: <code>^([A-Za-z]_?)+$</code>) |
created_date | string (date-time) | The date that the bot was created. |
description | string | A description of the bot. |
last_updated_date | string (date-time) | The date that the bot was updated. When you create a bot, the creation date and last updated date are the same. |
status | string | The status of the bot. (BUILDING, READY, READY_BASIC_TESTING, FAILED, NOT_BUILT) |
version | string | The version of the bot. For a new bot, the version is always $LATEST. (pattern: <code>$LATEST|[0-9]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_bot | select | name, versionoralias, region | 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. | |
get_bots | select | region | nextToken, maxResults, nameContains | Returns 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_bot | replace | name, region, locale, childDirected | 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. | |
delete_utterances | delete | bot_name, user_id, region | 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_bot | delete | name, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
bot_name | string | The name of the bot that stored the utterances. |
name | string | The name of the bot. The name is case sensitive. |
region | string | AWS region (default: us-east-1) |
user_id | string | The 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. |
versionoralias | string | The version or alias of the bot. |
maxResults | integer | The maximum number of bots to return in the response that the request will return. The default is 10. |
nameContains | string | Substring 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." |
nextToken | string | A 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
- get_bot
- get_bots
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
;
Returns 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.
SELECT
name,
created_date,
description,
last_updated_date,
status,
version
FROM aws.lex_models.bots
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND nameContains = '{{ nameContains }}'
;
REPLACE examples
- put_bot
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
- delete_utterances
- delete_bot
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
;
Deletes 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.
DELETE FROM aws.lex_models.bots
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
;