Skip to main content

intents

Creates, updates, deletes, gets or lists an intents resource.

Overview

Nameintents
TypeResource
Idaws.lex_models.intents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the intent. (pattern: <code>^([A-Za-z]_?)+$</code>)
checksumstringChecksum of the intent.
conclusion_statementobjectAfter the Lambda function specified in the fulfillmentActivity element fulfills the intent, Amazon Lex conveys this statement to the user.
confirmation_promptobjectIf defined in the bot, Amazon Lex uses prompt to confirm the intent before fulfilling the user's request. For more information, see PutIntent.
created_datestring (date-time)The date that the intent was created.
descriptionstringA description of the intent.
dialog_code_hookobjectIf defined in the bot, Amazon Amazon Lex invokes this Lambda function for each user input. For more information, see PutIntent.
follow_up_promptobjectIf defined in the bot, Amazon Lex uses this prompt to solicit additional user activity after the intent is fulfilled. For more information, see PutIntent.
fulfillment_activityobjectDescribes how the intent is fulfilled. For more information, see PutIntent.
input_contextsarrayAn array of InputContext objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.
kendra_configurationobjectConfiguration information, if any, to connect to an Amazon Kendra index with the AMAZON.KendraSearchIntent intent.
last_updated_datestring (date-time)The date that the intent was updated. When you create a resource, the creation date and the last updated date are the same.
output_contextsarrayAn array of OutputContext objects that lists the contexts that the intent activates when the intent is fulfilled.
parent_intent_signaturestringA unique identifier for a built-in intent.
rejection_statementobjectIf the user answers "no" to the question defined in confirmationPrompt, Amazon Lex responds with this statement to acknowledge that the intent was canceled.
sample_utterancesarrayAn array of sample utterances configured for the intent.
slotsarrayAn array of intent slots configured for the intent.
versionstringThe version of the intent. (pattern: <code>$LATEST|[0-9]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_intentselectname, version, regionReturns information about an intent. In addition to the intent name, you must specify the intent version. This operation requires permissions to perform the lex:GetIntent action.
get_intentsselectregionnextToken, maxResults, nameContainsReturns intent information as follows: If you specify the nameContains field, returns the $LATEST version of all intents that contain the specified string. If you don't specify the nameContains field, returns information about the $LATEST version of all intents. The operation requires permission for the lex:GetIntents action.
put_intentreplacename, regionCreates an intent or replaces an existing intent. To define the interaction between the user and your bot, you use one or more intents. For a pizza ordering bot, for example, you would create an OrderPizza intent. To create an intent or replace an existing intent, you must provide the following: Intent name. For example, OrderPizza. Sample utterances. For example, "Can I order a pizza, please." and "I want to order a pizza." Information to be gathered. You specify slot types for the information that your bot will request from the user. You can specify standard slot types, such as a date or a time, or custom slot types such as the size and crust of a pizza. How the intent will be fulfilled. You can provide a Lambda function or configure the intent to return the intent information to the client application. If you use a Lambda function, when all of the intent information is available, Amazon Lex invokes your Lambda function. If you configure your intent to return the intent information to the client application. You can specify other optional information in the request, such as: A confirmation prompt to ask the user to confirm an intent. For example, "Shall I order your pizza?" A conclusion statement to send to the user after the intent has been fulfilled. For example, "I placed your pizza order." A follow-up prompt that asks the user for additional activity. For example, asking "Do you want to order a drink with your pizza?" If you specify an existing intent name to update the intent, Amazon Lex replaces the values in the $LATEST version of the intent with the values in the request. Amazon Lex removes fields that you don't provide in the request. If you don't specify the required fields, Amazon Lex throws an exception. When you update the $LATEST version of an intent, the status field of any bot that uses the $LATEST version of the intent is set to NOT_BUILT. For more information, see how-it-works. This operation requires permissions for the lex:PutIntent action.
delete_intentdeletename, regionDeletes all versions of the intent, including the $LATEST version. To delete a specific version of the intent, use the DeleteIntentVersion operation. You can delete a version of an intent only if it is not referenced. To delete an intent that is referred to in one or more bots (see how-it-works), you must remove those references first. If you get the ResourceInUseException exception, it provides an example reference that shows where the intent is referenced. To remove the reference to the intent, either update the bot or delete it. If you get the same exception when you attempt to delete the intent again, repeat until the intent has no references and the call to DeleteIntent is successful. This operation requires permission for the lex:DeleteIntent 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
namestringThe name of the intent. The name is case sensitive.
regionstringAWS region (default: us-east-1)
versionstringThe version of the intent.
maxResultsintegerThe maximum number of intents to return in the response. The default is 10.
nameContainsstringSubstring to match in intent names. An intent 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 intents. If the response to this API call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of intents, specify the pagination token in the next request.

SELECT examples

Returns information about an intent. In addition to the intent name, you must specify the intent version. This operation requires permissions to perform the lex:GetIntent action.

SELECT
name,
checksum,
conclusion_statement,
confirmation_prompt,
created_date,
description,
dialog_code_hook,
follow_up_prompt,
fulfillment_activity,
input_contexts,
kendra_configuration,
last_updated_date,
output_contexts,
parent_intent_signature,
rejection_statement,
sample_utterances,
slots,
version
FROM aws.lex_models.intents
WHERE name = '{{ name }}' -- required
AND version = '{{ version }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Creates an intent or replaces an existing intent. To define the interaction between the user and your bot, you use one or more intents. For a pizza ordering bot, for example, you would create an OrderPizza intent. To create an intent or replace an existing intent, you must provide the following: Intent name. For example, OrderPizza. Sample utterances. For example, "Can I order a pizza, please." and "I want to order a pizza." Information to be gathered. You specify slot types for the information that your bot will request from the user. You can specify standard slot types, such as a date or a time, or custom slot types such as the size and crust of a pizza. How the intent will be fulfilled. You can provide a Lambda function or configure the intent to return the intent information to the client application. If you use a Lambda function, when all of the intent information is available, Amazon Lex invokes your Lambda function. If you configure your intent to return the intent information to the client application. You can specify other optional information in the request, such as: A confirmation prompt to ask the user to confirm an intent. For example, "Shall I order your pizza?" A conclusion statement to send to the user after the intent has been fulfilled. For example, "I placed your pizza order." A follow-up prompt that asks the user for additional activity. For example, asking "Do you want to order a drink with your pizza?" If you specify an existing intent name to update the intent, Amazon Lex replaces the values in the $LATEST version of the intent with the values in the request. Amazon Lex removes fields that you don't provide in the request. If you don't specify the required fields, Amazon Lex throws an exception. When you update the $LATEST version of an intent, the status field of any bot that uses the $LATEST version of the intent is set to NOT_BUILT. For more information, see how-it-works. This operation requires permissions for the lex:PutIntent action.

REPLACE aws.lex_models.intents
SET
description = '{{ description }}',
slots = '{{ slots }}',
sampleUtterances = '{{ sampleUtterances }}',
confirmationPrompt = '{{ confirmationPrompt }}',
rejectionStatement = '{{ rejectionStatement }}',
followUpPrompt = '{{ followUpPrompt }}',
conclusionStatement = '{{ conclusionStatement }}',
dialogCodeHook = '{{ dialogCodeHook }}',
fulfillmentActivity = '{{ fulfillmentActivity }}',
parentIntentSignature = '{{ parentIntentSignature }}',
checksum = '{{ checksum }}',
createVersion = {{ createVersion }},
kendraConfiguration = '{{ kendraConfiguration }}',
inputContexts = '{{ inputContexts }}',
outputContexts = '{{ outputContexts }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
RETURNING
name,
checksum,
conclusion_statement,
confirmation_prompt,
create_version,
created_date,
description,
dialog_code_hook,
follow_up_prompt,
fulfillment_activity,
input_contexts,
kendra_configuration,
last_updated_date,
output_contexts,
parent_intent_signature,
rejection_statement,
sample_utterances,
slots,
version;

DELETE examples

Deletes all versions of the intent, including the $LATEST version. To delete a specific version of the intent, use the DeleteIntentVersion operation. You can delete a version of an intent only if it is not referenced. To delete an intent that is referred to in one or more bots (see how-it-works), you must remove those references first. If you get the ResourceInUseException exception, it provides an example reference that shows where the intent is referenced. To remove the reference to the intent, either update the bot or delete it. If you get the same exception when you attempt to delete the intent again, repeat until the intent has no references and the call to DeleteIntent is successful. This operation requires permission for the lex:DeleteIntent action.

DELETE FROM aws.lex_models.intents
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
;