@Generated(value="software.amazon.awssdk:codegen") @ThreadSafe public interface LexRuntimeV2Client extends AwsClient
builder() method.
This section contains documentation for the Amazon Lex V2 Runtime V2 API operations.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider. |
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static LexRuntimeV2ClientBuilder |
builder()
Create a builder that can be used to configure and create a
LexRuntimeV2Client. |
static LexRuntimeV2Client |
create()
Create a
LexRuntimeV2Client with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
default DeleteSessionResponse |
deleteSession(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest)
Removes session information for a specified bot, alias, and user ID.
|
default DeleteSessionResponse |
deleteSession(DeleteSessionRequest deleteSessionRequest)
Removes session information for a specified bot, alias, and user ID.
|
default GetSessionResponse |
getSession(Consumer<GetSessionRequest.Builder> getSessionRequest)
Returns session information for a specified bot, alias, and user.
|
default GetSessionResponse |
getSession(GetSessionRequest getSessionRequest)
Returns session information for a specified bot, alias, and user.
|
default ResponseInputStream<PutSessionResponse> |
putSession(Consumer<PutSessionRequest.Builder> putSessionRequest)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default PutSessionResponse |
putSession(Consumer<PutSessionRequest.Builder> putSessionRequest,
Path destinationPath)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default <ReturnT> ReturnT |
putSession(Consumer<PutSessionRequest.Builder> putSessionRequest,
ResponseTransformer<PutSessionResponse,ReturnT> responseTransformer)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default ResponseInputStream<PutSessionResponse> |
putSession(PutSessionRequest putSessionRequest)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default PutSessionResponse |
putSession(PutSessionRequest putSessionRequest,
Path destinationPath)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default <ReturnT> ReturnT |
putSession(PutSessionRequest putSessionRequest,
ResponseTransformer<PutSessionResponse,ReturnT> responseTransformer)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default ResponseBytes<PutSessionResponse> |
putSessionAsBytes(Consumer<PutSessionRequest.Builder> putSessionRequest)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default ResponseBytes<PutSessionResponse> |
putSessionAsBytes(PutSessionRequest putSessionRequest)
Creates a new session or modifies an existing session with an Amazon Lex V2 bot.
|
default RecognizeTextResponse |
recognizeText(Consumer<RecognizeTextRequest.Builder> recognizeTextRequest)
Sends user input to Amazon Lex V2.
|
default RecognizeTextResponse |
recognizeText(RecognizeTextRequest recognizeTextRequest)
Sends user input to Amazon Lex V2.
|
default RecognizeUtteranceResponse |
recognizeUtterance(Consumer<RecognizeUtteranceRequest.Builder> recognizeUtteranceRequest,
Path sourcePath,
Path destinationPath)
Sends user input to Amazon Lex V2.
|
default <ReturnT> ReturnT |
recognizeUtterance(Consumer<RecognizeUtteranceRequest.Builder> recognizeUtteranceRequest,
RequestBody requestBody,
ResponseTransformer<RecognizeUtteranceResponse,ReturnT> responseTransformer)
Sends user input to Amazon Lex V2.
|
default RecognizeUtteranceResponse |
recognizeUtterance(RecognizeUtteranceRequest recognizeUtteranceRequest,
Path sourcePath,
Path destinationPath)
Sends user input to Amazon Lex V2.
|
default <ReturnT> ReturnT |
recognizeUtterance(RecognizeUtteranceRequest recognizeUtteranceRequest,
RequestBody requestBody,
ResponseTransformer<RecognizeUtteranceResponse,ReturnT> responseTransformer)
Sends user input to Amazon Lex V2.
|
default LexRuntimeV2ServiceClientConfiguration |
serviceClientConfiguration() |
static ServiceMetadata |
serviceMetadata() |
serviceNameclosestatic final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider.default DeleteSessionResponse deleteSession(DeleteSessionRequest deleteSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Removes session information for a specified bot, alias, and user ID.
You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.
You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.
If you specify a bot or alias ID that doesn't exist, you receive a BadRequestException.
If the locale doesn't exist in the bot, or if the locale hasn't been enables for the alias, you receive a
BadRequestException.
deleteSessionRequest - AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault DeleteSessionResponse deleteSession(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Removes session information for a specified bot, alias, and user ID.
You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.
You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.
If you specify a bot or alias ID that doesn't exist, you receive a BadRequestException.
If the locale doesn't exist in the bot, or if the locale hasn't been enables for the alias, you receive a
BadRequestException.
This is a convenience which creates an instance of the DeleteSessionRequest.Builder avoiding the need to
create one manually via DeleteSessionRequest.builder()
deleteSessionRequest - A Consumer that will call methods on
DeleteSessionRequest.Builder to create a
request.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetSessionResponse getSession(GetSessionRequest getSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Returns session information for a specified bot, alias, and user.
For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.
If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns a BadRequestException.
If the locale doesn't exist or is not enabled for the alias, you receive a BadRequestException.
getSessionRequest - AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetSessionResponse getSession(Consumer<GetSessionRequest.Builder> getSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Returns session information for a specified bot, alias, and user.
For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.
If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns a BadRequestException.
If the locale doesn't exist or is not enabled for the alias, you receive a BadRequestException.
This is a convenience which creates an instance of the GetSessionRequest.Builder avoiding the need to
create one manually via GetSessionRequest.builder()
getSessionRequest - A Consumer that will call methods on
GetSessionRequest.Builder to create a request.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault <ReturnT> ReturnT putSession(PutSessionRequest putSessionRequest, ResponseTransformer<PutSessionResponse,ReturnT> responseTransformer) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
putSessionRequest - responseTransformer - Functional interface for processing the streamed response content. The unmarshalled PutSessionResponse and
an InputStream to the response content are provided as parameters to the callback. The callback may return
a transformed type which will be the return value of this method. See
ResponseTransformer for details on implementing this interface
and for links to pre-canned implementations for common scenarios like downloading to a file. The service
documentation for the response content is as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault <ReturnT> ReturnT putSession(Consumer<PutSessionRequest.Builder> putSessionRequest, ResponseTransformer<PutSessionResponse,ReturnT> responseTransformer) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
This is a convenience which creates an instance of the PutSessionRequest.Builder avoiding the need to
create one manually via PutSessionRequest.builder()
putSessionRequest - A Consumer that will call methods on
PutSessionRequest.Builder to create a request.responseTransformer - Functional interface for processing the streamed response content. The unmarshalled PutSessionResponse and
an InputStream to the response content are provided as parameters to the callback. The callback may return
a transformed type which will be the return value of this method. See
ResponseTransformer for details on implementing this interface
and for links to pre-canned implementations for common scenarios like downloading to a file. The service
documentation for the response content is as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault PutSessionResponse putSession(PutSessionRequest putSessionRequest, Path destinationPath) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
putSessionRequest - destinationPath - Path to file that response contents will be written to. The file must not exist or this method
will throw an exception. If the file is not writable by the current user then an exception will be thrown.
The service documentation for the response content is as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionputSession(PutSessionRequest, ResponseTransformer),
AWS API
Documentationdefault PutSessionResponse putSession(Consumer<PutSessionRequest.Builder> putSessionRequest, Path destinationPath) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
This is a convenience which creates an instance of the PutSessionRequest.Builder avoiding the need to
create one manually via PutSessionRequest.builder()
putSessionRequest - A Consumer that will call methods on
PutSessionRequest.Builder to create a request.destinationPath - Path to file that response contents will be written to. The file must not exist or this method
will throw an exception. If the file is not writable by the current user then an exception will be thrown.
The service documentation for the response content is as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionputSession(PutSessionRequest, ResponseTransformer),
AWS API
Documentationdefault ResponseInputStream<PutSessionResponse> putSession(PutSessionRequest putSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
putSessionRequest - ResponseInputStream containing data streamed from service. Note that this is an unmanaged
reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read
from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior
and exhausting connections in the connection pool. The unmarshalled response object can be obtained via
ResponseInputStream.response(). The service documentation for the response content is as follows
'
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#getObject(putSession, ResponseTransformer),
AWS API
Documentationdefault ResponseInputStream<PutSessionResponse> putSession(Consumer<PutSessionRequest.Builder> putSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
This is a convenience which creates an instance of the PutSessionRequest.Builder avoiding the need to
create one manually via PutSessionRequest.builder()
putSessionRequest - A Consumer that will call methods on
PutSessionRequest.Builder to create a request.ResponseInputStream containing data streamed from service. Note that this is an unmanaged
reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read
from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior
and exhausting connections in the connection pool. The unmarshalled response object can be obtained via
ResponseInputStream.response(). The service documentation for the response content is as follows
'
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#getObject(putSession, ResponseTransformer),
AWS API
Documentationdefault ResponseBytes<PutSessionResponse> putSessionAsBytes(PutSessionRequest putSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
putSessionRequest - ResponseBytes that loads the data streamed from the service into memory and exposes it in
convenient in-memory representations like a byte buffer or string. The unmarshalled response object can
be obtained via ResponseBytes.response(). The service documentation for the response content is
as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#getObject(putSession, ResponseTransformer),
AWS API
Documentationdefault ResponseBytes<PutSessionResponse> putSessionAsBytes(Consumer<PutSessionRequest.Builder> putSessionRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
This is a convenience which creates an instance of the PutSessionRequest.Builder avoiding the need to
create one manually via PutSessionRequest.builder()
putSessionRequest - A Consumer that will call methods on
PutSessionRequest.Builder to create a request.ResponseBytes that loads the data streamed from the service into memory and exposes it in
convenient in-memory representations like a byte buffer or string. The unmarshalled response object can
be obtained via ResponseBytes.response(). The service documentation for the response content is
as follows '
If the requested content type was audio, the audio version of the message to convey to the user.
'.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#getObject(putSession, ResponseTransformer),
AWS API
Documentationdefault RecognizeTextResponse recognizeText(RecognizeTextRequest recognizeTextRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.
In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
recognizeTextRequest - AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault RecognizeTextResponse recognizeText(Consumer<RecognizeTextRequest.Builder> recognizeTextRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.
In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
This is a convenience which creates an instance of the RecognizeTextRequest.Builder avoiding the need to
create one manually via RecognizeTextRequest.builder()
recognizeTextRequest - A Consumer that will call methods on
RecognizeTextRequest.Builder to create a
request.AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault <ReturnT> ReturnT recognizeUtterance(RecognizeUtteranceRequest recognizeUtteranceRequest, RequestBody requestBody, ResponseTransformer<RecognizeUtteranceResponse,ReturnT> responseTransformer) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.
The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.
requestAttributes
sessionState
The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.
inputTranscript
interpretations
messages
requestAttributes
sessionState
The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
recognizeUtteranceRequest - requestBody - The content to send to the service. A RequestBody can be created using one of several factory
methods for various sources of data. For example, to create a request body from a file you can do the
following.
RequestBody.fromFile(new File("myfile.txt"))
See documentation in RequestBody for additional details and which sources of data are supported.
The service documentation for the request content is as follows '
User input in PCM or Opus audio format or text format as described in the requestContentType
parameter.
responseTransformer - Functional interface for processing the streamed response content. The unmarshalled
RecognizeUtteranceResponse and an InputStream to the response content are provided as parameters to the
callback. The callback may return a transformed type which will be the return value of this method. See
ResponseTransformer for details on implementing this interface
and for links to pre-canned implementations for common scenarios like downloading to a file. The service
documentation for the response content is as follows '
The prompt or statement to send to the user. This is based on the bot configuration and context. For
example, if Amazon Lex V2 did not understand the user intent, it sends the
clarificationPrompt configured for the bot. If the intent requires confirmation before taking
the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the
Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon
Lex V2 sends that message in the response.
AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault <ReturnT> ReturnT recognizeUtterance(Consumer<RecognizeUtteranceRequest.Builder> recognizeUtteranceRequest, RequestBody requestBody, ResponseTransformer<RecognizeUtteranceResponse,ReturnT> responseTransformer) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.
The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.
requestAttributes
sessionState
The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.
inputTranscript
interpretations
messages
requestAttributes
sessionState
The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
This is a convenience which creates an instance of the RecognizeUtteranceRequest.Builder avoiding the
need to create one manually via RecognizeUtteranceRequest.builder()
recognizeUtteranceRequest - A Consumer that will call methods on
RecognizeUtteranceRequest.Builder to create a
request.requestBody - The content to send to the service. A RequestBody can be created using one of several factory
methods for various sources of data. For example, to create a request body from a file you can do the
following.
RequestBody.fromFile(new File("myfile.txt"))
See documentation in RequestBody for additional details and which sources of data are supported.
The service documentation for the request content is as follows '
User input in PCM or Opus audio format or text format as described in the requestContentType
parameter.
responseTransformer - Functional interface for processing the streamed response content. The unmarshalled
RecognizeUtteranceResponse and an InputStream to the response content are provided as parameters to the
callback. The callback may return a transformed type which will be the return value of this method. See
ResponseTransformer for details on implementing this interface
and for links to pre-canned implementations for common scenarios like downloading to a file. The service
documentation for the response content is as follows '
The prompt or statement to send to the user. This is based on the bot configuration and context. For
example, if Amazon Lex V2 did not understand the user intent, it sends the
clarificationPrompt configured for the bot. If the intent requires confirmation before taking
the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the
Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon
Lex V2 sends that message in the response.
AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault RecognizeUtteranceResponse recognizeUtterance(RecognizeUtteranceRequest recognizeUtteranceRequest, Path sourcePath, Path destinationPath) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.
The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.
requestAttributes
sessionState
The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.
inputTranscript
interpretations
messages
requestAttributes
sessionState
The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
recognizeUtteranceRequest - sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read
multiple times in the event of a retry. If the file does not exist or the current user does not have
access to read it then an exception will be thrown. The service documentation for the request content is
as follows '
User input in PCM or Opus audio format or text format as described in the requestContentType
parameter.
destinationPath - Path to file that response contents will be written to. The file must not exist or this method
will throw an exception. If the file is not writable by the current user then an exception will be thrown.
The service documentation for the response content is as follows '
The prompt or statement to send to the user. This is based on the bot configuration and context. For
example, if Amazon Lex V2 did not understand the user intent, it sends the
clarificationPrompt configured for the bot. If the intent requires confirmation before taking
the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the
Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon
Lex V2 sends that message in the response.
AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#recognizeUtterance(RecognizeUtteranceRequest, RequestBody),
#recognizeUtterance(RecognizeUtteranceRequest, ResponseTransformer),
AWS API Documentationdefault RecognizeUtteranceResponse recognizeUtterance(Consumer<RecognizeUtteranceRequest.Builder> recognizeUtteranceRequest, Path sourcePath, Path destinationPath) throws AccessDeniedException, ResourceNotFoundException, ValidationException, ThrottlingException, InternalServerException, ConflictException, DependencyFailedException, BadGatewayException, AwsServiceException, SdkClientException, LexRuntimeV2Exception
Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.
The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.
requestAttributes
sessionState
The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.
inputTranscript
interpretations
messages
requestAttributes
sessionState
The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
This is a convenience which creates an instance of the RecognizeUtteranceRequest.Builder avoiding the
need to create one manually via RecognizeUtteranceRequest.builder()
recognizeUtteranceRequest - A Consumer that will call methods on
RecognizeUtteranceRequest.Builder to create a
request.sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read
multiple times in the event of a retry. If the file does not exist or the current user does not have
access to read it then an exception will be thrown. The service documentation for the request content is
as follows '
User input in PCM or Opus audio format or text format as described in the requestContentType
parameter.
destinationPath - Path to file that response contents will be written to. The file must not exist or this method
will throw an exception. If the file is not writable by the current user then an exception will be thrown.
The service documentation for the response content is as follows '
The prompt or statement to send to the user. This is based on the bot configuration and context. For
example, if Amazon Lex V2 did not understand the user intent, it sends the
clarificationPrompt configured for the bot. If the intent requires confirmation before taking
the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the
Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon
Lex V2 sends that message in the response.
AccessDeniedExceptionResourceNotFoundExceptionValidationExceptionThrottlingExceptionInternalServerExceptionConflictExceptionDependencyFailedExceptionBadGatewayExceptionSdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.LexRuntimeV2Exception - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException#recognizeUtterance(RecognizeUtteranceRequest, RequestBody),
#recognizeUtterance(RecognizeUtteranceRequest, ResponseTransformer),
AWS API Documentationstatic LexRuntimeV2Client create()
LexRuntimeV2Client with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static LexRuntimeV2ClientBuilder builder()
LexRuntimeV2Client.static ServiceMetadata serviceMetadata()
default LexRuntimeV2ServiceClientConfiguration serviceClientConfiguration()
serviceClientConfiguration in interface AwsClientserviceClientConfiguration in interface SdkClientCopyright © 2023. All rights reserved.