chatbot-agentic 1.0.22 → 1.0.24

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.
@@ -17,10 +17,19 @@ export declare const AWS: {
17
17
  deleteAgentAlias: (data: import("@aws-sdk/client-bedrock-agent").DeleteAgentAliasCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent").DeleteAgentAliasCommandOutput>;
18
18
  deleteAgentVersion: (data: import("@aws-sdk/client-bedrock-agent").DeleteAgentVersionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent").DeleteAgentVersionCommandOutput>;
19
19
  };
20
+ Guardrail: {
21
+ createGuardrail: (data: import("@aws-sdk/client-bedrock").CreateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").CreateGuardrailCommandOutput>;
22
+ updateGuardrail: (data: import("@aws-sdk/client-bedrock").UpdateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").UpdateGuardrailCommandOutput>;
23
+ deleteGuardrail: (data: import("@aws-sdk/client-bedrock").DeleteGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").DeleteGuardrailCommandOutput>;
24
+ };
20
25
  AgentRuntime: {
21
26
  invokeAgent: (data: import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandOutput>;
22
27
  invokeFlow: (data: import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandOutput>;
23
28
  getSession: (data: import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandOutput>;
29
+ startFlowExecution: (data: import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandOutput>;
30
+ getFlowExecution: (data: import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandOutput>;
31
+ listFlowExecutionsCommand: (data: import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandOutput>;
32
+ listFlowExecutionEvents: (data: import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandOutput>;
24
33
  };
25
34
  BedrockRuntime: {
26
35
  invokeModel: (data: import("@aws-sdk/client-bedrock-runtime").InvokeModelCommandInput) => Promise<import("@aws-sdk/client-bedrock-runtime").InvokeModelCommandOutput>;
@@ -7,8 +7,10 @@ const AWSBedrockRuntime_1 = require("./services/AWSBedrockRuntime");
7
7
  const AWSRekognition_1 = require("./services/AWSRekognition");
8
8
  const AWSTextTract_1 = require("./services/AWSTextTract");
9
9
  const AWSBedrockFlow_1 = require("./services/AWSBedrockFlow");
10
+ const AWSBedrockGuardrail_1 = require("./services/AWSBedrockGuardrail");
10
11
  exports.AWS = {
11
12
  Agent: AWSBedrockAgent_1.Agent,
13
+ Guardrail: AWSBedrockGuardrail_1.Guardrail,
12
14
  AgentRuntime: AWSBedrockAgentRuntime_1.AgentRuntime,
13
15
  BedrockRuntime: AWSBedrockRuntime_1.BedrockRuntime,
14
16
  Rekognition: AWSRekognition_1.Rekognition,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../aws/index.ts"],"names":[],"mappings":";;;AAAA,gEAAmD;AACnD,8EAAiE;AACjE,oEAA8D;AAC9D,8DAAwD;AACxD,0DAAmD;AACnD,8DAAiD;AAGpC,QAAA,GAAG,GAAG;IACf,KAAK,EAAL,uBAAK;IACL,YAAY,EAAZ,qCAAY;IACZ,cAAc,EAAd,kCAAc;IACd,WAAW,EAAX,4BAAW;IACX,QAAQ,EAAR,uBAAQ;IACR,IAAI,EAAJ,qBAAI;CACP,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../aws/index.ts"],"names":[],"mappings":";;;AAAA,gEAAmD;AACnD,8EAAiE;AACjE,oEAA8D;AAC9D,8DAAwD;AACxD,0DAAmD;AACnD,8DAAiD;AACjD,wEAA2D;AAG9C,QAAA,GAAG,GAAG;IACf,KAAK,EAAL,uBAAK;IACL,SAAS,EAAT,+BAAS;IACT,YAAY,EAAZ,qCAAY;IACZ,cAAc,EAAd,kCAAc;IACd,WAAW,EAAX,4BAAW;IACX,QAAQ,EAAR,uBAAQ;IACR,IAAI,EAAJ,qBAAI;CACP,CAAA"}
@@ -1,6 +1,10 @@
1
- import { GetSessionCommandInput, InvokeAgentCommandInput, InvokeFlowCommandInput } from "@aws-sdk/client-bedrock-agent-runtime";
1
+ import { GetFlowExecutionCommandInput, GetSessionCommandInput, InvokeAgentCommandInput, InvokeFlowCommandInput, ListFlowExecutionEventsCommandInput, ListFlowExecutionsCommandInput, StartFlowExecutionCommandInput } from "@aws-sdk/client-bedrock-agent-runtime";
2
2
  export declare const AgentRuntime: {
3
3
  invokeAgent: (data: InvokeAgentCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandOutput>;
4
4
  invokeFlow: (data: InvokeFlowCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandOutput>;
5
5
  getSession: (data: GetSessionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandOutput>;
6
+ startFlowExecution: (data: StartFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandOutput>;
7
+ getFlowExecution: (data: GetFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandOutput>;
8
+ listFlowExecutionsCommand: (data: ListFlowExecutionsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandOutput>;
9
+ listFlowExecutionEvents: (data: ListFlowExecutionEventsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandOutput>;
6
10
  };
@@ -53,9 +53,77 @@ const getSession = async (data) => {
53
53
  throw error;
54
54
  }
55
55
  };
56
+ /**
57
+ * This is used to start the execution flow
58
+ * @param command
59
+ * @returns
60
+ */
61
+ const startFlowExecution = async (data) => {
62
+ try {
63
+ const command = new client_bedrock_agent_runtime_1.StartFlowExecutionCommand(data);
64
+ const response = await client.send(command);
65
+ return response;
66
+ }
67
+ catch (error) {
68
+ console.info(`error occured while start Execution flow`);
69
+ throw error;
70
+ }
71
+ };
72
+ /**
73
+ * This is used to get the execution flow
74
+ * @param command
75
+ * @returns
76
+ */
77
+ const getFlowExecution = async (data) => {
78
+ try {
79
+ const command = new client_bedrock_agent_runtime_1.GetFlowExecutionCommand(data);
80
+ const response = await client.send(command);
81
+ return response;
82
+ }
83
+ catch (error) {
84
+ console.info(`error occured while get Execution flow`);
85
+ throw error;
86
+ }
87
+ };
88
+ /**
89
+ * This is used to get the list of execution flow
90
+ * @param command
91
+ * @returns
92
+ */
93
+ const listFlowExecutionsCommand = async (data) => {
94
+ try {
95
+ const command = new client_bedrock_agent_runtime_1.ListFlowExecutionsCommand(data);
96
+ const response = await client.send(command);
97
+ return response;
98
+ }
99
+ catch (error) {
100
+ console.info(`error occured while get list of executions flow`);
101
+ throw error;
102
+ }
103
+ };
104
+ /**
105
+ * This is used to get the list of execution event flow
106
+ * @param command
107
+ * @returns
108
+ */
109
+ const listFlowExecutionEvents = async (data) => {
110
+ try {
111
+ const command = new client_bedrock_agent_runtime_1.ListFlowExecutionEventsCommand(data);
112
+ const response = await client.send(command);
113
+ return response;
114
+ }
115
+ catch (error) {
116
+ console.info(`error occured while get list of executions event flow`);
117
+ throw error;
118
+ }
119
+ };
56
120
  exports.AgentRuntime = {
57
121
  invokeAgent,
58
122
  invokeFlow,
59
- getSession
123
+ getSession,
124
+ startFlowExecution,
125
+ getFlowExecution,
126
+ listFlowExecutionsCommand,
127
+ listFlowExecutionEvents
60
128
  };
61
129
  //# sourceMappingURL=AWSBedrockAgentRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSBedrockAgentRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockAgentRuntime.ts"],"names":[],"mappings":";;;AAAA,wFAAqN;AAErN,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;AAElE,MAAM,MAAM,GAAG,IAAI,wDAAyB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,IAA6B,EAAE,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,iDAAkB,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,2CAA2C,CAAC,CAAC;QAC1D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAGD;;;;GAIG;AACH,MAAM,UAAU,GAAG,KAAK,EAAE,IAA4B,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,gDAAiB,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO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AC,CAAA;AAIY,QAAA,YAAY,GAAG;IAC1B,WAAW;IACX,UAAU;IACV,UAAU;IACV,kBAAkB;IAClB,gBAAgB;IAChB,yBAAyB;IACzB,uBAAuB;CACxB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { CreateGuardrailCommandInput, DeleteGuardrailCommandInput, UpdateGuardrailCommandInput } from "@aws-sdk/client-bedrock";
2
+ export declare const Guardrail: {
3
+ createGuardrail: (data: CreateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").CreateGuardrailCommandOutput>;
4
+ updateGuardrail: (data: UpdateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").UpdateGuardrailCommandOutput>;
5
+ deleteGuardrail: (data: DeleteGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").DeleteGuardrailCommandOutput>;
6
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Guardrail = void 0;
4
+ const client_bedrock_1 = require("@aws-sdk/client-bedrock");
5
+ const environment = (process.env.NODE_ENVIRONMENT || 'Test');
6
+ const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
7
+ const client = new client_bedrock_1.BedrockClient({ region: awsRegion });
8
+ /**
9
+ * This is used to create new agent
10
+ * @param data
11
+ * @returns
12
+ */
13
+ const createGuardrail = async (data) => {
14
+ try {
15
+ const command = new client_bedrock_1.CreateGuardrailCommand(data);
16
+ const response = await client.send(command);
17
+ return response;
18
+ }
19
+ catch (error) {
20
+ console.info(`error occured while create guard rail`);
21
+ throw error;
22
+ }
23
+ };
24
+ /**
25
+ * This is used to prepare update agent config
26
+ * @param data
27
+ * @returns
28
+ */
29
+ const updateGuardrail = async (data) => {
30
+ try {
31
+ const command = new client_bedrock_1.UpdateGuardrailCommand(data);
32
+ const response = await client.send(command);
33
+ return response;
34
+ }
35
+ catch (error) {
36
+ console.info(`error occured while update guard rail`);
37
+ throw error;
38
+ }
39
+ };
40
+ /**
41
+ * This is used to delete agent
42
+ * @param data
43
+ * @returns
44
+ */
45
+ const deleteGuardrail = async (data) => {
46
+ try {
47
+ const command = new client_bedrock_1.DeleteGuardrailCommand(data);
48
+ const response = await client.send(command);
49
+ return response;
50
+ }
51
+ catch (error) {
52
+ console.info(`error occured while delete guard rail`);
53
+ throw error;
54
+ }
55
+ };
56
+ exports.Guardrail = {
57
+ createGuardrail,
58
+ updateGuardrail,
59
+ deleteGuardrail
60
+ };
61
+ //# sourceMappingURL=AWSBedrockGuardrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AWSBedrockGuardrail.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockGuardrail.ts"],"names":[],"mappings":";;;AAAA,4DAAwN;AAExN,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,8BAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAExD;;;;GAIG;AACH,MAAM,eAAe,GAAG,KAAK,EAAE,IAAiC,EAAE,EAAE;IAClE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,uCAAsB,CAAC,IAAI,CAAC,CAAC;QACjD,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,uCAAuC,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,eAAe,GAAG,KAAK,EAAE,IAAiC,EAAE,EAAE;IAClE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,uCAAsB,CAAC,IAAI,CAAC,CAAC;QACjD,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,uCAAuC,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,eAAe,GAAG,KAAK,EAAE,IAAiC,EAAE,EAAE;IAClE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,uCAAsB,CAAC,IAAI,CAAC,CAAC;QACjD,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,uCAAuC,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAIY,QAAA,SAAS,GAAG;IACrB,eAAe;IACf,eAAe;IACf,eAAe;CAClB,CAAA"}
@@ -17,10 +17,19 @@ export declare const AWS: {
17
17
  deleteAgentAlias: (data: import("@aws-sdk/client-bedrock-agent").DeleteAgentAliasCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent").DeleteAgentAliasCommandOutput>;
18
18
  deleteAgentVersion: (data: import("@aws-sdk/client-bedrock-agent").DeleteAgentVersionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent").DeleteAgentVersionCommandOutput>;
19
19
  };
20
+ Guardrail: {
21
+ createGuardrail: (data: import("@aws-sdk/client-bedrock").CreateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").CreateGuardrailCommandOutput>;
22
+ updateGuardrail: (data: import("@aws-sdk/client-bedrock").UpdateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").UpdateGuardrailCommandOutput>;
23
+ deleteGuardrail: (data: import("@aws-sdk/client-bedrock").DeleteGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").DeleteGuardrailCommandOutput>;
24
+ };
20
25
  AgentRuntime: {
21
26
  invokeAgent: (data: import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandOutput>;
22
27
  invokeFlow: (data: import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandOutput>;
23
28
  getSession: (data: import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandOutput>;
29
+ startFlowExecution: (data: import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandOutput>;
30
+ getFlowExecution: (data: import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandOutput>;
31
+ listFlowExecutionsCommand: (data: import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandOutput>;
32
+ listFlowExecutionEvents: (data: import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandOutput>;
24
33
  };
25
34
  BedrockRuntime: {
26
35
  invokeModel: (data: import("@aws-sdk/client-bedrock-runtime").InvokeModelCommandInput) => Promise<import("@aws-sdk/client-bedrock-runtime").InvokeModelCommandOutput>;
@@ -4,8 +4,10 @@ import { BedrockRuntime } from "./services/AWSBedrockRuntime";
4
4
  import { Rekognition } from "./services/AWSRekognition";
5
5
  import { Textract } from "./services/AWSTextTract";
6
6
  import { Flow } from "./services/AWSBedrockFlow";
7
+ import { Guardrail } from "./services/AWSBedrockGuardrail";
7
8
  export const AWS = {
8
9
  Agent,
10
+ Guardrail,
9
11
  AgentRuntime,
10
12
  BedrockRuntime,
11
13
  Rekognition,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../aws/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGjD,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,KAAK;IACL,YAAY;IACZ,cAAc;IACd,WAAW;IACX,QAAQ;IACR,IAAI;CACP,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../aws/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAG3D,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,KAAK;IACL,SAAS;IACT,YAAY;IACZ,cAAc;IACd,WAAW;IACX,QAAQ;IACR,IAAI;CACP,CAAA"}
@@ -1,6 +1,10 @@
1
- import { GetSessionCommandInput, InvokeAgentCommandInput, InvokeFlowCommandInput } from "@aws-sdk/client-bedrock-agent-runtime";
1
+ import { GetFlowExecutionCommandInput, GetSessionCommandInput, InvokeAgentCommandInput, InvokeFlowCommandInput, ListFlowExecutionEventsCommandInput, ListFlowExecutionsCommandInput, StartFlowExecutionCommandInput } from "@aws-sdk/client-bedrock-agent-runtime";
2
2
  export declare const AgentRuntime: {
3
3
  invokeAgent: (data: InvokeAgentCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeAgentCommandOutput>;
4
4
  invokeFlow: (data: InvokeFlowCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").InvokeFlowCommandOutput>;
5
5
  getSession: (data: GetSessionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetSessionCommandOutput>;
6
+ startFlowExecution: (data: StartFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").StartFlowExecutionCommandOutput>;
7
+ getFlowExecution: (data: GetFlowExecutionCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").GetFlowExecutionCommandOutput>;
8
+ listFlowExecutionsCommand: (data: ListFlowExecutionsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionsCommandOutput>;
9
+ listFlowExecutionEvents: (data: ListFlowExecutionEventsCommandInput) => Promise<import("@aws-sdk/client-bedrock-agent-runtime").ListFlowExecutionEventsCommandOutput>;
6
10
  };
@@ -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 { BedrockAgentRuntimeClient, GetSessionCommand, InvokeAgentCommand, InvokeFlowCommand } from "@aws-sdk/client-bedrock-agent-runtime";
10
+ import { BedrockAgentRuntimeClient, GetFlowExecutionCommand, GetSessionCommand, InvokeAgentCommand, InvokeFlowCommand, ListFlowExecutionEventsCommand, ListFlowExecutionsCommand, StartFlowExecutionCommand } from "@aws-sdk/client-bedrock-agent-runtime";
11
11
  const environment = (process.env.NODE_ENVIRONMENT || 'Test');
12
12
  const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
13
13
  const client = new BedrockAgentRuntimeClient({ region: awsRegion });
@@ -59,9 +59,77 @@ const getSession = (data) => __awaiter(void 0, void 0, void 0, function* () {
59
59
  throw error;
60
60
  }
61
61
  });
62
+ /**
63
+ * This is used to start the execution flow
64
+ * @param command
65
+ * @returns
66
+ */
67
+ const startFlowExecution = (data) => __awaiter(void 0, void 0, void 0, function* () {
68
+ try {
69
+ const command = new StartFlowExecutionCommand(data);
70
+ const response = yield client.send(command);
71
+ return response;
72
+ }
73
+ catch (error) {
74
+ console.info(`error occured while start Execution flow`);
75
+ throw error;
76
+ }
77
+ });
78
+ /**
79
+ * This is used to get the execution flow
80
+ * @param command
81
+ * @returns
82
+ */
83
+ const getFlowExecution = (data) => __awaiter(void 0, void 0, void 0, function* () {
84
+ try {
85
+ const command = new GetFlowExecutionCommand(data);
86
+ const response = yield client.send(command);
87
+ return response;
88
+ }
89
+ catch (error) {
90
+ console.info(`error occured while get Execution flow`);
91
+ throw error;
92
+ }
93
+ });
94
+ /**
95
+ * This is used to get the list of execution flow
96
+ * @param command
97
+ * @returns
98
+ */
99
+ const listFlowExecutionsCommand = (data) => __awaiter(void 0, void 0, void 0, function* () {
100
+ try {
101
+ const command = new ListFlowExecutionsCommand(data);
102
+ const response = yield client.send(command);
103
+ return response;
104
+ }
105
+ catch (error) {
106
+ console.info(`error occured while get list of executions flow`);
107
+ throw error;
108
+ }
109
+ });
110
+ /**
111
+ * This is used to get the list of execution event flow
112
+ * @param command
113
+ * @returns
114
+ */
115
+ const listFlowExecutionEvents = (data) => __awaiter(void 0, void 0, void 0, function* () {
116
+ try {
117
+ const command = new ListFlowExecutionEventsCommand(data);
118
+ const response = yield client.send(command);
119
+ return response;
120
+ }
121
+ catch (error) {
122
+ console.info(`error occured while get list of executions event flow`);
123
+ throw error;
124
+ }
125
+ });
62
126
  export const AgentRuntime = {
63
127
  invokeAgent,
64
128
  invokeFlow,
65
- getSession
129
+ getSession,
130
+ startFlowExecution,
131
+ getFlowExecution,
132
+ listFlowExecutionsCommand,
133
+ listFlowExecutionEvents
66
134
  };
67
135
  //# sourceMappingURL=AWSBedrockAgentRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AWSBedrockAgentRuntime.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockAgentRuntime.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAA0B,kBAAkB,EAA2B,iBAAiB,EAA0B,MAAM,uCAAuC,CAAC;AAErN,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;AAElE,MAAM,MAAM,GAAG,IAAI,yBAAyB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAO,IAA6B,EAAE,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,2CAA2C,CAAC,CAAC;QAC1D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAGD;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAO,IAA4B,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAA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G,CAAO,IAAyC,EAAE,EAAE;IAClF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,8BAA8B,CAAC,IAAI,CAAC,CAAC;QACzD,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,uDAAuD,CAAC,CAAC;QACtE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAID,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,WAAW;IACX,UAAU;IACV,UAAU;IACV,kBAAkB;IAClB,gBAAgB;IAChB,yBAAyB;IACzB,uBAAuB;CACxB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { CreateGuardrailCommandInput, DeleteGuardrailCommandInput, UpdateGuardrailCommandInput } from "@aws-sdk/client-bedrock";
2
+ export declare const Guardrail: {
3
+ createGuardrail: (data: CreateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").CreateGuardrailCommandOutput>;
4
+ updateGuardrail: (data: UpdateGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").UpdateGuardrailCommandOutput>;
5
+ deleteGuardrail: (data: DeleteGuardrailCommandInput) => Promise<import("@aws-sdk/client-bedrock").DeleteGuardrailCommandOutput>;
6
+ };
@@ -0,0 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BedrockClient, CreateGuardrailCommand, DeleteGuardrailCommand, UpdateGuardrailCommand } from "@aws-sdk/client-bedrock";
11
+ const environment = (process.env.NODE_ENVIRONMENT || 'Test');
12
+ const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
13
+ const client = new BedrockClient({ region: awsRegion });
14
+ /**
15
+ * This is used to create new agent
16
+ * @param data
17
+ * @returns
18
+ */
19
+ const createGuardrail = (data) => __awaiter(void 0, void 0, void 0, function* () {
20
+ try {
21
+ const command = new CreateGuardrailCommand(data);
22
+ const response = yield client.send(command);
23
+ return response;
24
+ }
25
+ catch (error) {
26
+ console.info(`error occured while create guard rail`);
27
+ throw error;
28
+ }
29
+ });
30
+ /**
31
+ * This is used to prepare update agent config
32
+ * @param data
33
+ * @returns
34
+ */
35
+ const updateGuardrail = (data) => __awaiter(void 0, void 0, void 0, function* () {
36
+ try {
37
+ const command = new UpdateGuardrailCommand(data);
38
+ const response = yield client.send(command);
39
+ return response;
40
+ }
41
+ catch (error) {
42
+ console.info(`error occured while update guard rail`);
43
+ throw error;
44
+ }
45
+ });
46
+ /**
47
+ * This is used to delete agent
48
+ * @param data
49
+ * @returns
50
+ */
51
+ const deleteGuardrail = (data) => __awaiter(void 0, void 0, void 0, function* () {
52
+ try {
53
+ const command = new DeleteGuardrailCommand(data);
54
+ const response = yield client.send(command);
55
+ return response;
56
+ }
57
+ catch (error) {
58
+ console.info(`error occured while delete guard rail`);
59
+ throw error;
60
+ }
61
+ });
62
+ export const Guardrail = {
63
+ createGuardrail,
64
+ updateGuardrail,
65
+ deleteGuardrail
66
+ };
67
+ //# sourceMappingURL=AWSBedrockGuardrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AWSBedrockGuardrail.js","sourceRoot":"","sources":["../../../../aws/services/AWSBedrockGuardrail.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAA+B,sBAAsB,EAA+B,sBAAsB,EAAg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G,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAA;AAID,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,eAAe;IACf,eAAe;IACf,eAAe;CAClB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatbot-agentic",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -17,6 +17,7 @@
17
17
  "author": "Sumit Mahajan",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
+ "@aws-sdk/client-bedrock": "^3.1078.0",
20
21
  "@aws-sdk/client-bedrock-agent": "^3.936.0",
21
22
  "@aws-sdk/client-bedrock-agent-runtime": "^3.846.0",
22
23
  "@aws-sdk/client-bedrock-runtime": "^3.966.0",