@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonLexRuntimeClient extends AmazonWebServiceClient implements AmazonLexRuntime
Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of operations (API). Your application uses the runtime API to understand user utterances (user input text or voice). For example, suppose user says "I want pizza", your application sends this input to Amazon Lex using the runtime API. Amazon Lex recognizes that the user request is for the OrderPizza intent (one of the intents defined in the application). Then Amazon Lex engages in user conversation on behalf of the application to elicit required information (slot values, such as pizza size and crust type), and then performs fulfillment activity (that you configured when you created the application). You use the build-time API to create and manage your Amazon Lex applications. For a list of build-time operations, see the build-time API. .
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AmazonLexRuntimeClientBuilder |
builder() |
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
PostTextResult |
postText(PostTextRequest postTextRequest)
Sends user input text to Amazon Lex at runtime.
|
addRequestHandler, addRequestHandler, configureRegion, getEndpointPrefix, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shutdown
public static AmazonLexRuntimeClientBuilder builder()
public PostTextResult postText(PostTextRequest postTextRequest)
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.
postText
in interface AmazonLexRuntime
postTextRequest
- NotFoundException
- Resource (such as the Amazon Lex bot or an alias) referred is not found.BadRequestException
- Request validation failed, there is no usable message in the context, or the bot build failed.LimitExceededException
InternalFailureException
- Internal service error. Retry the call.ConflictException
- Two clients are using the same AWS account, Amazon Lex bot, and user ID.DependencyFailedException
- One of the downstream dependencies, such as AWS Lambda or Amazon Polly, threw an exception. For example,
if Amazon Lex does not have sufficient permissions to call a Lambda function which results in AWS Lambda
throwing an exception.BadGatewayException
- Either the Amazon Lex bot is still building, or one of the dependent services (Amazon Polly, AWS Lambda)
failed with an internal service error.LoopDetectedException
- Lambda fulfilment function returned DelegateDialogAction
to Amazon Lex without changing any
slot values.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonLexRuntime
request
- The originally executed requestCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.