chatbot-agentic 1.0.10 → 1.0.12

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.
@@ -24,9 +24,12 @@ export declare const AWS: {
24
24
  getLabelDetection: (data: import("@aws-sdk/client-rekognition").GetLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetLabelDetectionCommandOutput>;
25
25
  startTextDetection: (data: import("@aws-sdk/client-rekognition").StartTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartTextDetectionCommandOutput>;
26
26
  getTextDetection: (data: import("@aws-sdk/client-rekognition").GetTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetTextDetectionCommandOutput>;
27
+ textDetection: (data: import("@aws-sdk/client-rekognition").DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectTextCommandOutput>;
28
+ labelDetection: (data: import("@aws-sdk/client-rekognition").DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectLabelsCommandOutput>;
27
29
  };
28
30
  Textract: {
29
31
  startDocumentTextDetection: (data: import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandOutput>;
30
32
  getDocumentTextDetection: (data: import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandOutput>;
33
+ documentTextDetection: (data: import("@aws-sdk/client-textract").DetectDocumentTextCommandInput) => Promise<import("@aws-sdk/client-textract").DetectDocumentTextCommandOutput>;
31
34
  };
32
35
  };
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BedrockRuntime = void 0;
4
4
  const client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
5
+ const ClientConfig_1 = require("./ClientConfig");
5
6
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
6
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
7
- const client = new client_bedrock_runtime_1.BedrockRuntimeClient({ region: awsRegion });
7
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
8
+ // const client = new BedrockRuntimeClient({ region: awsRegion });
9
+ const client = new client_bedrock_runtime_1.BedrockRuntimeClient(ClientConfig_1.awsClientConfig);
8
10
  /**
9
11
  * This is used to invoke the model
10
12
  * @param data
@@ -1 +1 @@
1
- {"version":3,"file":"AWSBedrockRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockRuntime.ts"],"names":[],"mappings":";;;AAAA,4EAAqH;AAErH,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,6CAAoB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,IAA4B,EAAG,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,2CAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAGY,QAAA,cAAc,GAAG;IAC3B,WAAW;CACb,CAAA"}
1
+ {"version":3,"file":"AWSBedrockRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockRuntime.ts"],"names":[],"mappings":";;;AAAA,4EAAqH;AACrH,iDAAiD;AAEjD,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,qEAAqE;AACrE,kEAAkE;AAClE,MAAM,MAAM,GAAG,IAAI,6CAAoB,CAAC,8BAAe,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,IAA4B,EAAG,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,2CAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAGY,QAAA,cAAc,GAAG;IAC3B,WAAW;CACb,CAAA"}
@@ -1,7 +1,9 @@
1
- import { GetLabelDetectionCommandInput, GetTextDetectionCommandInput, StartLabelDetectionCommandInput, StartTextDetectionCommandInput } from "@aws-sdk/client-rekognition";
1
+ import { DetectTextCommandInput, GetLabelDetectionCommandInput, GetTextDetectionCommandInput, StartLabelDetectionCommandInput, StartTextDetectionCommandInput } from "@aws-sdk/client-rekognition";
2
2
  export declare const Rekognition: {
3
3
  startLableDetection: (data: StartLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartLabelDetectionCommandOutput>;
4
4
  getLabelDetection: (data: GetLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetLabelDetectionCommandOutput>;
5
5
  startTextDetection: (data: StartTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartTextDetectionCommandOutput>;
6
6
  getTextDetection: (data: GetTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetTextDetectionCommandOutput>;
7
+ textDetection: (data: DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectTextCommandOutput>;
8
+ labelDetection: (data: DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectLabelsCommandOutput>;
7
9
  };
@@ -2,9 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Rekognition = void 0;
4
4
  const client_rekognition_1 = require("@aws-sdk/client-rekognition");
5
+ const ClientConfig_1 = require("./ClientConfig");
5
6
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
6
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
7
- const client = new client_rekognition_1.RekognitionClient({ region: awsRegion });
7
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
8
+ // const client = new RekognitionClient({ region: awsRegion });
9
+ ClientConfig_1.awsClientConfig.maxAttempts = 5;
10
+ const client = new client_rekognition_1.RekognitionClient(ClientConfig_1.awsClientConfig);
8
11
  /**
9
12
  * This is used to detect the label
10
13
  * @param data
@@ -54,10 +57,44 @@ const getTextDetection = async (data) => {
54
57
  throw error;
55
58
  }
56
59
  };
60
+ /**
61
+ * This give you immdeiate response
62
+ * @param data
63
+ * @returns
64
+ */
65
+ const textDetection = async (data) => {
66
+ try {
67
+ const command = new client_rekognition_1.DetectTextCommand(data);
68
+ const response = await client.send(command);
69
+ return response;
70
+ }
71
+ catch (error) {
72
+ console.info(`error occured while get text detection details`);
73
+ throw error;
74
+ }
75
+ };
76
+ /**
77
+ * This give you immdeiate response
78
+ * @param data
79
+ * @returns
80
+ */
81
+ const labelDetection = async (data) => {
82
+ try {
83
+ const command = new client_rekognition_1.DetectLabelsCommand(data);
84
+ const response = await client.send(command);
85
+ return response;
86
+ }
87
+ catch (error) {
88
+ console.info(`error occured while get label detection details`);
89
+ throw error;
90
+ }
91
+ };
57
92
  exports.Rekognition = {
58
93
  startLableDetection,
59
94
  getLabelDetection,
60
95
  startTextDetection,
61
- getTextDetection
96
+ getTextDetection,
97
+ textDetection,
98
+ labelDetection
62
99
  };
63
100
  //# sourceMappingURL=AWSRekognition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSRekognition.js","sourceRoot":"","sources":["../../../../aws/services/AWSRekognition.ts"],"names":[],"mappings":";;;AAAA,oEAAwS;AAExS,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,sCAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAAoC,EAAG,EAAE;IAC1E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,+CAA0B,CAAC,IAAI,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,KAAK,EAAE,IAAmC,EAAG,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,8CAAyB,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACzD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAID,MAAM,iBAAiB,GAAG,KAAK,EAAE,IAA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
+ import { StartDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandInput, DetectDocumentTextCommandInput } from "@aws-sdk/client-textract";
2
2
  export declare const Textract: {
3
3
  startDocumentTextDetection: (data: StartDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandOutput>;
4
4
  getDocumentTextDetection: (data: GetDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandOutput>;
5
+ documentTextDetection: (data: DetectDocumentTextCommandInput) => Promise<import("@aws-sdk/client-textract").DetectDocumentTextCommandOutput>;
5
6
  };
@@ -2,9 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Textract = void 0;
4
4
  const client_textract_1 = require("@aws-sdk/client-textract");
5
+ const ClientConfig_1 = require("./ClientConfig");
5
6
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
6
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
7
- const client = new client_textract_1.TextractClient({ region: awsRegion });
7
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
8
+ // const client = new TextractClient({ region: awsRegion });
9
+ ClientConfig_1.awsClientConfig.maxAttempts = 5;
10
+ const client = new client_textract_1.TextractClient(ClientConfig_1.awsClientConfig);
8
11
  /**
9
12
  * This is used to detect the text
10
13
  * @param data
@@ -37,8 +40,25 @@ const getDocumentTextDetection = async (data) => {
37
40
  throw error;
38
41
  }
39
42
  };
43
+ /**
44
+ * This give you response immediate
45
+ * @param data
46
+ * @returns
47
+ */
48
+ const documentTextDetection = async (data) => {
49
+ try {
50
+ const command = new client_textract_1.DetectDocumentTextCommand(data);
51
+ const response = await client.send(command);
52
+ return response;
53
+ }
54
+ catch (error) {
55
+ console.info(`error occured while get text detection`);
56
+ throw error;
57
+ }
58
+ };
40
59
  exports.Textract = {
41
60
  startDocumentTextDetection,
42
- getDocumentTextDetection
61
+ getDocumentTextDetection,
62
+ documentTextDetection
43
63
  };
44
64
  //# sourceMappingURL=AWSTextTract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSTextTract.js","sourceRoot":"","sources":["../../../../aws/services/AWSTextTract.ts"],"names":[],"mappings":";;;AAAA,8DAA6M;AAE7M,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,gCAAc,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,KAAK,EAAE,IAA2C,EAAG,EAAE;IACxF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,mDAAiC,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACnD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,KAAK,EAAE,IAAyC,EAAG,EAAE;IACpF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,iDAA+B,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAEY,QAAA,QAAQ,GA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AAE,IAAmC,EAAG,EAAE;IAC3E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,2CAAyB,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAIY,QAAA,QAAQ,GAAG;IACrB,0BAA0B;IAC1B,wBAAwB;IACxB,qBAAqB;CACvB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const awsClientConfig: {
2
+ region: string;
3
+ maxAttempts: number;
4
+ retryMode: string;
5
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.awsClientConfig = void 0;
4
+ const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
5
+ exports.awsClientConfig = {
6
+ region: awsRegion,
7
+ // 🔁 Retries (same as boto3 adaptive)
8
+ maxAttempts: 10,
9
+ retryMode: "adaptive"
10
+ // ⏱ Timeouts (Node.js runtime)
11
+ // requestHandler: {
12
+ // connectionTimeout: 5_000, // connect_timeout
13
+ // requestTimeout: 30_000 // read_timeout
14
+ // }
15
+ };
16
+ //# sourceMappingURL=ClientConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientConfig.js","sourceRoot":"","sources":["../../../../aws/services/ClientConfig.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AACrD,QAAA,eAAe,GAAI;IAC5B,MAAM,EAAE,SAAS;IAEjB,sCAAsC;IACtC,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,UAAU;IAErB,+BAA+B;IAC/B,oBAAoB;IACpB,mDAAmD;IACnD,gDAAgD;IAChD,IAAI;CACP,CAAA"}
@@ -24,9 +24,12 @@ export declare const AWS: {
24
24
  getLabelDetection: (data: import("@aws-sdk/client-rekognition").GetLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetLabelDetectionCommandOutput>;
25
25
  startTextDetection: (data: import("@aws-sdk/client-rekognition").StartTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartTextDetectionCommandOutput>;
26
26
  getTextDetection: (data: import("@aws-sdk/client-rekognition").GetTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetTextDetectionCommandOutput>;
27
+ textDetection: (data: import("@aws-sdk/client-rekognition").DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectTextCommandOutput>;
28
+ labelDetection: (data: import("@aws-sdk/client-rekognition").DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectLabelsCommandOutput>;
27
29
  };
28
30
  Textract: {
29
31
  startDocumentTextDetection: (data: import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandOutput>;
30
32
  getDocumentTextDetection: (data: import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandOutput>;
33
+ documentTextDetection: (data: import("@aws-sdk/client-textract").DetectDocumentTextCommandInput) => Promise<import("@aws-sdk/client-textract").DetectDocumentTextCommandOutput>;
31
34
  };
32
35
  };
@@ -8,9 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { BedrockRuntimeClient, InvokeModelCommand } from "@aws-sdk/client-bedrock-runtime";
11
+ import { awsClientConfig } from "./ClientConfig";
11
12
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
12
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
13
- const client = new BedrockRuntimeClient({ region: awsRegion });
13
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
14
+ // const client = new BedrockRuntimeClient({ region: awsRegion });
15
+ const client = new BedrockRuntimeClient(awsClientConfig);
14
16
  /**
15
17
  * This is used to invoke the model
16
18
  * @param data
@@ -1 +1 @@
1
- {"version":3,"file":"AWSBedrockRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockRuntime.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAA4B,MAAM,iCAAiC,CAAC;AAErH,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAO,IAA4B,EAAG,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC3B,WAAW;CACb,CAAA"}
1
+ {"version":3,"file":"AWSBedrockRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockRuntime.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAA4B,MAAM,iCAAiC,CAAC;AACrH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,qEAAqE;AACrE,kEAAkE;AAClE,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,eAAe,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAO,IAA4B,EAAG,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC3B,WAAW;CACb,CAAA"}
@@ -1,7 +1,9 @@
1
- import { GetLabelDetectionCommandInput, GetTextDetectionCommandInput, StartLabelDetectionCommandInput, StartTextDetectionCommandInput } from "@aws-sdk/client-rekognition";
1
+ import { DetectTextCommandInput, GetLabelDetectionCommandInput, GetTextDetectionCommandInput, StartLabelDetectionCommandInput, StartTextDetectionCommandInput } from "@aws-sdk/client-rekognition";
2
2
  export declare const Rekognition: {
3
3
  startLableDetection: (data: StartLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartLabelDetectionCommandOutput>;
4
4
  getLabelDetection: (data: GetLabelDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetLabelDetectionCommandOutput>;
5
5
  startTextDetection: (data: StartTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").StartTextDetectionCommandOutput>;
6
6
  getTextDetection: (data: GetTextDetectionCommandInput) => Promise<import("@aws-sdk/client-rekognition").GetTextDetectionCommandOutput>;
7
+ textDetection: (data: DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectTextCommandOutput>;
8
+ labelDetection: (data: DetectTextCommandInput) => Promise<import("@aws-sdk/client-rekognition").DetectLabelsCommandOutput>;
7
9
  };
@@ -7,10 +7,13 @@ 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 { GetLabelDetectionCommand, GetTextDetectionCommand, RekognitionClient, StartLabelDetectionCommand, StartTextDetectionCommand } from "@aws-sdk/client-rekognition";
10
+ import { DetectLabelsCommand, DetectTextCommand, GetLabelDetectionCommand, GetTextDetectionCommand, RekognitionClient, StartLabelDetectionCommand, StartTextDetectionCommand } from "@aws-sdk/client-rekognition";
11
+ import { awsClientConfig } from "./ClientConfig";
11
12
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
12
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
13
- const client = new RekognitionClient({ region: awsRegion });
13
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
14
+ // const client = new RekognitionClient({ region: awsRegion });
15
+ awsClientConfig.maxAttempts = 5;
16
+ const client = new RekognitionClient(awsClientConfig);
14
17
  /**
15
18
  * This is used to detect the label
16
19
  * @param data
@@ -60,10 +63,44 @@ const getTextDetection = (data) => __awaiter(void 0, void 0, void 0, function* (
60
63
  throw error;
61
64
  }
62
65
  });
66
+ /**
67
+ * This give you immdeiate response
68
+ * @param data
69
+ * @returns
70
+ */
71
+ const textDetection = (data) => __awaiter(void 0, void 0, void 0, function* () {
72
+ try {
73
+ const command = new DetectTextCommand(data);
74
+ const response = yield client.send(command);
75
+ return response;
76
+ }
77
+ catch (error) {
78
+ console.info(`error occured while get text detection details`);
79
+ throw error;
80
+ }
81
+ });
82
+ /**
83
+ * This give you immdeiate response
84
+ * @param data
85
+ * @returns
86
+ */
87
+ const labelDetection = (data) => __awaiter(void 0, void 0, void 0, function* () {
88
+ try {
89
+ const command = new DetectLabelsCommand(data);
90
+ const response = yield client.send(command);
91
+ return response;
92
+ }
93
+ catch (error) {
94
+ console.info(`error occured while get label detection details`);
95
+ throw error;
96
+ }
97
+ });
63
98
  export const Rekognition = {
64
99
  startLableDetection,
65
100
  getLabelDetection,
66
101
  startTextDetection,
67
- getTextDetection
102
+ getTextDetection,
103
+ textDetection,
104
+ labelDetection
68
105
  };
69
106
  //# sourceMappingURL=AWSRekognition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSRekognition.js","sourceRoot":"","sources":["../../../../aws/services/AWSRekognition.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAiC,uBAAuB,EAAgC,iBAAiB,EAAC,0BAA0B,EAAkC,yBAAyB,EAAoC,MAAM,6BAA6B,CAAC;AAExS,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAO,IAAoC,EAAG,EAAE;IAC1E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC;IACd,CAAC;AACH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ACH,CAAC,CAAA,CAAA;AAED;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAO,IAA2B,EAAG,EAAE;IAC5D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;QAChE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAGD,MAAM,CAAC,MAAM,WAAW,GAAG;IACxB,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,aAAa;IACb,cAAc;CAChB,CAAA"}
@@ -1,5 +1,6 @@
1
- import { StartDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandInput } from "@aws-sdk/client-textract";
1
+ import { StartDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandInput, DetectDocumentTextCommandInput } from "@aws-sdk/client-textract";
2
2
  export declare const Textract: {
3
3
  startDocumentTextDetection: (data: StartDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").StartDocumentTextDetectionCommandOutput>;
4
4
  getDocumentTextDetection: (data: GetDocumentTextDetectionCommandInput) => Promise<import("@aws-sdk/client-textract").GetDocumentTextDetectionCommandOutput>;
5
+ documentTextDetection: (data: DetectDocumentTextCommandInput) => Promise<import("@aws-sdk/client-textract").DetectDocumentTextCommandOutput>;
5
6
  };
@@ -7,10 +7,13 @@ 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 { TextractClient, StartDocumentTextDetectionCommand, GetDocumentTextDetectionCommand } from "@aws-sdk/client-textract";
10
+ import { TextractClient, StartDocumentTextDetectionCommand, GetDocumentTextDetectionCommand, DetectDocumentTextCommand } from "@aws-sdk/client-textract";
11
+ import { awsClientConfig } from "./ClientConfig";
11
12
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
12
- const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
13
- const client = new TextractClient({ region: awsRegion });
13
+ // const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
14
+ // const client = new TextractClient({ region: awsRegion });
15
+ awsClientConfig.maxAttempts = 5;
16
+ const client = new TextractClient(awsClientConfig);
14
17
  /**
15
18
  * This is used to detect the text
16
19
  * @param data
@@ -43,8 +46,25 @@ const getDocumentTextDetection = (data) => __awaiter(void 0, void 0, void 0, fun
43
46
  throw error;
44
47
  }
45
48
  });
49
+ /**
50
+ * This give you response immediate
51
+ * @param data
52
+ * @returns
53
+ */
54
+ const documentTextDetection = (data) => __awaiter(void 0, void 0, void 0, function* () {
55
+ try {
56
+ const command = new DetectDocumentTextCommand(data);
57
+ const response = yield client.send(command);
58
+ return response;
59
+ }
60
+ catch (error) {
61
+ console.info(`error occured while get text detection`);
62
+ throw error;
63
+ }
64
+ });
46
65
  export const Textract = {
47
66
  startDocumentTextDetection,
48
- getDocumentTextDetection
67
+ getDocumentTextDetection,
68
+ documentTextDetection
49
69
  };
50
70
  //# sourceMappingURL=AWSTextTract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSTextTract.js","sourceRoot":"","sources":["../../../../aws/services/AWSTextTract.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,iCAAiC,EAAgF,+BAA+B,EAAG,MAAM,0BAA0B,CAAC;AAE7M,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAA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EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAID,MAAM,CAAC,MAAM,QAAQ,GAAG;IACrB,0BAA0B;IAC1B,wBAAwB;IACxB,qBAAqB;CACvB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const awsClientConfig: {
2
+ region: string;
3
+ maxAttempts: number;
4
+ retryMode: string;
5
+ };
@@ -0,0 +1,13 @@
1
+ const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
2
+ export const awsClientConfig = {
3
+ region: awsRegion,
4
+ // 🔁 Retries (same as boto3 adaptive)
5
+ maxAttempts: 10,
6
+ retryMode: "adaptive"
7
+ // ⏱ Timeouts (Node.js runtime)
8
+ // requestHandler: {
9
+ // connectionTimeout: 5_000, // connect_timeout
10
+ // requestTimeout: 30_000 // read_timeout
11
+ // }
12
+ };
13
+ //# sourceMappingURL=ClientConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientConfig.js","sourceRoot":"","sources":["../../../../aws/services/ClientConfig.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,eAAe,GAAI;IAC5B,MAAM,EAAE,SAAS;IAEjB,sCAAsC;IACtC,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,UAAU;IAErB,+BAA+B;IAC/B,oBAAoB;IACpB,mDAAmD;IACnD,gDAAgD;IAChD,IAAI;CACP,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatbot-agentic",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",