chatbot-nc 1.0.53 → 1.0.54
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/dist/cjs/aws/index.d.ts +1 -0
- package/dist/cjs/aws/services/AWSLexRuntime.d.ts +2 -1
- package/dist/cjs/aws/services/AWSLexRuntime.js +21 -1
- package/dist/cjs/aws/services/AWSLexRuntime.js.map +1 -1
- package/dist/esm/aws/index.d.ts +1 -0
- package/dist/esm/aws/services/AWSLexRuntime.d.ts +2 -1
- package/dist/esm/aws/services/AWSLexRuntime.js +22 -2
- package/dist/esm/aws/services/AWSLexRuntime.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/aws/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const AWS: {
|
|
|
13
13
|
};
|
|
14
14
|
LexRuntime: {
|
|
15
15
|
recognizeText: (lexParams: import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandOutput>;
|
|
16
|
+
getSession: (lexSessionParams: import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandOutput>;
|
|
16
17
|
};
|
|
17
18
|
LexModel: {
|
|
18
19
|
createBot: (botInput: import("@aws-sdk/client-lex-models-v2").CreateBotCommandInput) => Promise<import("@aws-sdk/client-lex-models-v2").CreateBotCommandOutput>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RecognizeTextCommandInput } from "@aws-sdk/client-lex-runtime-v2";
|
|
1
|
+
import { GetSessionCommandInput, RecognizeTextCommandInput } from "@aws-sdk/client-lex-runtime-v2";
|
|
2
2
|
export declare const LexRuntime: {
|
|
3
3
|
recognizeText: (lexParams: RecognizeTextCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandOutput>;
|
|
4
|
+
getSession: (lexSessionParams: GetSessionCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandOutput>;
|
|
4
5
|
};
|
|
@@ -32,7 +32,27 @@ const recognizeText = (lexParams) => __awaiter(void 0, void 0, void 0, function*
|
|
|
32
32
|
throw new Error('lex Error');
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
+
/**
|
|
36
|
+
* This method to use get lex bot session
|
|
37
|
+
* @param lexSessionParams
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
const getSession = (lexSessionParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
let param = lexSessionParams;
|
|
43
|
+
const command = new client_lex_runtime_v2_1.GetSessionCommand(param);
|
|
44
|
+
const response = yield client.send(command);
|
|
45
|
+
console.log("response received from lex with session");
|
|
46
|
+
console.log(JSON.stringify(response));
|
|
47
|
+
return response;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.log(error);
|
|
51
|
+
throw new Error('lex Error to get session');
|
|
52
|
+
}
|
|
53
|
+
});
|
|
35
54
|
exports.LexRuntime = {
|
|
36
|
-
recognizeText
|
|
55
|
+
recognizeText,
|
|
56
|
+
getSession
|
|
37
57
|
};
|
|
38
58
|
//# sourceMappingURL=AWSLexRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AWSLexRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSLexRuntime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"AWSLexRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSLexRuntime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0EAMwC;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC;AAChE,MAAM,MAAM,GAAG,IAAI,0CAAkB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,a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13
13
|
};
|
|
14
14
|
LexRuntime: {
|
|
15
15
|
recognizeText: (lexParams: import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandOutput>;
|
|
16
|
+
getSession: (lexSessionParams: import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandOutput>;
|
|
16
17
|
};
|
|
17
18
|
LexModel: {
|
|
18
19
|
createBot: (botInput: import("@aws-sdk/client-lex-models-v2").CreateBotCommandInput) => Promise<import("@aws-sdk/client-lex-models-v2").CreateBotCommandOutput>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RecognizeTextCommandInput } from "@aws-sdk/client-lex-runtime-v2";
|
|
1
|
+
import { GetSessionCommandInput, RecognizeTextCommandInput } from "@aws-sdk/client-lex-runtime-v2";
|
|
2
2
|
export declare const LexRuntime: {
|
|
3
3
|
recognizeText: (lexParams: RecognizeTextCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").RecognizeTextCommandOutput>;
|
|
4
|
+
getSession: (lexSessionParams: GetSessionCommandInput) => Promise<import("@aws-sdk/client-lex-runtime-v2").GetSessionCommandOutput>;
|
|
4
5
|
};
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { LexRuntimeV2Client, RecognizeTextCommand } from "@aws-sdk/client-lex-runtime-v2";
|
|
10
|
+
import { GetSessionCommand, LexRuntimeV2Client, RecognizeTextCommand } from "@aws-sdk/client-lex-runtime-v2";
|
|
11
11
|
const awsRegion = process.env.AWS_DEFAULT_REGION || 'us-east-1';
|
|
12
12
|
const client = new LexRuntimeV2Client({ region: awsRegion });
|
|
13
13
|
/**
|
|
@@ -29,7 +29,27 @@ const recognizeText = (lexParams) => __awaiter(void 0, void 0, void 0, function*
|
|
|
29
29
|
throw new Error('lex Error');
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
/**
|
|
33
|
+
* This method to use get lex bot session
|
|
34
|
+
* @param lexSessionParams
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
const getSession = (lexSessionParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
let param = lexSessionParams;
|
|
40
|
+
const command = new GetSessionCommand(param);
|
|
41
|
+
const response = yield client.send(command);
|
|
42
|
+
console.log("response received from lex with session");
|
|
43
|
+
console.log(JSON.stringify(response));
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.log(error);
|
|
48
|
+
throw new Error('lex Error to get session');
|
|
49
|
+
}
|
|
50
|
+
});
|
|
32
51
|
export const LexRuntime = {
|
|
33
|
-
recognizeText
|
|
52
|
+
recognizeText,
|
|
53
|
+
getSession
|
|
34
54
|
};
|
|
35
55
|
//# sourceMappingURL=AWSLexRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AWSLexRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSLexRuntime.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AWSLexRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSLexRuntime.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,iBAAiB,EAEjB,kBAAkB,EAClB,oBAAoB,EAErB,MAAM,gCAAgC,CAAC;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC;AAChE,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAO,SAAoC,EAAE,EAAE;IAC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