@aws-sdk/client-lex-runtime-service 3.36.0 → 3.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist-cjs/LexRuntimeService.js +0 -14
- package/dist-cjs/LexRuntimeServiceClient.js +0 -19
- package/dist-cjs/commands/DeleteSessionCommand.js +0 -25
- package/dist-cjs/commands/GetSessionCommand.js +0 -25
- package/dist-cjs/commands/PostContentCommand.js +0 -100
- package/dist-cjs/commands/PostTextCommand.js +0 -99
- package/dist-cjs/commands/PutSessionCommand.js +0 -28
- package/dist-cjs/commands/index.js +8 -0
- package/dist-cjs/endpoints.js +6 -1
- package/dist-cjs/index.js +3 -7
- package/dist-cjs/models/models_0.js +0 -93
- package/dist-cjs/protocols/Aws_restJson1.js +0 -5
- package/dist-cjs/runtimeConfig.browser.js +1 -5
- package/dist-cjs/runtimeConfig.js +1 -5
- package/dist-cjs/runtimeConfig.native.js +0 -3
- package/dist-cjs/runtimeConfig.shared.js +0 -3
- package/dist-es/commands/index.js +5 -0
- package/dist-es/endpoints.js +6 -1
- package/dist-es/index.js +3 -7
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/index.d.ts +3 -7
- package/dist-types/ts3.4/LexRuntimeService.d.ts +6 -186
- package/dist-types/ts3.4/LexRuntimeServiceClient.d.ts +24 -100
- package/dist-types/ts3.4/commands/DeleteSessionCommand.d.ts +2 -21
- package/dist-types/ts3.4/commands/GetSessionCommand.d.ts +2 -21
- package/dist-types/ts3.4/commands/PostContentCommand.d.ts +5 -103
- package/dist-types/ts3.4/commands/PostTextCommand.d.ts +2 -95
- package/dist-types/ts3.4/commands/PutSessionCommand.d.ts +2 -24
- package/dist-types/ts3.4/commands/index.d.ts +5 -0
- package/dist-types/ts3.4/index.d.ts +3 -7
- package/dist-types/ts3.4/models/models_0.d.ts +73 -1543
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +32 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,48 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.39.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.38.0...v3.39.0) (2021-10-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/client-lex-runtime-service
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.38.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.37.0...v3.38.0) (2021-10-22)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **client-documentation-generator:** rename package ([#2916](https://github.com/aws/aws-sdk-js-v3/issues/2916)) ([1a80bfd](https://github.com/aws/aws-sdk-js-v3/commit/1a80bfd2dfc583001ddb4a21b6432eaaad699aa7))
|
|
20
|
+
* **clients:** export folder from index.ts ([#2912](https://github.com/aws/aws-sdk-js-v3/issues/2912)) ([183b46d](https://github.com/aws/aws-sdk-js-v3/commit/183b46dde7f5613128038bf1c076f3c0b693203b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **clients:** update clients as of 10/15/2021 ([#2902](https://github.com/aws/aws-sdk-js-v3/issues/2902)) ([2730b54](https://github.com/aws/aws-sdk-js-v3/commit/2730b5424377944a5a2ad5e1ad7d3ca4135dae1c))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [3.36.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.0...v3.36.1) (2021-10-12)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
* **clients:** emitDeclarationOnly in tsconfig.types.json ([#2893](https://github.com/aws/aws-sdk-js-v3/issues/2893)) ([6dc3d56](https://github.com/aws/aws-sdk-js-v3/commit/6dc3d56c20809c90cbdc4dd48627eeebc64af99d))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
6
48
|
# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08)
|
|
7
49
|
|
|
8
50
|
|
|
@@ -7,20 +7,6 @@ const PostContentCommand_1 = require("./commands/PostContentCommand");
|
|
|
7
7
|
const PostTextCommand_1 = require("./commands/PostTextCommand");
|
|
8
8
|
const PutSessionCommand_1 = require("./commands/PutSessionCommand");
|
|
9
9
|
const LexRuntimeServiceClient_1 = require("./LexRuntimeServiceClient");
|
|
10
|
-
/**
|
|
11
|
-
* <p>Amazon Lex provides both build and runtime endpoints. Each endpoint
|
|
12
|
-
* provides a set of operations (API). Your conversational bot uses the
|
|
13
|
-
* runtime API to understand user utterances (user input text or voice). For
|
|
14
|
-
* example, suppose a user says "I want pizza", your bot sends this input to
|
|
15
|
-
* Amazon Lex using the runtime API. Amazon Lex recognizes that the user
|
|
16
|
-
* request is for the OrderPizza intent (one of the intents defined in the
|
|
17
|
-
* bot). Then Amazon Lex engages in user conversation on behalf of the bot to
|
|
18
|
-
* elicit required information (slot values, such as pizza size and crust
|
|
19
|
-
* type), and then performs fulfillment activity (that you configured when
|
|
20
|
-
* you created the bot). You use the build-time API to create and manage your
|
|
21
|
-
* Amazon Lex bot. For a list of build-time operations, see the build-time
|
|
22
|
-
* API, . </p>
|
|
23
|
-
*/
|
|
24
10
|
class LexRuntimeService extends LexRuntimeServiceClient_1.LexRuntimeServiceClient {
|
|
25
11
|
deleteSession(args, optionsOrCb, cb) {
|
|
26
12
|
const command = new DeleteSessionCommand_1.DeleteSessionCommand(args);
|
|
@@ -10,20 +10,6 @@ const middleware_signing_1 = require("@aws-sdk/middleware-signing");
|
|
|
10
10
|
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
|
11
11
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
12
12
|
const runtimeConfig_1 = require("./runtimeConfig");
|
|
13
|
-
/**
|
|
14
|
-
* <p>Amazon Lex provides both build and runtime endpoints. Each endpoint
|
|
15
|
-
* provides a set of operations (API). Your conversational bot uses the
|
|
16
|
-
* runtime API to understand user utterances (user input text or voice). For
|
|
17
|
-
* example, suppose a user says "I want pizza", your bot sends this input to
|
|
18
|
-
* Amazon Lex using the runtime API. Amazon Lex recognizes that the user
|
|
19
|
-
* request is for the OrderPizza intent (one of the intents defined in the
|
|
20
|
-
* bot). Then Amazon Lex engages in user conversation on behalf of the bot to
|
|
21
|
-
* elicit required information (slot values, such as pizza size and crust
|
|
22
|
-
* type), and then performs fulfillment activity (that you configured when
|
|
23
|
-
* you created the bot). You use the build-time API to create and manage your
|
|
24
|
-
* Amazon Lex bot. For a list of build-time operations, see the build-time
|
|
25
|
-
* API, . </p>
|
|
26
|
-
*/
|
|
27
13
|
class LexRuntimeServiceClient extends smithy_client_1.Client {
|
|
28
14
|
constructor(configuration) {
|
|
29
15
|
const _config_0 = runtimeConfig_1.getRuntimeConfig(configuration);
|
|
@@ -42,11 +28,6 @@ class LexRuntimeServiceClient extends smithy_client_1.Client {
|
|
|
42
28
|
this.middlewareStack.use(middleware_signing_1.getAwsAuthPlugin(this.config));
|
|
43
29
|
this.middlewareStack.use(middleware_user_agent_1.getUserAgentPlugin(this.config));
|
|
44
30
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
47
|
-
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
48
|
-
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
49
|
-
*/
|
|
50
31
|
destroy() {
|
|
51
32
|
super.destroy();
|
|
52
33
|
}
|
|
@@ -5,36 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
8
|
-
/**
|
|
9
|
-
* <p>Removes session information for a specified bot, alias, and user ID.
|
|
10
|
-
* </p>
|
|
11
|
-
* @example
|
|
12
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
13
|
-
* ```javascript
|
|
14
|
-
* import { LexRuntimeServiceClient, DeleteSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
15
|
-
* // const { LexRuntimeServiceClient, DeleteSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
16
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
17
|
-
* const command = new DeleteSessionCommand(input);
|
|
18
|
-
* const response = await client.send(command);
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @see {@link DeleteSessionCommandInput} for command's `input` shape.
|
|
22
|
-
* @see {@link DeleteSessionCommandOutput} for command's `response` shape.
|
|
23
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
8
|
class DeleteSessionCommand extends smithy_client_1.Command {
|
|
27
|
-
// Start section: command_properties
|
|
28
|
-
// End section: command_properties
|
|
29
9
|
constructor(input) {
|
|
30
|
-
// Start section: command_constructor
|
|
31
10
|
super();
|
|
32
11
|
this.input = input;
|
|
33
|
-
// End section: command_constructor
|
|
34
12
|
}
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
13
|
resolveMiddleware(clientStack, configuration, options) {
|
|
39
14
|
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
40
15
|
const stack = clientStack.concat(this.middlewareStack);
|
|
@@ -5,36 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
8
|
-
/**
|
|
9
|
-
* <p>Returns session information for a specified bot, alias, and user
|
|
10
|
-
* ID.</p>
|
|
11
|
-
* @example
|
|
12
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
13
|
-
* ```javascript
|
|
14
|
-
* import { LexRuntimeServiceClient, GetSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
15
|
-
* // const { LexRuntimeServiceClient, GetSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
16
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
17
|
-
* const command = new GetSessionCommand(input);
|
|
18
|
-
* const response = await client.send(command);
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @see {@link GetSessionCommandInput} for command's `input` shape.
|
|
22
|
-
* @see {@link GetSessionCommandOutput} for command's `response` shape.
|
|
23
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
8
|
class GetSessionCommand extends smithy_client_1.Command {
|
|
27
|
-
// Start section: command_properties
|
|
28
|
-
// End section: command_properties
|
|
29
9
|
constructor(input) {
|
|
30
|
-
// Start section: command_constructor
|
|
31
10
|
super();
|
|
32
11
|
this.input = input;
|
|
33
|
-
// End section: command_constructor
|
|
34
12
|
}
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
13
|
resolveMiddleware(clientStack, configuration, options) {
|
|
39
14
|
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
40
15
|
const stack = clientStack.concat(this.middlewareStack);
|
|
@@ -5,111 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
8
|
-
/**
|
|
9
|
-
* <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to
|
|
10
|
-
* send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the
|
|
11
|
-
* user input using the machine learning model that it built for the bot. </p>
|
|
12
|
-
* <p>The <code>PostContent</code> operation supports audio input at 8kHz
|
|
13
|
-
* and 16kHz. You can use 8kHz audio to achieve higher speech recognition
|
|
14
|
-
* accuracy in telephone audio applications. </p>
|
|
15
|
-
* <p> In response, Amazon Lex returns the next message to convey to the user.
|
|
16
|
-
* Consider the following example messages: </p>
|
|
17
|
-
* <ul>
|
|
18
|
-
* <li>
|
|
19
|
-
* <p> For a user input "I would like a pizza," Amazon Lex might return a
|
|
20
|
-
* response with a message eliciting slot data (for example,
|
|
21
|
-
* <code>PizzaSize</code>): "What size pizza would you like?". </p>
|
|
22
|
-
* </li>
|
|
23
|
-
* <li>
|
|
24
|
-
* <p> After the user provides all of the pizza order information, Amazon Lex
|
|
25
|
-
* might return a response with a message to get user confirmation:
|
|
26
|
-
* "Order the pizza?". </p>
|
|
27
|
-
* </li>
|
|
28
|
-
* <li>
|
|
29
|
-
* <p> After the user replies "Yes" to the confirmation prompt, Amazon Lex
|
|
30
|
-
* might return a conclusion statement: "Thank you, your cheese pizza has
|
|
31
|
-
* been ordered.". </p>
|
|
32
|
-
* </li>
|
|
33
|
-
* </ul>
|
|
34
|
-
* <p> Not all Amazon Lex messages require a response from the user. For example,
|
|
35
|
-
* conclusion statements do not require a response. Some messages require
|
|
36
|
-
* only a yes or no response. In addition to the <code>message</code>, Amazon Lex
|
|
37
|
-
* provides additional context about the message in the response that you can
|
|
38
|
-
* use to enhance client behavior, such as displaying the appropriate client
|
|
39
|
-
* user interface. Consider the following examples: </p>
|
|
40
|
-
* <ul>
|
|
41
|
-
* <li>
|
|
42
|
-
* <p> If the message is to elicit slot data, Amazon Lex returns the
|
|
43
|
-
* following context information: </p>
|
|
44
|
-
* <ul>
|
|
45
|
-
* <li>
|
|
46
|
-
* <p>
|
|
47
|
-
* <code>x-amz-lex-dialog-state</code> header set to
|
|
48
|
-
* <code>ElicitSlot</code>
|
|
49
|
-
* </p>
|
|
50
|
-
* </li>
|
|
51
|
-
* <li>
|
|
52
|
-
* <p>
|
|
53
|
-
* <code>x-amz-lex-intent-name</code> header set to the intent name
|
|
54
|
-
* in the current context </p>
|
|
55
|
-
* </li>
|
|
56
|
-
* <li>
|
|
57
|
-
* <p>
|
|
58
|
-
* <code>x-amz-lex-slot-to-elicit</code> header set to the slot name
|
|
59
|
-
* for which the <code>message</code> is eliciting information
|
|
60
|
-
* </p>
|
|
61
|
-
* </li>
|
|
62
|
-
* <li>
|
|
63
|
-
* <p>
|
|
64
|
-
* <code>x-amz-lex-slots</code> header set to a map of slots
|
|
65
|
-
* configured for the intent with their current values </p>
|
|
66
|
-
* </li>
|
|
67
|
-
* </ul>
|
|
68
|
-
* </li>
|
|
69
|
-
* <li>
|
|
70
|
-
* <p> If the message is a confirmation prompt, the
|
|
71
|
-
* <code>x-amz-lex-dialog-state</code> header is set to
|
|
72
|
-
* <code>Confirmation</code> and the
|
|
73
|
-
* <code>x-amz-lex-slot-to-elicit</code> header is omitted. </p>
|
|
74
|
-
* </li>
|
|
75
|
-
* <li>
|
|
76
|
-
* <p> If the message is a clarification prompt configured for the
|
|
77
|
-
* intent, indicating that the user intent is not understood, the
|
|
78
|
-
* <code>x-amz-dialog-state</code> header is set to
|
|
79
|
-
* <code>ElicitIntent</code> and the <code>x-amz-slot-to-elicit</code>
|
|
80
|
-
* header is omitted. </p>
|
|
81
|
-
* </li>
|
|
82
|
-
* </ul>
|
|
83
|
-
* <p> In addition, Amazon Lex also returns your application-specific
|
|
84
|
-
* <code>sessionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing
|
|
85
|
-
* Conversation Context</a>. </p>
|
|
86
|
-
* @example
|
|
87
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
88
|
-
* ```javascript
|
|
89
|
-
* import { LexRuntimeServiceClient, PostContentCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
90
|
-
* // const { LexRuntimeServiceClient, PostContentCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
91
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
92
|
-
* const command = new PostContentCommand(input);
|
|
93
|
-
* const response = await client.send(command);
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* @see {@link PostContentCommandInput} for command's `input` shape.
|
|
97
|
-
* @see {@link PostContentCommandOutput} for command's `response` shape.
|
|
98
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
99
|
-
*
|
|
100
|
-
*/
|
|
101
8
|
class PostContentCommand extends smithy_client_1.Command {
|
|
102
|
-
// Start section: command_properties
|
|
103
|
-
// End section: command_properties
|
|
104
9
|
constructor(input) {
|
|
105
|
-
// Start section: command_constructor
|
|
106
10
|
super();
|
|
107
11
|
this.input = input;
|
|
108
|
-
// End section: command_constructor
|
|
109
12
|
}
|
|
110
|
-
/**
|
|
111
|
-
* @internal
|
|
112
|
-
*/
|
|
113
13
|
resolveMiddleware(clientStack, configuration, options) {
|
|
114
14
|
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
115
15
|
const stack = clientStack.concat(this.middlewareStack);
|
|
@@ -5,110 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
8
|
-
/**
|
|
9
|
-
* <p>Sends user input to Amazon Lex. Client applications can use this API to
|
|
10
|
-
* send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input
|
|
11
|
-
* using the machine learning model it built for the bot. </p>
|
|
12
|
-
* <p> In response, Amazon Lex returns the next <code>message</code> to convey to
|
|
13
|
-
* the user an optional <code>responseCard</code> to display. Consider the
|
|
14
|
-
* following example messages: </p>
|
|
15
|
-
* <ul>
|
|
16
|
-
* <li>
|
|
17
|
-
* <p> For a user input "I would like a pizza", Amazon Lex might return a
|
|
18
|
-
* response with a message eliciting slot data (for example, PizzaSize):
|
|
19
|
-
* "What size pizza would you like?" </p>
|
|
20
|
-
* </li>
|
|
21
|
-
* <li>
|
|
22
|
-
* <p> After the user provides all of the pizza order information,
|
|
23
|
-
* Amazon Lex might return a response with a message to obtain user
|
|
24
|
-
* confirmation "Proceed with the pizza order?". </p>
|
|
25
|
-
* </li>
|
|
26
|
-
* <li>
|
|
27
|
-
* <p> After the user replies to a confirmation prompt with a "yes",
|
|
28
|
-
* Amazon Lex might return a conclusion statement: "Thank you, your cheese
|
|
29
|
-
* pizza has been ordered.". </p>
|
|
30
|
-
* </li>
|
|
31
|
-
* </ul>
|
|
32
|
-
*
|
|
33
|
-
* <p> Not all Amazon Lex messages require a user response. For example, a
|
|
34
|
-
* conclusion statement does not require a response. Some messages require
|
|
35
|
-
* only a "yes" or "no" user response. In addition to the
|
|
36
|
-
* <code>message</code>, Amazon Lex provides additional context about the
|
|
37
|
-
* message in the response that you might use to enhance client behavior, for
|
|
38
|
-
* example, to display the appropriate client user interface. These are the
|
|
39
|
-
* <code>slotToElicit</code>, <code>dialogState</code>,
|
|
40
|
-
* <code>intentName</code>, and <code>slots</code> fields in the response.
|
|
41
|
-
* Consider the following examples: </p>
|
|
42
|
-
*
|
|
43
|
-
* <ul>
|
|
44
|
-
* <li>
|
|
45
|
-
* <p>If the message is to elicit slot data, Amazon Lex returns the
|
|
46
|
-
* following context information:</p>
|
|
47
|
-
* <ul>
|
|
48
|
-
* <li>
|
|
49
|
-
* <p>
|
|
50
|
-
* <code>dialogState</code> set to ElicitSlot </p>
|
|
51
|
-
* </li>
|
|
52
|
-
* <li>
|
|
53
|
-
* <p>
|
|
54
|
-
* <code>intentName</code> set to the intent name in the current
|
|
55
|
-
* context </p>
|
|
56
|
-
* </li>
|
|
57
|
-
* <li>
|
|
58
|
-
* <p>
|
|
59
|
-
* <code>slotToElicit</code> set to the slot name for which the
|
|
60
|
-
* <code>message</code> is eliciting information </p>
|
|
61
|
-
* </li>
|
|
62
|
-
* <li>
|
|
63
|
-
* <p>
|
|
64
|
-
* <code>slots</code> set to a map of slots, configured for the
|
|
65
|
-
* intent, with currently known values </p>
|
|
66
|
-
* </li>
|
|
67
|
-
* </ul>
|
|
68
|
-
* </li>
|
|
69
|
-
* <li>
|
|
70
|
-
* <p> If the message is a confirmation prompt, the
|
|
71
|
-
* <code>dialogState</code> is set to ConfirmIntent and
|
|
72
|
-
* <code>SlotToElicit</code> is set to null. </p>
|
|
73
|
-
* </li>
|
|
74
|
-
* <li>
|
|
75
|
-
* <p>If the message is a clarification prompt (configured for the
|
|
76
|
-
* intent) that indicates that user intent is not understood, the
|
|
77
|
-
* <code>dialogState</code> is set to ElicitIntent and
|
|
78
|
-
* <code>slotToElicit</code> is set to null. </p>
|
|
79
|
-
* </li>
|
|
80
|
-
* </ul>
|
|
81
|
-
*
|
|
82
|
-
* <p> In addition, Amazon Lex also returns your application-specific
|
|
83
|
-
* <code>sessionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing
|
|
84
|
-
* Conversation Context</a>. </p>
|
|
85
|
-
* @example
|
|
86
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
87
|
-
* ```javascript
|
|
88
|
-
* import { LexRuntimeServiceClient, PostTextCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
89
|
-
* // const { LexRuntimeServiceClient, PostTextCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
90
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
91
|
-
* const command = new PostTextCommand(input);
|
|
92
|
-
* const response = await client.send(command);
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* @see {@link PostTextCommandInput} for command's `input` shape.
|
|
96
|
-
* @see {@link PostTextCommandOutput} for command's `response` shape.
|
|
97
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
8
|
class PostTextCommand extends smithy_client_1.Command {
|
|
101
|
-
// Start section: command_properties
|
|
102
|
-
// End section: command_properties
|
|
103
9
|
constructor(input) {
|
|
104
|
-
// Start section: command_constructor
|
|
105
10
|
super();
|
|
106
11
|
this.input = input;
|
|
107
|
-
// End section: command_constructor
|
|
108
12
|
}
|
|
109
|
-
/**
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
13
|
resolveMiddleware(clientStack, configuration, options) {
|
|
113
14
|
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
114
15
|
const stack = clientStack.concat(this.middlewareStack);
|
|
@@ -5,39 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
8
|
-
/**
|
|
9
|
-
* <p>Creates a new session or modifies an existing session with an Amazon Lex
|
|
10
|
-
* bot. Use this operation to enable your application to set the state of the
|
|
11
|
-
* bot.</p>
|
|
12
|
-
* <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html">Managing
|
|
13
|
-
* Sessions</a>.</p>
|
|
14
|
-
* @example
|
|
15
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
16
|
-
* ```javascript
|
|
17
|
-
* import { LexRuntimeServiceClient, PutSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
18
|
-
* // const { LexRuntimeServiceClient, PutSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
19
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
20
|
-
* const command = new PutSessionCommand(input);
|
|
21
|
-
* const response = await client.send(command);
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @see {@link PutSessionCommandInput} for command's `input` shape.
|
|
25
|
-
* @see {@link PutSessionCommandOutput} for command's `response` shape.
|
|
26
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
8
|
class PutSessionCommand extends smithy_client_1.Command {
|
|
30
|
-
// Start section: command_properties
|
|
31
|
-
// End section: command_properties
|
|
32
9
|
constructor(input) {
|
|
33
|
-
// Start section: command_constructor
|
|
34
10
|
super();
|
|
35
11
|
this.input = input;
|
|
36
|
-
// End section: command_constructor
|
|
37
12
|
}
|
|
38
|
-
/**
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
13
|
resolveMiddleware(clientStack, configuration, options) {
|
|
42
14
|
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
43
15
|
const stack = clientStack.concat(this.middlewareStack);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./DeleteSessionCommand"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./GetSessionCommand"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./PostContentCommand"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./PostTextCommand"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./PutSessionCommand"), exports);
|
package/dist-cjs/endpoints.js
CHANGED
|
@@ -43,22 +43,27 @@ const partitionHash = {
|
|
|
43
43
|
"us-west-2",
|
|
44
44
|
"us-west-2-fips",
|
|
45
45
|
],
|
|
46
|
+
regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
|
|
46
47
|
hostname: "runtime.lex.{region}.amazonaws.com",
|
|
47
48
|
},
|
|
48
49
|
"aws-cn": {
|
|
49
50
|
regions: ["cn-north-1", "cn-northwest-1"],
|
|
51
|
+
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
50
52
|
hostname: "runtime.lex.{region}.amazonaws.com.cn",
|
|
51
53
|
},
|
|
52
54
|
"aws-iso": {
|
|
53
|
-
regions: ["us-iso-east-1"],
|
|
55
|
+
regions: ["us-iso-east-1", "us-iso-west-1"],
|
|
56
|
+
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
54
57
|
hostname: "runtime.lex.{region}.c2s.ic.gov",
|
|
55
58
|
},
|
|
56
59
|
"aws-iso-b": {
|
|
57
60
|
regions: ["us-isob-east-1"],
|
|
61
|
+
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
58
62
|
hostname: "runtime.lex.{region}.sc2s.sgov.gov",
|
|
59
63
|
},
|
|
60
64
|
"aws-us-gov": {
|
|
61
65
|
regions: ["us-gov-east-1", "us-gov-west-1", "us-gov-west-1-fips"],
|
|
66
|
+
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
62
67
|
hostname: "runtime.lex.{region}.amazonaws.com",
|
|
63
68
|
},
|
|
64
69
|
};
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./LexRuntimeServiceClient"), exports);
|
|
5
4
|
tslib_1.__exportStar(require("./LexRuntimeService"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./
|
|
7
|
-
tslib_1.__exportStar(require("./commands
|
|
8
|
-
tslib_1.__exportStar(require("./
|
|
9
|
-
tslib_1.__exportStar(require("./commands/PostTextCommand"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./commands/PutSessionCommand"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./models/index"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./LexRuntimeServiceClient"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./commands"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./models"), exports);
|