@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
|
@@ -14,135 +14,59 @@ import { PutSessionCommandInput, PutSessionCommandOutput } from "./commands/PutS
|
|
|
14
14
|
export declare type ServiceInputTypes = DeleteSessionCommandInput | GetSessionCommandInput | PostContentCommandInput | PostTextCommandInput | PutSessionCommandInput;
|
|
15
15
|
export declare type ServiceOutputTypes = DeleteSessionCommandOutput | GetSessionCommandOutput | PostContentCommandOutput | PostTextCommandOutput | PutSessionCommandOutput;
|
|
16
16
|
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
|
|
17
|
-
|
|
18
|
-
* The HTTP handler to use. Fetch in browser and Https in Nodejs.
|
|
19
|
-
*/
|
|
17
|
+
|
|
20
18
|
requestHandler?: __HttpHandler;
|
|
21
|
-
|
|
22
|
-
* A constructor for a class implementing the {@link __Hash} interface
|
|
23
|
-
* that computes the SHA-256 HMAC or checksum of a string or binary buffer.
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
19
|
+
|
|
26
20
|
sha256?: __HashConstructor;
|
|
27
|
-
|
|
28
|
-
* The function that will be used to convert strings into HTTP endpoints.
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
21
|
+
|
|
31
22
|
urlParser?: __UrlParser;
|
|
32
|
-
|
|
33
|
-
* A function that can calculate the length of a request body.
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
23
|
+
|
|
36
24
|
bodyLengthChecker?: (body: any) => number | undefined;
|
|
37
|
-
|
|
38
|
-
* A function that converts a stream into an array of bytes.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
25
|
+
|
|
41
26
|
streamCollector?: __StreamCollector;
|
|
42
|
-
|
|
43
|
-
* The function that will be used to convert a base64-encoded string to a byte array.
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
27
|
+
|
|
46
28
|
base64Decoder?: __Decoder;
|
|
47
|
-
|
|
48
|
-
* The function that will be used to convert binary data to a base64-encoded string.
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
29
|
+
|
|
51
30
|
base64Encoder?: __Encoder;
|
|
52
|
-
|
|
53
|
-
* The function that will be used to convert a UTF8-encoded string to a byte array.
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
31
|
+
|
|
56
32
|
utf8Decoder?: __Decoder;
|
|
57
|
-
|
|
58
|
-
* The function that will be used to convert binary data to a UTF-8 encoded string.
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
33
|
+
|
|
61
34
|
utf8Encoder?: __Encoder;
|
|
62
|
-
|
|
63
|
-
* The runtime environment.
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
35
|
+
|
|
66
36
|
runtime?: string;
|
|
67
|
-
|
|
68
|
-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
|
|
69
|
-
* trait of an operation.
|
|
70
|
-
*/
|
|
37
|
+
|
|
71
38
|
disableHostPrefix?: boolean;
|
|
72
|
-
|
|
73
|
-
* Value for how many times a request will be made at most in case of retry.
|
|
74
|
-
*/
|
|
39
|
+
|
|
75
40
|
maxAttempts?: number | __Provider<number>;
|
|
76
|
-
|
|
77
|
-
* Specifies which retry algorithm to use.
|
|
78
|
-
*/
|
|
41
|
+
|
|
79
42
|
retryMode?: string | __Provider<string>;
|
|
80
|
-
|
|
81
|
-
* Optional logger for logging debug/info/warn/error.
|
|
82
|
-
*/
|
|
43
|
+
|
|
83
44
|
logger?: __Logger;
|
|
84
|
-
|
|
85
|
-
* Unique service identifier.
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
45
|
+
|
|
88
46
|
serviceId?: string;
|
|
89
|
-
|
|
90
|
-
* The AWS region to which this client will send requests
|
|
91
|
-
*/
|
|
47
|
+
|
|
92
48
|
region?: string | __Provider<string>;
|
|
93
|
-
|
|
94
|
-
* Default credentials provider; Not available in browser runtime.
|
|
95
|
-
* @internal
|
|
96
|
-
*/
|
|
49
|
+
|
|
97
50
|
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
|
|
98
|
-
|
|
99
|
-
* Fetch related hostname, signing name or signing region with given region.
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
51
|
+
|
|
102
52
|
regionInfoProvider?: RegionInfoProvider;
|
|
103
|
-
|
|
104
|
-
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
53
|
+
|
|
107
54
|
defaultUserAgentProvider?: Provider<__UserAgent>;
|
|
108
55
|
}
|
|
109
56
|
declare type LexRuntimeServiceClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig;
|
|
110
|
-
|
|
111
|
-
* The configuration interface of LexRuntimeServiceClient class constructor that set the region, credentials and other options.
|
|
112
|
-
*/
|
|
57
|
+
|
|
113
58
|
export interface LexRuntimeServiceClientConfig extends LexRuntimeServiceClientConfigType {
|
|
114
59
|
}
|
|
115
60
|
declare type LexRuntimeServiceClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RegionResolvedConfig & EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig;
|
|
116
|
-
|
|
117
|
-
* The resolved configuration interface of LexRuntimeServiceClient class. This is resolved and normalized from the {@link LexRuntimeServiceClientConfig | constructor configuration interface}.
|
|
118
|
-
*/
|
|
61
|
+
|
|
119
62
|
export interface LexRuntimeServiceClientResolvedConfig extends LexRuntimeServiceClientResolvedConfigType {
|
|
120
63
|
}
|
|
121
|
-
|
|
122
|
-
* <p>Amazon Lex provides both build and runtime endpoints. Each endpoint
|
|
123
|
-
* provides a set of operations (API). Your conversational bot uses the
|
|
124
|
-
* runtime API to understand user utterances (user input text or voice). For
|
|
125
|
-
* example, suppose a user says "I want pizza", your bot sends this input to
|
|
126
|
-
* Amazon Lex using the runtime API. Amazon Lex recognizes that the user
|
|
127
|
-
* request is for the OrderPizza intent (one of the intents defined in the
|
|
128
|
-
* bot). Then Amazon Lex engages in user conversation on behalf of the bot to
|
|
129
|
-
* elicit required information (slot values, such as pizza size and crust
|
|
130
|
-
* type), and then performs fulfillment activity (that you configured when
|
|
131
|
-
* you created the bot). You use the build-time API to create and manage your
|
|
132
|
-
* Amazon Lex bot. For a list of build-time operations, see the build-time
|
|
133
|
-
* API, . </p>
|
|
134
|
-
*/
|
|
64
|
+
|
|
135
65
|
export declare class LexRuntimeServiceClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, LexRuntimeServiceClientResolvedConfig> {
|
|
136
|
-
|
|
137
|
-
* The resolved configuration of LexRuntimeServiceClient class. This is resolved and normalized from the {@link LexRuntimeServiceClientConfig | constructor configuration interface}.
|
|
138
|
-
*/
|
|
66
|
+
|
|
139
67
|
readonly config: LexRuntimeServiceClientResolvedConfig;
|
|
140
68
|
constructor(configuration: LexRuntimeServiceClientConfig);
|
|
141
|
-
|
|
142
|
-
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
143
|
-
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
144
|
-
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
145
|
-
*/
|
|
69
|
+
|
|
146
70
|
destroy(): void;
|
|
147
71
|
}
|
|
148
72
|
export {};
|
|
@@ -6,30 +6,11 @@ export interface DeleteSessionCommandInput extends DeleteSessionRequest {
|
|
|
6
6
|
}
|
|
7
7
|
export interface DeleteSessionCommandOutput extends DeleteSessionResponse, __MetadataBearer {
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* <p>Removes session information for a specified bot, alias, and user ID.
|
|
11
|
-
* </p>
|
|
12
|
-
* @example
|
|
13
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
14
|
-
* ```javascript
|
|
15
|
-
* import { LexRuntimeServiceClient, DeleteSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
16
|
-
* // const { LexRuntimeServiceClient, DeleteSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
17
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
18
|
-
* const command = new DeleteSessionCommand(input);
|
|
19
|
-
* const response = await client.send(command);
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @see {@link DeleteSessionCommandInput} for command's `input` shape.
|
|
23
|
-
* @see {@link DeleteSessionCommandOutput} for command's `response` shape.
|
|
24
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
9
|
+
|
|
27
10
|
export declare class DeleteSessionCommand extends $Command<DeleteSessionCommandInput, DeleteSessionCommandOutput, LexRuntimeServiceClientResolvedConfig> {
|
|
28
11
|
readonly input: DeleteSessionCommandInput;
|
|
29
12
|
constructor(input: DeleteSessionCommandInput);
|
|
30
|
-
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
13
|
+
|
|
33
14
|
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: LexRuntimeServiceClientResolvedConfig, options?: __HttpHandlerOptions): Handler<DeleteSessionCommandInput, DeleteSessionCommandOutput>;
|
|
34
15
|
private serialize;
|
|
35
16
|
private deserialize;
|
|
@@ -6,30 +6,11 @@ export interface GetSessionCommandInput extends GetSessionRequest {
|
|
|
6
6
|
}
|
|
7
7
|
export interface GetSessionCommandOutput extends GetSessionResponse, __MetadataBearer {
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* <p>Returns session information for a specified bot, alias, and user
|
|
11
|
-
* ID.</p>
|
|
12
|
-
* @example
|
|
13
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
14
|
-
* ```javascript
|
|
15
|
-
* import { LexRuntimeServiceClient, GetSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
16
|
-
* // const { LexRuntimeServiceClient, GetSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
17
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
18
|
-
* const command = new GetSessionCommand(input);
|
|
19
|
-
* const response = await client.send(command);
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @see {@link GetSessionCommandInput} for command's `input` shape.
|
|
23
|
-
* @see {@link GetSessionCommandOutput} for command's `response` shape.
|
|
24
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
9
|
+
|
|
27
10
|
export declare class GetSessionCommand extends $Command<GetSessionCommandInput, GetSessionCommandOutput, LexRuntimeServiceClientResolvedConfig> {
|
|
28
11
|
readonly input: GetSessionCommandInput;
|
|
29
12
|
constructor(input: GetSessionCommandInput);
|
|
30
|
-
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
13
|
+
|
|
33
14
|
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: LexRuntimeServiceClientResolvedConfig, options?: __HttpHandlerOptions): Handler<GetSessionCommandInput, GetSessionCommandOutput>;
|
|
34
15
|
private serialize;
|
|
35
16
|
private deserialize;
|
|
@@ -1,120 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
3
3
|
import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
|
|
4
4
|
import { LexRuntimeServiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexRuntimeServiceClient";
|
|
5
5
|
import { PostContentRequest, PostContentResponse } from "../models/models_0";
|
|
6
6
|
declare type PostContentCommandInputType = Pick<PostContentRequest, Exclude<keyof PostContentRequest, "inputStream">> & {
|
|
7
|
-
|
|
8
|
-
* For *`PostContentRequest["inputStream"]`*, see {@link PostContentRequest.inputStream}.
|
|
9
|
-
*/
|
|
7
|
+
|
|
10
8
|
inputStream: PostContentRequest["inputStream"] | string | Uint8Array | Buffer;
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
* This interface extends from `PostContentRequest` interface. There are more parameters than `inputStream` defined in {@link PostContentRequest}
|
|
14
|
-
*/
|
|
10
|
+
|
|
15
11
|
export interface PostContentCommandInput extends PostContentCommandInputType {
|
|
16
12
|
}
|
|
17
13
|
export interface PostContentCommandOutput extends PostContentResponse, __MetadataBearer {
|
|
18
14
|
}
|
|
19
|
-
|
|
20
|
-
* <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to
|
|
21
|
-
* send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the
|
|
22
|
-
* user input using the machine learning model that it built for the bot. </p>
|
|
23
|
-
* <p>The <code>PostContent</code> operation supports audio input at 8kHz
|
|
24
|
-
* and 16kHz. You can use 8kHz audio to achieve higher speech recognition
|
|
25
|
-
* accuracy in telephone audio applications. </p>
|
|
26
|
-
* <p> In response, Amazon Lex returns the next message to convey to the user.
|
|
27
|
-
* Consider the following example messages: </p>
|
|
28
|
-
* <ul>
|
|
29
|
-
* <li>
|
|
30
|
-
* <p> For a user input "I would like a pizza," Amazon Lex might return a
|
|
31
|
-
* response with a message eliciting slot data (for example,
|
|
32
|
-
* <code>PizzaSize</code>): "What size pizza would you like?". </p>
|
|
33
|
-
* </li>
|
|
34
|
-
* <li>
|
|
35
|
-
* <p> After the user provides all of the pizza order information, Amazon Lex
|
|
36
|
-
* might return a response with a message to get user confirmation:
|
|
37
|
-
* "Order the pizza?". </p>
|
|
38
|
-
* </li>
|
|
39
|
-
* <li>
|
|
40
|
-
* <p> After the user replies "Yes" to the confirmation prompt, Amazon Lex
|
|
41
|
-
* might return a conclusion statement: "Thank you, your cheese pizza has
|
|
42
|
-
* been ordered.". </p>
|
|
43
|
-
* </li>
|
|
44
|
-
* </ul>
|
|
45
|
-
* <p> Not all Amazon Lex messages require a response from the user. For example,
|
|
46
|
-
* conclusion statements do not require a response. Some messages require
|
|
47
|
-
* only a yes or no response. In addition to the <code>message</code>, Amazon Lex
|
|
48
|
-
* provides additional context about the message in the response that you can
|
|
49
|
-
* use to enhance client behavior, such as displaying the appropriate client
|
|
50
|
-
* user interface. Consider the following examples: </p>
|
|
51
|
-
* <ul>
|
|
52
|
-
* <li>
|
|
53
|
-
* <p> If the message is to elicit slot data, Amazon Lex returns the
|
|
54
|
-
* following context information: </p>
|
|
55
|
-
* <ul>
|
|
56
|
-
* <li>
|
|
57
|
-
* <p>
|
|
58
|
-
* <code>x-amz-lex-dialog-state</code> header set to
|
|
59
|
-
* <code>ElicitSlot</code>
|
|
60
|
-
* </p>
|
|
61
|
-
* </li>
|
|
62
|
-
* <li>
|
|
63
|
-
* <p>
|
|
64
|
-
* <code>x-amz-lex-intent-name</code> header set to the intent name
|
|
65
|
-
* in the current context </p>
|
|
66
|
-
* </li>
|
|
67
|
-
* <li>
|
|
68
|
-
* <p>
|
|
69
|
-
* <code>x-amz-lex-slot-to-elicit</code> header set to the slot name
|
|
70
|
-
* for which the <code>message</code> is eliciting information
|
|
71
|
-
* </p>
|
|
72
|
-
* </li>
|
|
73
|
-
* <li>
|
|
74
|
-
* <p>
|
|
75
|
-
* <code>x-amz-lex-slots</code> header set to a map of slots
|
|
76
|
-
* configured for the intent with their current values </p>
|
|
77
|
-
* </li>
|
|
78
|
-
* </ul>
|
|
79
|
-
* </li>
|
|
80
|
-
* <li>
|
|
81
|
-
* <p> If the message is a confirmation prompt, the
|
|
82
|
-
* <code>x-amz-lex-dialog-state</code> header is set to
|
|
83
|
-
* <code>Confirmation</code> and the
|
|
84
|
-
* <code>x-amz-lex-slot-to-elicit</code> header is omitted. </p>
|
|
85
|
-
* </li>
|
|
86
|
-
* <li>
|
|
87
|
-
* <p> If the message is a clarification prompt configured for the
|
|
88
|
-
* intent, indicating that the user intent is not understood, the
|
|
89
|
-
* <code>x-amz-dialog-state</code> header is set to
|
|
90
|
-
* <code>ElicitIntent</code> and the <code>x-amz-slot-to-elicit</code>
|
|
91
|
-
* header is omitted. </p>
|
|
92
|
-
* </li>
|
|
93
|
-
* </ul>
|
|
94
|
-
* <p> In addition, Amazon Lex also returns your application-specific
|
|
95
|
-
* <code>sessionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing
|
|
96
|
-
* Conversation Context</a>. </p>
|
|
97
|
-
* @example
|
|
98
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
99
|
-
* ```javascript
|
|
100
|
-
* import { LexRuntimeServiceClient, PostContentCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
101
|
-
* // const { LexRuntimeServiceClient, PostContentCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
102
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
103
|
-
* const command = new PostContentCommand(input);
|
|
104
|
-
* const response = await client.send(command);
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* @see {@link PostContentCommandInput} for command's `input` shape.
|
|
108
|
-
* @see {@link PostContentCommandOutput} for command's `response` shape.
|
|
109
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
15
|
+
|
|
112
16
|
export declare class PostContentCommand extends $Command<PostContentCommandInput, PostContentCommandOutput, LexRuntimeServiceClientResolvedConfig> {
|
|
113
17
|
readonly input: PostContentCommandInput;
|
|
114
18
|
constructor(input: PostContentCommandInput);
|
|
115
|
-
|
|
116
|
-
* @internal
|
|
117
|
-
*/
|
|
19
|
+
|
|
118
20
|
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: LexRuntimeServiceClientResolvedConfig, options?: __HttpHandlerOptions): Handler<PostContentCommandInput, PostContentCommandOutput>;
|
|
119
21
|
private serialize;
|
|
120
22
|
private deserialize;
|
|
@@ -6,104 +6,11 @@ export interface PostTextCommandInput extends PostTextRequest {
|
|
|
6
6
|
}
|
|
7
7
|
export interface PostTextCommandOutput extends PostTextResponse, __MetadataBearer {
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* <p>Sends user input to Amazon Lex. Client applications can use this API to
|
|
11
|
-
* send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input
|
|
12
|
-
* using the machine learning model it built for the bot. </p>
|
|
13
|
-
* <p> In response, Amazon Lex returns the next <code>message</code> to convey to
|
|
14
|
-
* the user an optional <code>responseCard</code> to display. Consider the
|
|
15
|
-
* following example messages: </p>
|
|
16
|
-
* <ul>
|
|
17
|
-
* <li>
|
|
18
|
-
* <p> For a user input "I would like a pizza", Amazon Lex might return a
|
|
19
|
-
* response with a message eliciting slot data (for example, PizzaSize):
|
|
20
|
-
* "What size pizza would you like?" </p>
|
|
21
|
-
* </li>
|
|
22
|
-
* <li>
|
|
23
|
-
* <p> After the user provides all of the pizza order information,
|
|
24
|
-
* Amazon Lex might return a response with a message to obtain user
|
|
25
|
-
* confirmation "Proceed with the pizza order?". </p>
|
|
26
|
-
* </li>
|
|
27
|
-
* <li>
|
|
28
|
-
* <p> After the user replies to a confirmation prompt with a "yes",
|
|
29
|
-
* Amazon Lex might return a conclusion statement: "Thank you, your cheese
|
|
30
|
-
* pizza has been ordered.". </p>
|
|
31
|
-
* </li>
|
|
32
|
-
* </ul>
|
|
33
|
-
*
|
|
34
|
-
* <p> Not all Amazon Lex messages require a user response. For example, a
|
|
35
|
-
* conclusion statement does not require a response. Some messages require
|
|
36
|
-
* only a "yes" or "no" user response. In addition to the
|
|
37
|
-
* <code>message</code>, Amazon Lex provides additional context about the
|
|
38
|
-
* message in the response that you might use to enhance client behavior, for
|
|
39
|
-
* example, to display the appropriate client user interface. These are the
|
|
40
|
-
* <code>slotToElicit</code>, <code>dialogState</code>,
|
|
41
|
-
* <code>intentName</code>, and <code>slots</code> fields in the response.
|
|
42
|
-
* Consider the following examples: </p>
|
|
43
|
-
*
|
|
44
|
-
* <ul>
|
|
45
|
-
* <li>
|
|
46
|
-
* <p>If the message is to elicit slot data, Amazon Lex returns the
|
|
47
|
-
* following context information:</p>
|
|
48
|
-
* <ul>
|
|
49
|
-
* <li>
|
|
50
|
-
* <p>
|
|
51
|
-
* <code>dialogState</code> set to ElicitSlot </p>
|
|
52
|
-
* </li>
|
|
53
|
-
* <li>
|
|
54
|
-
* <p>
|
|
55
|
-
* <code>intentName</code> set to the intent name in the current
|
|
56
|
-
* context </p>
|
|
57
|
-
* </li>
|
|
58
|
-
* <li>
|
|
59
|
-
* <p>
|
|
60
|
-
* <code>slotToElicit</code> set to the slot name for which the
|
|
61
|
-
* <code>message</code> is eliciting information </p>
|
|
62
|
-
* </li>
|
|
63
|
-
* <li>
|
|
64
|
-
* <p>
|
|
65
|
-
* <code>slots</code> set to a map of slots, configured for the
|
|
66
|
-
* intent, with currently known values </p>
|
|
67
|
-
* </li>
|
|
68
|
-
* </ul>
|
|
69
|
-
* </li>
|
|
70
|
-
* <li>
|
|
71
|
-
* <p> If the message is a confirmation prompt, the
|
|
72
|
-
* <code>dialogState</code> is set to ConfirmIntent and
|
|
73
|
-
* <code>SlotToElicit</code> is set to null. </p>
|
|
74
|
-
* </li>
|
|
75
|
-
* <li>
|
|
76
|
-
* <p>If the message is a clarification prompt (configured for the
|
|
77
|
-
* intent) that indicates that user intent is not understood, the
|
|
78
|
-
* <code>dialogState</code> is set to ElicitIntent and
|
|
79
|
-
* <code>slotToElicit</code> is set to null. </p>
|
|
80
|
-
* </li>
|
|
81
|
-
* </ul>
|
|
82
|
-
*
|
|
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, PostTextCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
90
|
-
* // const { LexRuntimeServiceClient, PostTextCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
91
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
92
|
-
* const command = new PostTextCommand(input);
|
|
93
|
-
* const response = await client.send(command);
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* @see {@link PostTextCommandInput} for command's `input` shape.
|
|
97
|
-
* @see {@link PostTextCommandOutput} for command's `response` shape.
|
|
98
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
99
|
-
*
|
|
100
|
-
*/
|
|
9
|
+
|
|
101
10
|
export declare class PostTextCommand extends $Command<PostTextCommandInput, PostTextCommandOutput, LexRuntimeServiceClientResolvedConfig> {
|
|
102
11
|
readonly input: PostTextCommandInput;
|
|
103
12
|
constructor(input: PostTextCommandInput);
|
|
104
|
-
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
13
|
+
|
|
107
14
|
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: LexRuntimeServiceClientResolvedConfig, options?: __HttpHandlerOptions): Handler<PostTextCommandInput, PostTextCommandOutput>;
|
|
108
15
|
private serialize;
|
|
109
16
|
private deserialize;
|
|
@@ -6,33 +6,11 @@ export interface PutSessionCommandInput extends PutSessionRequest {
|
|
|
6
6
|
}
|
|
7
7
|
export interface PutSessionCommandOutput extends PutSessionResponse, __MetadataBearer {
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* <p>Creates a new session or modifies an existing session with an Amazon Lex
|
|
11
|
-
* bot. Use this operation to enable your application to set the state of the
|
|
12
|
-
* bot.</p>
|
|
13
|
-
* <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html">Managing
|
|
14
|
-
* Sessions</a>.</p>
|
|
15
|
-
* @example
|
|
16
|
-
* Use a bare-bones client and the command you need to make an API call.
|
|
17
|
-
* ```javascript
|
|
18
|
-
* import { LexRuntimeServiceClient, PutSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import
|
|
19
|
-
* // const { LexRuntimeServiceClient, PutSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import
|
|
20
|
-
* const client = new LexRuntimeServiceClient(config);
|
|
21
|
-
* const command = new PutSessionCommand(input);
|
|
22
|
-
* const response = await client.send(command);
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @see {@link PutSessionCommandInput} for command's `input` shape.
|
|
26
|
-
* @see {@link PutSessionCommandOutput} for command's `response` shape.
|
|
27
|
-
* @see {@link LexRuntimeServiceClientResolvedConfig | config} for command's `input` shape.
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
9
|
+
|
|
30
10
|
export declare class PutSessionCommand extends $Command<PutSessionCommandInput, PutSessionCommandOutput, LexRuntimeServiceClientResolvedConfig> {
|
|
31
11
|
readonly input: PutSessionCommandInput;
|
|
32
12
|
constructor(input: PutSessionCommandInput);
|
|
33
|
-
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
13
|
+
|
|
36
14
|
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: LexRuntimeServiceClientResolvedConfig, options?: __HttpHandlerOptions): Handler<PutSessionCommandInput, PutSessionCommandOutput>;
|
|
37
15
|
private serialize;
|
|
38
16
|
private deserialize;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export * from "./LexRuntimeServiceClient";
|
|
2
1
|
export * from "./LexRuntimeService";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./commands
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./commands/PostTextCommand";
|
|
7
|
-
export * from "./commands/PutSessionCommand";
|
|
8
|
-
export * from "./models/index";
|
|
2
|
+
export * from "./LexRuntimeServiceClient";
|
|
3
|
+
export * from "./commands";
|
|
4
|
+
export * from "./models";
|