public class PostTextRequest extends AmazonWebServiceRequest implements Serializable
Sends user input text to Amazon Lex at runtime. Amazon Lex uses the machine learning model that the service built for the application to interpret user input.
In response, Amazon Lex returns the next message to convey to the user (based
on the context of the user interaction) and whether to expect a user response
to the message (dialogState). For example, consider the
following response messages:
"What pizza toppings would you like?" – In this case, the
dialogState would be ElicitSlot (that is, a user
response is expected).
"Your order has been placed." – In this case, Amazon Lex returns one of the
following dialogState values depending on how the intent
fulfillment is configured (see fulfillmentActivity in
CreateIntent):
FulFilled – The intent fulfillment is configured through a
Lambda function.
ReadyForFulfilment – The intent's
fulfillmentActivity is to simply return the intent data back to
the client application.
| Constructor and Description |
|---|
PostTextRequest() |
| Modifier and Type | Method and Description |
|---|---|
PostTextRequest |
addsessionAttributesEntry(String key,
String value)
A session represents the dialog between a user and Amazon Lex.
|
PostTextRequest |
clearsessionAttributesEntries()
Removes all the entries added into sessionAttributes.
|
boolean |
equals(Object obj) |
String |
getBotAlias()
Alias of the Amazon Lex bot.
|
String |
getBotName()
Name of the Amazon Lex bot.
|
String |
getInputText()
Text user entered (Amazon Lex interprets this text).
|
Map<String,String> |
getSessionAttributes()
A session represents the dialog between a user and Amazon Lex.
|
String |
getUserId()
User ID of your client application.
|
int |
hashCode() |
void |
setBotAlias(String botAlias)
Alias of the Amazon Lex bot.
|
void |
setBotName(String botName)
Name of the Amazon Lex bot.
|
void |
setInputText(String inputText)
Text user entered (Amazon Lex interprets this text).
|
void |
setSessionAttributes(Map<String,String> sessionAttributes)
A session represents the dialog between a user and Amazon Lex.
|
void |
setUserId(String userId)
User ID of your client application.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PostTextRequest |
withBotAlias(String botAlias)
Alias of the Amazon Lex bot.
|
PostTextRequest |
withBotName(String botName)
Name of the Amazon Lex bot.
|
PostTextRequest |
withInputText(String inputText)
Text user entered (Amazon Lex interprets this text).
|
PostTextRequest |
withSessionAttributes(Map<String,String> sessionAttributes)
A session represents the dialog between a user and Amazon Lex.
|
PostTextRequest |
withUserId(String userId)
User ID of your client application.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic String getBotName()
Name of the Amazon Lex bot.
Name of the Amazon Lex bot.
public void setBotName(String botName)
Name of the Amazon Lex bot.
botName - Name of the Amazon Lex bot.
public PostTextRequest withBotName(String botName)
Name of the Amazon Lex bot.
Returns a reference to this object so that method calls can be chained together.
botName - Name of the Amazon Lex bot.
public String getBotAlias()
Alias of the Amazon Lex bot.
Alias of the Amazon Lex bot.
public void setBotAlias(String botAlias)
Alias of the Amazon Lex bot.
botAlias - Alias of the Amazon Lex bot.
public PostTextRequest withBotAlias(String botAlias)
Alias of the Amazon Lex bot.
Returns a reference to this object so that method calls can be chained together.
botAlias - Alias of the Amazon Lex bot.
public String getUserId()
User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
Constraints:
Length: 2 - 50
Pattern: [0-9a-zA-Z._:-]+
User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
public void setUserId(String userId)
User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
Constraints:
Length: 2 - 50
Pattern: [0-9a-zA-Z._:-]+
userId - User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
public PostTextRequest withUserId(String userId)
User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 2 - 50
Pattern: [0-9a-zA-Z._:-]+
userId - User ID of your client application. Typically, each of your application users should have a unique ID. Note the following considerations:
If you want a user to start a conversation on one mobile device and continue the conversation on another device, you might choose a user-specific identifier, such as a login or Amazon Cognito user ID (assuming your application is using Amazon Cognito).
If you want the same user to be able to have two independent conversations on two different devices, you might choose a device-specific identifier, such as device ID, or some globally unique identifier.
public Map<String,String> getSessionAttributes()
A session represents the dialog between a user and Amazon Lex. At
runtime, a client application can pass contextual information (session
attributes) in the request. For example, "FirstName" : "Joe"
. Amazon Lex passes these session attributes to the AWS Lambda functions
configured for the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location as a
session attribute (for example,
"Location" : "111 Maple street"), your Lambda function might
use this information to determine the closest pizzeria to place the
order.
Use session attributes to personalize prompts. For example, you pass in
user name as a session attribute ("FirstName" : "Joe"), you
might configure subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex substitutes a
real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
A session represents the dialog between a user and Amazon Lex. At
runtime, a client application can pass contextual information
(session attributes) in the request. For example,
"FirstName" : "Joe". Amazon Lex passes these session
attributes to the AWS Lambda functions configured for the intent
(see dialogCodeHook and
fulfillmentActivity.codeHook in
CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location as
a session attribute (for example,
"Location" : "111 Maple street"), your Lambda
function might use this information to determine the closest
pizzeria to place the order.
Use session attributes to personalize prompts. For example, you
pass in user name as a session attribute (
"FirstName" : "Joe"), you might configure subsequent
prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex
substitutes a real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
public void setSessionAttributes(Map<String,String> sessionAttributes)
A session represents the dialog between a user and Amazon Lex. At
runtime, a client application can pass contextual information (session
attributes) in the request. For example, "FirstName" : "Joe"
. Amazon Lex passes these session attributes to the AWS Lambda functions
configured for the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location as a
session attribute (for example,
"Location" : "111 Maple street"), your Lambda function might
use this information to determine the closest pizzeria to place the
order.
Use session attributes to personalize prompts. For example, you pass in
user name as a session attribute ("FirstName" : "Joe"), you
might configure subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex substitutes a
real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
sessionAttributes -
A session represents the dialog between a user and Amazon Lex.
At runtime, a client application can pass contextual
information (session attributes) in the request. For example,
"FirstName" : "Joe". Amazon Lex passes these
session attributes to the AWS Lambda functions configured for
the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in
CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location
as a session attribute (for example,
"Location" : "111 Maple street"), your Lambda
function might use this information to determine the closest
pizzeria to place the order.
Use session attributes to personalize prompts. For example,
you pass in user name as a session attribute (
"FirstName" : "Joe"), you might configure
subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex
substitutes a real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
public PostTextRequest withSessionAttributes(Map<String,String> sessionAttributes)
A session represents the dialog between a user and Amazon Lex. At
runtime, a client application can pass contextual information (session
attributes) in the request. For example, "FirstName" : "Joe"
. Amazon Lex passes these session attributes to the AWS Lambda functions
configured for the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location as a
session attribute (for example,
"Location" : "111 Maple street"), your Lambda function might
use this information to determine the closest pizzeria to place the
order.
Use session attributes to personalize prompts. For example, you pass in
user name as a session attribute ("FirstName" : "Joe"), you
might configure subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex substitutes a
real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
Returns a reference to this object so that method calls can be chained together.
sessionAttributes -
A session represents the dialog between a user and Amazon Lex.
At runtime, a client application can pass contextual
information (session attributes) in the request. For example,
"FirstName" : "Joe". Amazon Lex passes these
session attributes to the AWS Lambda functions configured for
the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in
CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location
as a session attribute (for example,
"Location" : "111 Maple street"), your Lambda
function might use this information to determine the closest
pizzeria to place the order.
Use session attributes to personalize prompts. For example,
you pass in user name as a session attribute (
"FirstName" : "Joe"), you might configure
subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex
substitutes a real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
public PostTextRequest addsessionAttributesEntry(String key, String value)
A session represents the dialog between a user and Amazon Lex. At
runtime, a client application can pass contextual information (session
attributes) in the request. For example, "FirstName" : "Joe"
. Amazon Lex passes these session attributes to the AWS Lambda functions
configured for the intent (see dialogCodeHook and
fulfillmentActivity.codeHook in CreateIntent).
In your Lambda function, you can use the session attributes for customization. Some examples are:
In a pizza ordering application, if you can pass user location as a
session attribute (for example,
"Location" : "111 Maple street"), your Lambda function might
use this information to determine the closest pizzeria to place the
order.
Use session attributes to personalize prompts. For example, you pass in
user name as a session attribute ("FirstName" : "Joe"), you
might configure subsequent prompts to refer to this attribute, as
$session.FirstName". At runtime, Amazon Lex substitutes a
real value when it generates a prompt, such as
"Hello Joe, what would you like to order?"
Amazon Lex does not persist session attributes.
If the intent is configured without a Lambda function to process the intent (that is, the client application to process the intent), Amazon Lex simply returns the session attributes back to the client application.
If the intent is configured with a Lambda function to process the intent, Amazon Lex passes the incoming session attributes to the Lambda function. The Lambda function must return these session attributes if you want Amazon Lex to return them back to the client.
The method adds a new key-value pair into sessionAttributes parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into sessionAttributes.value - The corresponding value of the entry to be added into
sessionAttributes.public PostTextRequest clearsessionAttributesEntries()
Returns a reference to this object so that method calls can be chained together.
public String getInputText()
Text user entered (Amazon Lex interprets this text).
Constraints:
Length: 1 - 1024
Text user entered (Amazon Lex interprets this text).
public void setInputText(String inputText)
Text user entered (Amazon Lex interprets this text).
Constraints:
Length: 1 - 1024
inputText - Text user entered (Amazon Lex interprets this text).
public PostTextRequest withInputText(String inputText)
Text user entered (Amazon Lex interprets this text).
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1024
inputText - Text user entered (Amazon Lex interprets this text).
public String toString()
toString in class ObjectObject.toString()Copyright © 2017. All rights reserved.