LexRuntimeClient

Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of operations (API). Your conversational bot uses the runtime API to understand user utterances (user input text or voice). For example, suppose a user says "I want pizza", your bot 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 bot). Then Amazon Lex engages in user conversation on behalf of the bot 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 bot). You use the build-time API to create and manage your Amazon Lex bot. For a list of build-time operations, see the build-time API, .

Properties

Link copied to clipboard
abstract override val config: LexRuntimeClient.Config

LexRuntimeClient's configuration

Functions

Link copied to clipboard

Removes session information for a specified bot, alias, and user ID.

Link copied to clipboard
abstract suspend fun getSession(input: GetSessionRequest): GetSessionResponse

Returns session information for a specified bot, alias, and user ID.

Link copied to clipboard
abstract suspend fun <T> postContent(input: PostContentRequest, block: suspend (PostContentResponse) -> T): T

Sends user input (text or speech) to Amazon Lex. Clients use this API to send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the user input using the machine learning model that it built for the bot.

Link copied to clipboard
abstract suspend fun postText(input: PostTextRequest): PostTextResponse

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

Link copied to clipboard
abstract suspend fun <T> putSession(input: PutSessionRequest, block: suspend (PutSessionResponse) -> T): T

Creates a new session or modifies an existing session with an Amazon Lex bot. Use this operation to enable your application to set the state of the bot.

Inherited functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard

Removes session information for a specified bot, alias, and user ID.

Link copied to clipboard
inline suspend fun LexRuntimeClient.getSession(crossinline block: GetSessionRequest.Builder.() -> Unit): GetSessionResponse

Returns session information for a specified bot, alias, and user ID.

Link copied to clipboard
inline suspend fun LexRuntimeClient.postText(crossinline block: PostTextRequest.Builder.() -> Unit): PostTextResponse

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

Link copied to clipboard

Create a copy of the client with one or more configuration values overridden. This method allows the caller to perform scoped config overrides for one or more client operations.