@xapp/stentor-lex-lib
v1.86.12
Published
Shared AWS LEX Library for :mega: stentor
Readme
@xapp/stentor-lex-lib
Shared AWS Lex library used by the @xapp/stentor-lex-connect (Lex V1) and @xapp/stentor-lex-v2 channel packages. It has no Channel of its own; instead it provides the common pieces those channels build on:
- Models for Lex V1 fulfillment requests/responses (
LexRequest,LexResponse),PostTextrequests/responses, slots, active contexts, response cards, and the Lex Import/Export bot format (bots, intents, slot types). - Translators that turn a Stentor
Requestinto a LexPostText(V1) orRecognizeText(V2) request and translate the Lex results back into a StentorResponse, plus translators to build/parse Lex Import/Export bot definitions. - Utils (
slugForLex,convertName,createPostFix) for generating names that satisfy Lex's naming restrictions (letters/underscores only, no consecutive underscores), including a per-app postfix derived from an MD5 hash of the app id.
Usage
import { slugForLex, createPostFix } from "@xapp/stentor-lex-lib";
const name = slugForLex("My Intent - Name"); // "My_Intent_Name"
const postfix = createPostFix({ appId: "abc123" });