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. .
| Modifier and Type | Field and Description |
|---|---|
protected List<com.amazonaws.transform.JsonErrorUnmarshaller> |
jsonErrorUnmarshallers
List of exception unmarshallers for all Amazon Lex Runtime Service
exceptions.
|
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset| Constructor and Description |
|---|
AmazonLexRuntimeClient()
Deprecated.
|
AmazonLexRuntimeClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AmazonLexRuntime
using the specified AWS account credentials.
|
AmazonLexRuntimeClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AmazonLexRuntime
using the specified AWS account credentials and client configuration
options.
|
AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AmazonLexRuntime
using the specified AWS account credentials provider.
|
AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AmazonLexRuntime
using the specified AWS account credentials provider and client
configuration options.
|
AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
HttpClient httpClient)
Constructs a new client to invoke service methods on AmazonLexRuntime
using the specified AWS account credentials provider, client
configuration options and request metric collector.
|
AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
Deprecated.
|
AmazonLexRuntimeClient(ClientConfiguration clientConfiguration)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Deprecated.
ResponseMetadata cache can hold up to 50 requests and
responses in memory and will cause memory issue. This method
now always returns null.
|
PostContentResult |
postContent(PostContentRequest postContentRequest)
Sends user input (speech or text), at runtime, to Amazon Lex.
|
PostTextResult |
postText(PostTextRequest postTextRequest)
Sends user input text to Amazon Lex at runtime.
|
addRequestHandler, addRequestHandler, configSigner, configSigner, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setConfiguration, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withTimeOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetEndpoint, setRegion, shutdownprotected List<com.amazonaws.transform.JsonErrorUnmarshaller> jsonErrorUnmarshallers
@Deprecated public AmazonLexRuntimeClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain@Deprecated public AmazonLexRuntimeClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration - The client configuration options controlling
how this client connects to AmazonLexRuntime (ex: proxy
settings, retry counts, etc.).DefaultAWSCredentialsProviderChainpublic AmazonLexRuntimeClient(AWSCredentials awsCredentials)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider that
returns AWSSessionCredentials.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials - The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.public AmazonLexRuntimeClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider that
returns AWSSessionCredentials.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials - The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.clientConfiguration - The client configuration options controlling
how this client connects to AmazonLexRuntime (ex: proxy
settings, retry counts, etc.).public AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider that
returns AWSSessionCredentials.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider - The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.public AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider that
returns AWSSessionCredentials.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider - The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration - The client configuration options controlling
how this client connects to AmazonLexRuntime (ex: proxy
settings, retry counts, etc.).@Deprecated public AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider - The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration - The client configuration options controlling
how this client connects to AmazonLexRuntime (ex: proxy
settings, retry counts, etc.).requestMetricCollector - optional request metric collectorpublic AmazonLexRuntimeClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider - The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration - The client configuration options controlling
how this client connects to AmazonLexRuntime (ex: proxy
settings, retry counts, etc.).httpClient - A http clientpublic PostContentResult postContent(PostContentRequest postContentRequest) throws AmazonServiceException, AmazonClientException
Sends user input (speech or text), at runtime, to Amazon Lex. Amazon Lex uses the machine learning model (built for the specific bot), in order to interpret the user input specified in the request.
When building Amazon Lex text bots, you can use the PostText
API operation, which supports response cards. When building Amazon Lex
bots that communicate by speech alone or by speech and text, you use the
this API.
In response, Amazon Lex returns the next message to convey
to the user and the message type (dialogState). Based on the
user interaction context, Amazon Lex knows the message to return and the
message type indicates whether to expect a user response for that
message. For example, consider the following response messages:
"What pizza toppings would you like?" - For this message, the
dialogState would be ElicitSlot (that is, a
user response is expected).
"Your order has been placed." - For this message, Amazon Lex returns one
of the following dialog states depending on how the fulfillment is
configured for the intent (see fulfillmentActivity in
CreateIntent):
FulFilled – The intent fulfillmentActivity is
configured with a Lambda function to fulfill the intent.
ReadyForFulfilment – The intent's
fulfillmentActivity is configured to simply return the
intent data back to the client application.
postContent in interface AmazonLexRuntimepostContentRequest - NotFoundExceptionBadRequestExceptionLimitExceededExceptionInternalFailureExceptionConflictExceptionUnsupportedMediaTypeExceptionNotAcceptableExceptionRequestTimeoutExceptionDependencyFailedExceptionBadGatewayExceptionLoopDetectedExceptionAmazonClientException - If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException - If an error response is returned by Amazon
Lex Runtime Service indicating either a problem with the data
in the request, or a server side issue.public PostTextResult postText(PostTextRequest postTextRequest) throws AmazonServiceException, AmazonClientException
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 AmazonLexRuntimepostTextRequest - NotFoundExceptionBadRequestExceptionLimitExceededExceptionInternalFailureExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionLoopDetectedExceptionAmazonClientException - If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException - If an error response is returned by Amazon
Lex Runtime Service indicating either a problem with the data
in the request, or a server side issue.@Deprecated 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 AmazonLexRuntimerequest - The originally executed requestCopyright © 2017. All rights reserved.