[ aws . lexv2-runtime ]

recognize-text

Description

Sends user input to Amazon Lex. Client applications use this API to send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input using the machine learning model that it build for the bot.

In response, Amazon Lex returns the next message to convey to the user and an optional response card to display.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  recognize-text
--bot-id <value>
--bot-alias-id <value>
--locale-id <value>
--session-id <value>
--text <value>
[--session-state <value>]
[--request-attributes <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--bot-id (string)

The identifier of the bot that processes the request.

--bot-alias-id (string)

The alias identifier in use for the bot that processes the request.

--locale-id (string)

The locale where the session is in use.

--session-id (string)

The identifier of the user session that is having the conversation.

--text (string)

The text that the user entered. Amazon Lex interprets this text.

--session-state (structure)

The current state of the dialog between the user and the bot.

dialogAction -> (structure)

The next step that Amazon Lex should take in the conversation with a user.

type -> (string)

The next action that the bot should take in its interaction with the user. The possible values are:

  • Close - Indicates that there will not be a response from the user. For example, the statement “Your order has been placed” does not require a response.

  • ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as “Place the order?”

  • Delegate - The next action is determined by Amazon Lex.

  • ElicitSlot - The next action is to elicit a slot value from the user.

slotToElicit -> (string)

The name of the slot that should be elicited from the user.

intent -> (structure)

The active intent that Amazon Lex is processing.

name -> (string)

The name of the intent.

slots -> (map)

A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.

key -> (string)

value -> (structure)

A value that Amazon Lex uses to fulfill an intent.

value -> (structure)

The current value of the slot.

originalValue -> (string)

The text of the utterance from the user that was entered for the slot.

interpretedValue -> (string)

The value that Amazon Lex determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex choose the first value in the resolvedValues list.

resolvedValues -> (list)

A list of additional values that have been recognized for the slot.

(string)

state -> (string)

Contains fulfillment information for the intent.

confirmationState -> (string)

Contains information about whether fulfillment of the intent has been confirmed.

activeContexts -> (list)

One or more contexts that indicate to Amazon Lex the context of a request. When a context is active, Amazon Lex considers intents with the matching context as a trigger as the next intent in a session.

(structure)

Contains information about the contexts that a user is using in a session. You can configure Amazon Lex to set a context when an intent is fulfilled, or you can set a context using the , , or operations.

Use a context to indicate to Amazon Lex intents that should be used as follow-up intents. For example, if the active context is order-fulfilled , only intents that have order-fulfilled configured as a trigger are considered for follow up.

name -> (string)

The name of the context.

timeToLive -> (structure)

Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.

timeToLiveInSeconds -> (integer)

The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).

turnsToLive -> (integer)

The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.

contextAttributes -> (map)

A lis tof contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.

If you don’t specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.

key -> (string)

value -> (string)

sessionAttributes -> (map)

Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex and a client application.

key -> (string)

value -> (string)

originatingRequestId -> (string)

JSON Syntax:

{
  "dialogAction": {
    "type": "Close"|"ConfirmIntent"|"Delegate"|"ElicitIntent"|"ElicitSlot",
    "slotToElicit": "string"
  },
  "intent": {
    "name": "string",
    "slots": {"string": {
          "value": {
            "originalValue": "string",
            "interpretedValue": "string",
            "resolvedValues": ["string", ...]
          }
        }
      ...},
    "state": "Failed"|"Fulfilled"|"InProgress"|"ReadyForFulfillment"|"Waiting",
    "confirmationState": "Confirmed"|"Denied"|"None"
  },
  "activeContexts": [
    {
      "name": "string",
      "timeToLive": {
        "timeToLiveInSeconds": integer,
        "turnsToLive": integer
      },
      "contextAttributes": {"string": "string"
        ...}
    }
    ...
  ],
  "sessionAttributes": {"string": "string"
    ...},
  "originatingRequestId": "string"
}

--request-attributes (map)

Request-specific information passed between the client application and Amazon Lex

The namespace x-amz-lex: is reserved for special attributes. Don’t create any request attributes with the prefix x-amz-lex: .

key -> (string)

value -> (string)

Shorthand Syntax:

KeyName1=string,KeyName2=string

JSON Syntax:

{"string": "string"
  ...}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Output

messages -> (list)

A list of messages last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.

(structure)

Container for text that is returned to the customer..

content -> (string)

The text of the message.

contentType -> (string)

Indicates the type of response.

imageResponseCard -> (structure)

A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.

When you use a response card, the response from the user is constrained to the text associated with a button on the card.

title -> (string)

The title to display on the response card. The format of the title is determined by the platform displaying the response card.

subtitle -> (string)

