@aws-sdk/client-lex-runtime-service
Version:
AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native
94 lines • 4.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LexRuntimeService = void 0;
const LexRuntimeServiceClient_1 = require("./LexRuntimeServiceClient");
const DeleteSessionCommand_1 = require("./commands/DeleteSessionCommand");
const GetSessionCommand_1 = require("./commands/GetSessionCommand");
const PostContentCommand_1 = require("./commands/PostContentCommand");
const PostTextCommand_1 = require("./commands/PostTextCommand");
const PutSessionCommand_1 = require("./commands/PutSessionCommand");
/**
* <p>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, . </p>
*/
class LexRuntimeService extends LexRuntimeServiceClient_1.LexRuntimeServiceClient {
deleteSession(args, optionsOrCb, cb) {
const command = new DeleteSessionCommand_1.DeleteSessionCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
getSession(args, optionsOrCb, cb) {
const command = new GetSessionCommand_1.GetSessionCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
postContent(args, optionsOrCb, cb) {
const command = new PostContentCommand_1.PostContentCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
postText(args, optionsOrCb, cb) {
const command = new PostTextCommand_1.PostTextCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
putSession(args, optionsOrCb, cb) {
const command = new PutSessionCommand_1.PutSessionCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
}
exports.LexRuntimeService = LexRuntimeService;
//# sourceMappingURL=LexRuntimeService.js.map