@xapp/stentor-service-lex 1.86.9 → 1.86.11
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/README.md +31 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
##
|
|
1
|
+
## @xapp/stentor-service-lex
|
|
2
2
|
|
|
3
|
-
Service to
|
|
3
|
+
Service wrapper around the AWS Lex V2 runtime and models SDKs. `LexServiceV2` is a Stentor `NLUService`: `query()` resolves raw text to an intent and slots, `setContext()` pushes active contexts to the Lex session, and `sync()` / `delete()` / `getStatus()` manage the bot built from Stentor intents and entities. Credentials come from static keys, an assumed role (`AWSCredentialsRetriever`), or the AWS SDK default credential chain.
|
|
4
4
|
|
|
5
|
+
### Required Environment Variables
|
|
6
|
+
|
|
7
|
+
These are defaults for `LexServiceV2Config` and can be overridden via the constructor.
|
|
8
|
+
|
|
9
|
+
- `LEX_BOT_ID` - id of the Lex V2 bot to talk to
|
|
10
|
+
- `LEX_BOT_ALIAS_ID` - alias id of the bot to talk to
|
|
11
|
+
- `LEX_BOT_NAME` - bot name (sync falls back to `STUDIO-Bot-<appId>` when unset)
|
|
12
|
+
- `AWS_DEFAULT_REGION` - AWS region for the Lex clients
|
|
13
|
+
- `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` - static AWS credentials (optional; the SDK default credential chain is used otherwise)
|
|
14
|
+
- `AWS_LEX_ROLE_ARN` - role to assume for Lex operations (used for both `role.arn` and `role.externalId`)
|
|
15
|
+
- `AWS_PROFILE` - local AWS credentials profile, consulted when no static keys are provided
|
|
16
|
+
|
|
17
|
+
### Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { LexServiceV2 } from "@xapp/stentor-service-lex";
|
|
21
|
+
|
|
22
|
+
const lex = new LexServiceV2({
|
|
23
|
+
botId: "MY_BOT_ID",
|
|
24
|
+
botAliasId: "MY_BOT_ALIAS_ID"
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const result = await lex.query("I want to book an appointment");
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
|
|
32
|
+
- [Amazon Lex V2 Developer Guide](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html)
|
|
33
|
+
- [AWS SDK for JavaScript v3 - Lex Runtime V2](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/client-lex-runtime-v2/)
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.86.
|
|
7
|
+
"version": "1.86.11",
|
|
8
8
|
"description": "Service to communicate with AWS LEX for :mega: stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"typescript": "5.9.3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@aws-sdk/client-lex-models-v2": "3.
|
|
37
|
-
"@aws-sdk/client-lex-runtime-v2": "3.
|
|
38
|
-
"@aws-sdk/client-sts": "3.
|
|
39
|
-
"@aws-sdk/credential-providers": "3.
|
|
36
|
+
"@aws-sdk/client-lex-models-v2": "3.1136.0",
|
|
37
|
+
"@aws-sdk/client-lex-runtime-v2": "3.1136.0",
|
|
38
|
+
"@aws-sdk/client-sts": "3.1136.0",
|
|
39
|
+
"@aws-sdk/credential-providers": "3.1136.0",
|
|
40
40
|
"@xapp/stentor-alexa-lib": "1.86.6",
|
|
41
41
|
"uuid": "13.0.2"
|
|
42
42
|
},
|