The subtitle to display on the response card. The format of the subtitle is determined by the platform displaying the response card.

imageUrl -> (string)

The URL of an image to display on the response card. The image URL must be publicly available so that the platform displaying the response card has access to the image.

buttons -> (list)

A list of buttons that should be displayed on the response card. The arrangement of the buttons is determined by the platform that displays the button.

(structure)

A button that appears on a response card show to the user.

text -> (string)

The text that is displayed on the button.

value -> (string)

The value returned to Amazon Lex when a user chooses the button.

sessionState -> (structure)

Represents the current state of the dialog between the user and the bot.

Use this to determine the progress of the conversation and what the next action may be.

dialogAction -> (structure)

The next step that Amazon Lex should take in the conversation with a user.

type -> (string)

The next action that the bot should take in its interaction with the user. The possible values are:

  • Close - Indicates that there will not be a response from the user. For example, the statement “Your order has been placed” does not require a response.

  • ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as “Place the order?”

  • Delegate - The next action is determined by Amazon Lex.

  • ElicitSlot - The next action is to elicit a slot value from the user.

slotToElicit -> (string)

The name of the slot that should be elicited from the user.

intent -> (structure)

The active intent that Amazon Lex is processing.

name -> (string)

The name of the intent.

slots -> (map)

A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.

key -> (string)

value -> (structure)

A value that Amazon Lex uses to fulfill an intent.

value -> (structure)

The current value of the slot.

originalValue -> (string)

The text of the utterance from the user that was entered for the slot.

interpretedValue -> (string)

The value that Amazon Lex determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex choose the first value in the resolvedValues list.

resolvedValues -> (list)

A list of additional values that have been recognized for the slot.

(string)

state -> (string)

Contains fulfillment information for the intent.

confirmationState -> (string)

Contains information about whether fulfillment of the intent has been confirmed.

activeContexts -> (list)

One or more contexts that indicate to Amazon Lex the context of a request. When a context is active, Amazon Lex considers intents with the matching context as a trigger as the next intent in a session.

(structure)

Contains information about the contexts that a user is using in a session. You can configure Amazon Lex to set a context when an intent is fulfilled, or you can set a context using the , , or operations.

Use a context to indicate to Amazon Lex intents that should be used as follow-up intents. For example, if the active context is order-fulfilled , only intents that have order-fulfilled configured as a trigger are considered for follow up.

name -> (string)

The name of the context.

timeToLive -> (structure)

Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.

timeToLiveInSeconds -> (integer)

The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).

turnsToLive -> (integer)

The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.

contextAttributes -> (map)

A lis tof contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.

If you don’t specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.

key -> (string)

value -> (string)

sessionAttributes -> (map)

Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex and a client application.

key -> (string)

value -> (string)

originatingRequestId -> (string)

interpretations -> (list)

A list of intents that Amazon Lex determined might satisfy the user’s utterance.

Each interpretation includes the intent, a score that indicates now confident Amazon Lex is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.

(structure)

An intent that Amazon Lex determined might satisfy the user’s utterance. The intents are ordered by the confidence score.

nluConfidence -> (structure)

Determines the threshold where Amazon Lex will insert the AMAZON.FallbackIntent , AMAZON.KendraSearchIntent , or both when returning alternative intents in a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.

score -> (double)

A score that indicates how confident Amazon Lex is that an intent satisfies the user’s intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.

sentimentResponse -> (structure)

The sentiment expressed in an utterance.

When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.

sentiment -> (string)

The overall sentiment expressed in the user’s response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend.

sentimentScore -> (structure)

The individual sentiment responses for the utterance.

positive -> (double)

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE sentiment.

negative -> (double)

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE sentiment.

neutral -> (double)

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL sentiment.

mixed -> (double)

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED sentiment.

intent -> (structure)

A list of intents that might satisfy the user’s utterance. The intents are ordered by the confidence score.

name -> (string)

The name of the intent.

slots -> (map)

A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.

key -> (string)

value -> (structure)

A value that Amazon Lex uses to fulfill an intent.

value -> (structure)

The current value of the slot.

originalValue -> (string)

The text of the utterance from the user that was entered for the slot.

interpretedValue -> (string)

The value that Amazon Lex determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex choose the first value in the resolvedValues list.

resolvedValues -> (list)

A list of additional values that have been recognized for the slot.

(string)

state -> (string)

Contains fulfillment information for the intent.

confirmationState -> (string)

Contains information about whether fulfillment of the intent has been confirmed.

requestAttributes -> (map)

The attributes sent in the request.

key -> (string)

value -> (string)

sessionId -> (string)

The identifier of the session in use.