Class: AWS.LexRuntime
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.LexRuntime
- Identifier:
- lexruntime
- API Version:
- 2016-11-28
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
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, .
Sending a Request Using LexRuntime
var lexruntime = new AWS.LexRuntime();
lexruntime.deleteSession(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the LexRuntime object uses this specific API, you can
construct the object by passing the apiVersion option to the constructor:
var lexruntime = new AWS.LexRuntime({apiVersion: '2016-11-28'});
You can also set the API version globally in AWS.config.apiVersions using
the lexruntime service identifier:
AWS.config.apiVersions = {
lexruntime: '2016-11-28',
// other service API versions
};
var lexruntime = new AWS.LexRuntime();
Constructor Summary collapse
-
new AWS.LexRuntime(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
deleteSession(params = {}, callback) ⇒ AWS.Request
Removes session information for a specified bot, alias, and user ID.
-
getSession(params = {}, callback) ⇒ AWS.Request
Returns session information for a specified bot, alias, and user ID.
.
-
postContent(params = {}, callback) ⇒ AWS.Request
Sends user input (text or speech) to Amazon Lex.
-
postText(params = {}, callback) ⇒ AWS.Request
Sends user input to Amazon Lex.
-
putSession(params = {}, callback) ⇒ AWS.Request
Creates a new session or modifies an existing session with an Amazon Lex bot.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.LexRuntime(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.