@n8n/ai-workflow-builder 0.2.0
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/LICENSE.md +88 -0
- package/LICENSE_EE.md +27 -0
- package/dist/ai-workflow-builder.service.d.ts +25 -0
- package/dist/ai-workflow-builder.service.js +308 -0
- package/dist/ai-workflow-builder.service.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/chains/connection-composer.d.ts +10 -0
- package/dist/chains/connection-composer.js +135 -0
- package/dist/chains/connection-composer.js.map +1 -0
- package/dist/chains/node-selector.d.ts +8 -0
- package/dist/chains/node-selector.js +90 -0
- package/dist/chains/node-selector.js.map +1 -0
- package/dist/chains/nodes-composer.d.ts +8 -0
- package/dist/chains/nodes-composer.js +451 -0
- package/dist/chains/nodes-composer.js.map +1 -0
- package/dist/chains/planner.d.ts +4 -0
- package/dist/chains/planner.js +87 -0
- package/dist/chains/planner.js.map +1 -0
- package/dist/chains/validator.d.ts +2 -0
- package/dist/chains/validator.js +67 -0
- package/dist/chains/validator.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +4 -0
- package/dist/interfaces.js +3 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/llm-config.d.ts +11 -0
- package/dist/llm-config.js +36 -0
- package/dist/llm-config.js.map +1 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-state.d.ts +11 -0
- package/dist/workflow-state.js +18 -0
- package/dist/workflow-state.js.map +1 -0
- package/package.json +55 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
Portions of this software are licensed as follows:
|
|
4
|
+
|
|
5
|
+
- Content of branches other than the main branch (i.e. "master") are not licensed.
|
|
6
|
+
- Source code files that contain ".ee." in their filename or ".ee" in their dirname are NOT licensed under
|
|
7
|
+
the Sustainable Use License.
|
|
8
|
+
To use source code files that contain ".ee." in their filename or ".ee" in their dirname you must hold a
|
|
9
|
+
valid n8n Enterprise License specifically allowing you access to such source code files and as defined
|
|
10
|
+
in "LICENSE_EE.md".
|
|
11
|
+
- All third party components incorporated into the n8n Software are licensed under the original license
|
|
12
|
+
provided by the owner of the applicable component.
|
|
13
|
+
- Content outside of the above mentioned files or restrictions is available under the "Sustainable Use
|
|
14
|
+
License" as defined below.
|
|
15
|
+
|
|
16
|
+
## Sustainable Use License
|
|
17
|
+
|
|
18
|
+
Version 1.0
|
|
19
|
+
|
|
20
|
+
### Acceptance
|
|
21
|
+
|
|
22
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
23
|
+
|
|
24
|
+
### Copyright License
|
|
25
|
+
|
|
26
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license
|
|
27
|
+
to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject
|
|
28
|
+
to the limitations below.
|
|
29
|
+
|
|
30
|
+
### Limitations
|
|
31
|
+
|
|
32
|
+
You may use or modify the software only for your own internal business purposes or for non-commercial or
|
|
33
|
+
personal use. You may distribute the software or provide it to others only if you do so free of charge for
|
|
34
|
+
non-commercial purposes. You may not alter, remove, or obscure any licensing, copyright, or other notices of
|
|
35
|
+
the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
|
36
|
+
|
|
37
|
+
### Patents
|
|
38
|
+
|
|
39
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to
|
|
40
|
+
license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case
|
|
41
|
+
subject to the limitations and conditions in this license. This license does not cover any patent claims that
|
|
42
|
+
you cause to be infringed by modifications or additions to the software. If you or your company make any
|
|
43
|
+
written claim that the software infringes or contributes to infringement of any patent, your patent license
|
|
44
|
+
for the software granted under these terms ends immediately. If your company makes such a claim, your patent
|
|
45
|
+
license ends immediately for work on behalf of your company.
|
|
46
|
+
|
|
47
|
+
### Notices
|
|
48
|
+
|
|
49
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these
|
|
50
|
+
terms. If you modify the software, you must include in any modified copies of the software a prominent notice
|
|
51
|
+
stating that you have modified the software.
|
|
52
|
+
|
|
53
|
+
### No Other Rights
|
|
54
|
+
|
|
55
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
56
|
+
|
|
57
|
+
### Termination
|
|
58
|
+
|
|
59
|
+
If you use the software in violation of these terms, such use is not licensed, and your license will
|
|
60
|
+
automatically terminate. If the licensor provides you with a notice of your violation, and you cease all
|
|
61
|
+
violation of this license no later than 30 days after you receive that notice, your license will be reinstated
|
|
62
|
+
retroactively. However, if you violate these terms after such reinstatement, any additional violation of these
|
|
63
|
+
terms will cause your license to terminate automatically and permanently.
|
|
64
|
+
|
|
65
|
+
### No Liability
|
|
66
|
+
|
|
67
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will
|
|
68
|
+
not be liable to you for any damages arising out of these terms or the use or nature of the software, under
|
|
69
|
+
any kind of legal claim.
|
|
70
|
+
|
|
71
|
+
### Definitions
|
|
72
|
+
|
|
73
|
+
The “licensor” is the entity offering these terms.
|
|
74
|
+
|
|
75
|
+
The “software” is the software the licensor makes available under these terms, including any portion of it.
|
|
76
|
+
|
|
77
|
+
“You” refers to the individual or entity agreeing to these terms.
|
|
78
|
+
|
|
79
|
+
“Your company” is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
|
|
80
|
+
all organizations that have control over, are under the control of, or are under common control with that
|
|
81
|
+
organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
|
|
82
|
+
management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
83
|
+
|
|
84
|
+
“Your license” is the license granted to you for the software under these terms.
|
|
85
|
+
|
|
86
|
+
“Use” means anything you do with the software requiring your license.
|
|
87
|
+
|
|
88
|
+
“Trademark” means trademarks, service marks, and similar rights.
|
package/LICENSE_EE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# The n8n Enterprise License (the “Enterprise License”)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present n8n GmbH.
|
|
4
|
+
|
|
5
|
+
With regard to the n8n Software:
|
|
6
|
+
|
|
7
|
+
This software and associated documentation files (the "Software") may only be used in production, if
|
|
8
|
+
you (and any entity that you represent) hold a valid n8n Enterprise license corresponding to your
|
|
9
|
+
usage. Subject to the foregoing sentence, you are free to modify this Software and publish patches
|
|
10
|
+
to the Software. You agree that n8n and/or its licensors (as applicable) retain all right, title and
|
|
11
|
+
interest in and to all such modifications and/or patches, and all such modifications and/or patches
|
|
12
|
+
may only be used, copied, modified, displayed, distributed, or otherwise exploited with a valid n8n
|
|
13
|
+
Enterprise license for the corresponding usage. Notwithstanding the foregoing, you may copy and
|
|
14
|
+
modify the Software for development and testing purposes, without requiring a subscription. You
|
|
15
|
+
agree that n8n and/or its licensors (as applicable) retain all right, title and interest in and to
|
|
16
|
+
all such modifications. You are not granted any other rights beyond what is expressly stated herein.
|
|
17
|
+
Subject to the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense, and/or
|
|
18
|
+
sell the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
21
|
+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
23
|
+
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
24
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
|
+
|
|
26
|
+
For all third party components incorporated into the n8n Software, those components are licensed
|
|
27
|
+
under the original license provided by the owner of the applicable component.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GlobalConfig } from '@n8n/config';
|
|
2
|
+
import { INodeTypes } from 'n8n-workflow';
|
|
3
|
+
import type { IUser } from 'n8n-workflow';
|
|
4
|
+
import { ILicenseService } from './interfaces';
|
|
5
|
+
import type { MessageResponse } from './types';
|
|
6
|
+
export declare class AiWorkflowBuilderService {
|
|
7
|
+
private readonly licenseService;
|
|
8
|
+
private readonly nodeTypes;
|
|
9
|
+
private readonly globalConfig;
|
|
10
|
+
private readonly n8nVersion;
|
|
11
|
+
private parsedNodeTypes;
|
|
12
|
+
private llmSimpleTask;
|
|
13
|
+
private llmComplexTask;
|
|
14
|
+
private client;
|
|
15
|
+
constructor(licenseService: ILicenseService, nodeTypes: INodeTypes, globalConfig: GlobalConfig, n8nVersion: string);
|
|
16
|
+
private setupModels;
|
|
17
|
+
private getNodeTypes;
|
|
18
|
+
private isWorkflowEvent;
|
|
19
|
+
private getAgent;
|
|
20
|
+
chat(payload: {
|
|
21
|
+
question: string;
|
|
22
|
+
}, user: IUser): AsyncGenerator<{
|
|
23
|
+
messages: MessageResponse[];
|
|
24
|
+
}, void, unknown>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AiWorkflowBuilderService = void 0;
|
|
13
|
+
const dispatch_1 = require("@langchain/core/callbacks/dispatch");
|
|
14
|
+
const langgraph_1 = require("@langchain/langgraph");
|
|
15
|
+
const config_1 = require("@n8n/config");
|
|
16
|
+
const di_1 = require("@n8n/di");
|
|
17
|
+
const ai_assistant_sdk_1 = require("@n8n_io/ai-assistant-sdk");
|
|
18
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
19
|
+
const connection_composer_1 = require("./chains/connection-composer");
|
|
20
|
+
const node_selector_1 = require("./chains/node-selector");
|
|
21
|
+
const nodes_composer_1 = require("./chains/nodes-composer");
|
|
22
|
+
const planner_1 = require("./chains/planner");
|
|
23
|
+
const validator_1 = require("./chains/validator");
|
|
24
|
+
const llm_config_1 = require("./llm-config");
|
|
25
|
+
const workflow_state_1 = require("./workflow-state");
|
|
26
|
+
let AiWorkflowBuilderService = class AiWorkflowBuilderService {
|
|
27
|
+
constructor(licenseService, nodeTypes, globalConfig, n8nVersion) {
|
|
28
|
+
this.licenseService = licenseService;
|
|
29
|
+
this.nodeTypes = nodeTypes;
|
|
30
|
+
this.globalConfig = globalConfig;
|
|
31
|
+
this.n8nVersion = n8nVersion;
|
|
32
|
+
this.parsedNodeTypes = [];
|
|
33
|
+
this.parsedNodeTypes = this.getNodeTypes();
|
|
34
|
+
}
|
|
35
|
+
async setupModels(user) {
|
|
36
|
+
if (this.llmSimpleTask && this.llmComplexTask) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const baseUrl = this.globalConfig.aiAssistant.baseUrl;
|
|
40
|
+
if (baseUrl) {
|
|
41
|
+
if (!this.client) {
|
|
42
|
+
const licenseCert = await this.licenseService.loadCertStr();
|
|
43
|
+
const consumerId = this.licenseService.getConsumerId();
|
|
44
|
+
this.client = new ai_assistant_sdk_1.AiAssistantClient({
|
|
45
|
+
licenseCert,
|
|
46
|
+
consumerId,
|
|
47
|
+
baseUrl,
|
|
48
|
+
n8nVersion: this.n8nVersion,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
(0, n8n_workflow_1.assert)(this.client, 'Client not setup');
|
|
52
|
+
const authHeaders = await this.client.generateApiProxyCredentials(user);
|
|
53
|
+
this.llmSimpleTask = (0, llm_config_1.gpt41mini)({
|
|
54
|
+
baseUrl: baseUrl + '/v1/api-proxy/openai',
|
|
55
|
+
apiKey: '-',
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: authHeaders.apiKey,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
this.llmComplexTask = (0, llm_config_1.anthropicClaude37Sonnet)({
|
|
61
|
+
baseUrl: baseUrl + '/v1/api-proxy/anthropic',
|
|
62
|
+
apiKey: '-',
|
|
63
|
+
headers: {
|
|
64
|
+
Authorization: authHeaders.apiKey,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.llmSimpleTask = (0, llm_config_1.gpt41mini)({
|
|
70
|
+
apiKey: process.env.N8N_AI_OPENAI_API_KEY ?? '',
|
|
71
|
+
});
|
|
72
|
+
this.llmComplexTask = (0, llm_config_1.anthropicClaude37Sonnet)({
|
|
73
|
+
apiKey: process.env.N8N_AI_ANTHROPIC_KEY ?? '',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
getNodeTypes() {
|
|
77
|
+
const nodeTypesKeys = Object.keys(this.nodeTypes.getKnownTypes());
|
|
78
|
+
const nodeTypes = nodeTypesKeys
|
|
79
|
+
.map((nodeName) => {
|
|
80
|
+
return { ...this.nodeTypes.getByNameAndVersion(nodeName).description, name: nodeName };
|
|
81
|
+
})
|
|
82
|
+
.filter((nodeType) => nodeType.hidden !== true);
|
|
83
|
+
return nodeTypes;
|
|
84
|
+
}
|
|
85
|
+
isWorkflowEvent(eventName) {
|
|
86
|
+
return [
|
|
87
|
+
'prompt_validation',
|
|
88
|
+
'generated_steps',
|
|
89
|
+
'generated_nodes',
|
|
90
|
+
'composed_nodes',
|
|
91
|
+
'composed_connections',
|
|
92
|
+
'generated_workflow_json',
|
|
93
|
+
].includes(eventName);
|
|
94
|
+
}
|
|
95
|
+
getAgent() {
|
|
96
|
+
const validatorChainNode = async (state, config) => {
|
|
97
|
+
(0, n8n_workflow_1.assert)(this.llmSimpleTask, 'LLM not setup');
|
|
98
|
+
const isWorkflowPrompt = await (0, validator_1.validatorChain)(this.llmSimpleTask).invoke({
|
|
99
|
+
prompt: state.prompt,
|
|
100
|
+
}, config);
|
|
101
|
+
if (!isWorkflowPrompt) {
|
|
102
|
+
await (0, dispatch_1.dispatchCustomEvent)('prompt_validation', {
|
|
103
|
+
role: 'assistant',
|
|
104
|
+
type: 'prompt-validation',
|
|
105
|
+
isWorkflowPrompt,
|
|
106
|
+
id: Date.now().toString(),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
isWorkflowPrompt,
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const plannerChainNode = async (state, config) => {
|
|
114
|
+
(0, n8n_workflow_1.assert)(this.llmComplexTask, 'LLM not setup');
|
|
115
|
+
const steps = await (0, planner_1.plannerChain)(this.llmComplexTask).invoke({
|
|
116
|
+
prompt: state.prompt,
|
|
117
|
+
}, config);
|
|
118
|
+
await (0, dispatch_1.dispatchCustomEvent)('generated_steps', {
|
|
119
|
+
role: 'assistant',
|
|
120
|
+
type: 'workflow-step',
|
|
121
|
+
steps,
|
|
122
|
+
id: Date.now().toString(),
|
|
123
|
+
read: false,
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
steps,
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const nodeSelectionChainNode = async (state, config) => {
|
|
130
|
+
(0, n8n_workflow_1.assert)(this.llmSimpleTask, 'LLM not setup');
|
|
131
|
+
const getNodeMessage = (node) => {
|
|
132
|
+
return `
|
|
133
|
+
<node_name>${node.name}</node_name>
|
|
134
|
+
<node_description>${node.description}</node_description>
|
|
135
|
+
`;
|
|
136
|
+
};
|
|
137
|
+
const allowedNodes = this.parsedNodeTypes.map(getNodeMessage).join('');
|
|
138
|
+
const result = await (0, node_selector_1.nodesSelectionChain)(this.llmSimpleTask).invoke({
|
|
139
|
+
allowedNodes,
|
|
140
|
+
prompt: state.prompt,
|
|
141
|
+
steps: state.steps.join('\n'),
|
|
142
|
+
}, config);
|
|
143
|
+
const nodes = [...new Set(result.map((r) => r.node))];
|
|
144
|
+
await (0, dispatch_1.dispatchCustomEvent)('generated_nodes', {
|
|
145
|
+
role: 'assistant',
|
|
146
|
+
type: 'workflow-node',
|
|
147
|
+
nodes,
|
|
148
|
+
id: Date.now().toString(),
|
|
149
|
+
read: false,
|
|
150
|
+
});
|
|
151
|
+
return {
|
|
152
|
+
nodes,
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
const nodesComposerChainNode = async (state, config) => {
|
|
156
|
+
(0, n8n_workflow_1.assert)(this.llmComplexTask, 'LLM not setup');
|
|
157
|
+
const getLatestVersion = (nodeType) => {
|
|
158
|
+
const node = this.parsedNodeTypes.find((n) => n.name === nodeType);
|
|
159
|
+
if (!node) {
|
|
160
|
+
throw new n8n_workflow_1.OperationalError(`Node type not found: ${nodeType}`);
|
|
161
|
+
}
|
|
162
|
+
if (node.defaultVersion) {
|
|
163
|
+
return node.defaultVersion;
|
|
164
|
+
}
|
|
165
|
+
return typeof node.version === 'number'
|
|
166
|
+
? node.version
|
|
167
|
+
: node.version[node.version.length - 1];
|
|
168
|
+
};
|
|
169
|
+
const getNodeMessage = (nodeName) => {
|
|
170
|
+
const node = this.parsedNodeTypes.find((n) => n.name === nodeName);
|
|
171
|
+
if (!node) {
|
|
172
|
+
throw new n8n_workflow_1.OperationalError(`Node type not found: ${nodeName}`);
|
|
173
|
+
}
|
|
174
|
+
return `
|
|
175
|
+
<node_name>
|
|
176
|
+
${node.name}
|
|
177
|
+
</node_name>
|
|
178
|
+
<node_description>
|
|
179
|
+
${node.description}
|
|
180
|
+
</node_description>
|
|
181
|
+
<node_parameters>
|
|
182
|
+
${JSON.stringify(node.properties)}
|
|
183
|
+
</node_parameters>
|
|
184
|
+
`;
|
|
185
|
+
};
|
|
186
|
+
const result = await (0, nodes_composer_1.nodesComposerChain)(this.llmComplexTask).invoke({
|
|
187
|
+
user_workflow_prompt: state.prompt,
|
|
188
|
+
nodes: state.nodes.map(getNodeMessage).join('\n\n'),
|
|
189
|
+
}, config);
|
|
190
|
+
const composedNodes = result.map((node, index) => {
|
|
191
|
+
const version = getLatestVersion(node.type);
|
|
192
|
+
return {
|
|
193
|
+
...node,
|
|
194
|
+
position: [index * 150, 0],
|
|
195
|
+
typeVersion: version,
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
await (0, dispatch_1.dispatchCustomEvent)('composed_nodes', {
|
|
199
|
+
role: 'assistant',
|
|
200
|
+
type: 'workflow-composed',
|
|
201
|
+
nodes: composedNodes,
|
|
202
|
+
id: Date.now().toString(),
|
|
203
|
+
read: false,
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
workflowJSON: {
|
|
207
|
+
nodes: composedNodes,
|
|
208
|
+
connections: {},
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
const connectionComposerChainNode = async (state, config) => {
|
|
213
|
+
(0, n8n_workflow_1.assert)(this.llmComplexTask, 'LLM not setup');
|
|
214
|
+
const getNodeMessage = (node) => {
|
|
215
|
+
return `
|
|
216
|
+
<node>
|
|
217
|
+
${JSON.stringify(node)}
|
|
218
|
+
</node>
|
|
219
|
+
`;
|
|
220
|
+
};
|
|
221
|
+
const connections = await (0, connection_composer_1.connectionComposerChain)(this.llmComplexTask).invoke({
|
|
222
|
+
workflowJSON: state.workflowJSON.nodes.map(getNodeMessage).join('\n\n'),
|
|
223
|
+
}, config);
|
|
224
|
+
const workflowJSON = {
|
|
225
|
+
...state.workflowJSON,
|
|
226
|
+
connections,
|
|
227
|
+
};
|
|
228
|
+
await (0, dispatch_1.dispatchCustomEvent)('composed_connections', {
|
|
229
|
+
role: 'assistant',
|
|
230
|
+
type: 'workflow-connections',
|
|
231
|
+
workflowJSON,
|
|
232
|
+
id: Date.now().toString(),
|
|
233
|
+
read: false,
|
|
234
|
+
});
|
|
235
|
+
return {
|
|
236
|
+
workflowJSON,
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
async function generateWorkflowJSON(state) {
|
|
240
|
+
await (0, dispatch_1.dispatchCustomEvent)('generated_workflow_json', {
|
|
241
|
+
role: 'assistant',
|
|
242
|
+
type: 'workflow-generated',
|
|
243
|
+
codeSnippet: JSON.stringify(state.workflowJSON, null, 4),
|
|
244
|
+
});
|
|
245
|
+
return { workflowJSON: JSON.stringify(state.workflowJSON, null, 2) };
|
|
246
|
+
}
|
|
247
|
+
const workflowGraph = new langgraph_1.StateGraph(workflow_state_1.WorkflowState)
|
|
248
|
+
.addNode('validator', validatorChainNode)
|
|
249
|
+
.addNode('planner', plannerChainNode)
|
|
250
|
+
.addNode('node_selector', nodeSelectionChainNode)
|
|
251
|
+
.addNode('nodes_composer', nodesComposerChainNode)
|
|
252
|
+
.addNode('connection_composer', connectionComposerChainNode)
|
|
253
|
+
.addNode('finalize', generateWorkflowJSON);
|
|
254
|
+
workflowGraph.addEdge(langgraph_1.START, 'validator');
|
|
255
|
+
workflowGraph.addConditionalEdges('validator', (state) => {
|
|
256
|
+
return state.isWorkflowPrompt ? 'planner' : langgraph_1.END;
|
|
257
|
+
});
|
|
258
|
+
workflowGraph.addEdge('planner', 'node_selector');
|
|
259
|
+
workflowGraph.addEdge('node_selector', 'nodes_composer');
|
|
260
|
+
workflowGraph.addEdge('nodes_composer', 'connection_composer');
|
|
261
|
+
workflowGraph.addEdge('connection_composer', 'finalize');
|
|
262
|
+
workflowGraph.addEdge('finalize', langgraph_1.END);
|
|
263
|
+
return workflowGraph;
|
|
264
|
+
}
|
|
265
|
+
async *chat(payload, user) {
|
|
266
|
+
if (!this.llmComplexTask || !this.llmSimpleTask) {
|
|
267
|
+
await this.setupModels(user);
|
|
268
|
+
}
|
|
269
|
+
const agent = this.getAgent().compile();
|
|
270
|
+
const initialState = {
|
|
271
|
+
messages: [],
|
|
272
|
+
prompt: payload.question,
|
|
273
|
+
steps: [],
|
|
274
|
+
nodes: [],
|
|
275
|
+
workflowJSON: { nodes: [], connections: {} },
|
|
276
|
+
isWorkflowPrompt: false,
|
|
277
|
+
next: 'PLAN',
|
|
278
|
+
};
|
|
279
|
+
const stream = agent.streamEvents(initialState, {
|
|
280
|
+
streamMode: 'custom',
|
|
281
|
+
recursionLimit: 10,
|
|
282
|
+
version: 'v2',
|
|
283
|
+
});
|
|
284
|
+
for await (const chunk of stream) {
|
|
285
|
+
let messageChunk;
|
|
286
|
+
if (chunk.event === 'on_custom_event') {
|
|
287
|
+
if (this.isWorkflowEvent(chunk.name)) {
|
|
288
|
+
messageChunk = chunk.data;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
messageChunk = {
|
|
292
|
+
role: 'assistant',
|
|
293
|
+
type: 'intermediate-step',
|
|
294
|
+
text: chunk.data,
|
|
295
|
+
step: chunk.name,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
yield { messages: [messageChunk] };
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
exports.AiWorkflowBuilderService = AiWorkflowBuilderService;
|
|
304
|
+
exports.AiWorkflowBuilderService = AiWorkflowBuilderService = __decorate([
|
|
305
|
+
(0, di_1.Service)(),
|
|
306
|
+
__metadata("design:paramtypes", [Object, Object, config_1.GlobalConfig, String])
|
|
307
|
+
], AiWorkflowBuilderService);
|
|
308
|
+
//# sourceMappingURL=ai-workflow-builder.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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