chatbot-lex-design-builder 2.0.40 → 2.0.41
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type GetAgentAliasArn = (id: string) => Promise<string>;
|
|
2
|
-
type
|
|
3
|
-
export declare function exportToFlows(data: any, getAgentAliasArn: GetAgentAliasArn,
|
|
2
|
+
type GetModelId = (id: string) => Promise<string>;
|
|
3
|
+
export declare function exportToFlows(data: any, getAgentAliasArn: GetAgentAliasArn, getModelId: GetModelId): Promise<{
|
|
4
4
|
definition: {
|
|
5
5
|
connections: never[];
|
|
6
6
|
nodes: never[];
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.exportToFlows = exportToFlows;
|
|
13
13
|
const ts_pattern_1 = require("ts-pattern");
|
|
14
14
|
const _1 = require(".");
|
|
15
|
-
function exportToFlows(data, getAgentAliasArn,
|
|
15
|
+
function exportToFlows(data, getAgentAliasArn, getModelId) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const graph = data.graph;
|
|
18
18
|
const awsFlow = {
|
|
@@ -47,7 +47,7 @@ function exportToFlows(data, getAgentAliasArn, getModalId) {
|
|
|
47
47
|
// .with({ type: NodeType.s3RetrievalNode }, (node) => { buildS3RetrievalNode(node, graph, awsFlow) })
|
|
48
48
|
// .with({ type: NodeType.s3StorageNode }, (node) => { buildS3StorageNode(node, graph, awsFlow) })
|
|
49
49
|
.with({ type: _1.NodeType.promptNode }, (node) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
yield buildPromptNode(node, graph, awsFlow,
|
|
50
|
+
yield buildPromptNode(node, graph, awsFlow, getModelId);
|
|
51
51
|
}))
|
|
52
52
|
// .with({ type: NodeType.lexNode }, (node) => { buildLexNode(node, graph, awsFlow) })
|
|
53
53
|
// .with({ type: NodeType.inlineNode }, (node) => { buildInlineNode(node, graph, awsFlow) })
|
|
@@ -114,7 +114,7 @@ function buildAgentNode(node, graph, awsFlow, getAgentAliasArn) {
|
|
|
114
114
|
awsFlow.definition.nodes.push(details);
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function buildPromptNode(node, graph, awsFlow,
|
|
117
|
+
function buildPromptNode(node, graph, awsFlow, getModelId) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
var _a;
|
|
120
120
|
const details = {
|
|
@@ -132,7 +132,7 @@ function buildPromptNode(node, graph, awsFlow, getModalId) {
|
|
|
132
132
|
temperature: 1,
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
|
-
modelId: yield
|
|
135
|
+
modelId: yield getModelId(node.data.sourceConfiguration.type === "inline"
|
|
136
136
|
? node.data.sourceConfiguration.modelId
|
|
137
137
|
: ""),
|
|
138
138
|
templateConfiguration: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type GetAgentAliasArn = (id: string) => Promise<string>;
|
|
2
|
-
type
|
|
3
|
-
export declare function exportToFlows(data: any, getAgentAliasArn: GetAgentAliasArn,
|
|
2
|
+
type GetModelId = (id: string) => Promise<string>;
|
|
3
|
+
export declare function exportToFlows(data: any, getAgentAliasArn: GetAgentAliasArn, getModelId: GetModelId): Promise<{
|
|
4
4
|
definition: {
|
|
5
5
|
connections: never[];
|
|
6
6
|
nodes: never[];
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { match } from "ts-pattern";
|
|
11
11
|
import { NodeType, } from ".";
|
|
12
|
-
export function exportToFlows(data, getAgentAliasArn,
|
|
12
|
+
export function exportToFlows(data, getAgentAliasArn, getModelId) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
const graph = data.graph;
|
|
15
15
|
const awsFlow = {
|
|
@@ -44,7 +44,7 @@ export function exportToFlows(data, getAgentAliasArn, getModalId) {
|
|
|
44
44
|
// .with({ type: NodeType.s3RetrievalNode }, (node) => { buildS3RetrievalNode(node, graph, awsFlow) })
|
|
45
45
|
// .with({ type: NodeType.s3StorageNode }, (node) => { buildS3StorageNode(node, graph, awsFlow) })
|
|
46
46
|
.with({ type: NodeType.promptNode }, (node) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
yield buildPromptNode(node, graph, awsFlow,
|
|
47
|
+
yield buildPromptNode(node, graph, awsFlow, getModelId);
|
|
48
48
|
}))
|
|
49
49
|
// .with({ type: NodeType.lexNode }, (node) => { buildLexNode(node, graph, awsFlow) })
|
|
50
50
|
// .with({ type: NodeType.inlineNode }, (node) => { buildInlineNode(node, graph, awsFlow) })
|
|
@@ -111,7 +111,7 @@ function buildAgentNode(node, graph, awsFlow, getAgentAliasArn) {
|
|
|
111
111
|
awsFlow.definition.nodes.push(details);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function buildPromptNode(node, graph, awsFlow,
|
|
114
|
+
function buildPromptNode(node, graph, awsFlow, getModelId) {
|
|
115
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
116
|
var _a;
|
|
117
117
|
const details = {
|
|
@@ -129,7 +129,7 @@ function buildPromptNode(node, graph, awsFlow, getModalId) {
|
|
|
129
129
|
temperature: 1,
|
|
130
130
|
},
|
|
131
131
|
},
|
|
132
|
-
modelId: yield
|
|
132
|
+
modelId: yield getModelId(node.data.sourceConfiguration.type === "inline"
|
|
133
133
|
? node.data.sourceConfiguration.modelId
|
|
134
134
|
: ""),
|
|
135
135
|
templateConfiguration: {
|