intents
Creates, updates, deletes, gets or lists an intents resource.
Overview
| Name | intents |
| Type | Resource |
| Id | aws.lex_models.intents |
Fields
The following fields are returned by SELECT queries:
- get_intent
- get_intents
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the intent. (pattern: <code>^([A-Za-z]_?)+$</code>) |
checksum | string | Checksum of the intent. |
conclusion_statement | object | After the Lambda function specified in the fulfillmentActivity element fulfills the intent, Amazon Lex conveys this statement to the user. |
confirmation_prompt | object | If defined in the bot, Amazon Lex uses prompt to confirm the intent before fulfilling the user's request. For more information, see PutIntent. |
created_date | string (date-time) | The date that the intent was created. |
description | string | A description of the intent. |
dialog_code_hook | object | If defined in the bot, Amazon Amazon Lex invokes this Lambda function for each user input. For more information, see PutIntent. |
follow_up_prompt | object | If 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_activity | object | Describes how the intent is fulfilled. For more information, see PutIntent. |
input_contexts | array | An 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_configuration | object | Configuration information, if any, to connect to an Amazon Kendra index with the AMAZON.KendraSearchIntent intent. |
last_updated_date | string (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_contexts | array | An array of OutputContext objects that lists the contexts that the intent activates when the intent is fulfilled. |
parent_intent_signature | string | A unique identifier for a built-in intent. |
rejection_statement | object | If the user answers "no" to the question defined in confirmationPrompt, Amazon Lex responds with this statement to acknowledge that the intent was canceled. |
sample_utterances | array | An array of sample utterances configured for the intent. |
slots | array | An array of intent slots configured for the intent. |
version | string | The version of the intent. (pattern: <code>$LATEST|[0-9]+</code>) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the intent. (pattern: <code>^([A-Za-z]_?)+$</code>) |
created_date | string (date-time) | The date that the intent was created. |
description | string | A description of the intent. |
last_updated_date | string (date-time) | The date that the intent was updated. When you create an intent, the creation date and last updated date are the same. |
version | string | The version of the intent. (pattern: <code>$LATEST|[0-9]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_intent | select | name, version, region | 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. | |
get_intents | select | region | nextToken, maxResults, nameContains | Returns 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_intent | replace | name, region | 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. | |
delete_intent | delete | name, region | 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. |
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 |
|---|---|---|
name | string | The name of the intent. The name is case sensitive. |
region | string | AWS region (default: us-east-1) |
version | string | The version of the intent. |
maxResults | integer | The maximum number of intents to return in the response. The default is 10. |
nameContains | string | Substring 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." |
nextToken | string | A 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
- get_intent
- get_intents
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
;
Returns 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.
SELECT
name,
created_date,
description,
last_updated_date,
version
FROM aws.lex_models.intents
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND nameContains = '{{ nameContains }}'
;
REPLACE examples
- put_intent
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
- delete_intent
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
;