@atomoz/workflows-nodes 0.1.5 → 0.1.7
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/index.cjs +94 -52
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +94 -52
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -678,7 +678,13 @@ var IaAgentNode = {
|
|
|
678
678
|
label: "System Message",
|
|
679
679
|
type: "textarea",
|
|
680
680
|
required: true,
|
|
681
|
-
placeholder: "You are a web researcher..."
|
|
681
|
+
placeholder: "You are a web researcher...",
|
|
682
|
+
handle: {
|
|
683
|
+
type: "input",
|
|
684
|
+
label: "System Message",
|
|
685
|
+
name: "systemMessage",
|
|
686
|
+
fieldType: "string"
|
|
687
|
+
}
|
|
682
688
|
},
|
|
683
689
|
{
|
|
684
690
|
id: "message",
|
|
@@ -696,41 +702,44 @@ var IaAgentNode = {
|
|
|
696
702
|
{
|
|
697
703
|
id: "model",
|
|
698
704
|
label: "Model",
|
|
699
|
-
type: "
|
|
705
|
+
type: "model",
|
|
700
706
|
typeable: false,
|
|
701
707
|
required: true,
|
|
702
708
|
handle: {
|
|
703
709
|
type: "input",
|
|
704
710
|
label: "Model",
|
|
705
711
|
name: "model",
|
|
706
|
-
fieldType: "
|
|
712
|
+
fieldType: "model",
|
|
713
|
+
acceptTypes: ["model"],
|
|
714
|
+
maxConnections: 1
|
|
707
715
|
}
|
|
708
716
|
},
|
|
709
717
|
{
|
|
710
718
|
id: "tools",
|
|
711
719
|
label: "Tools",
|
|
712
|
-
type: "
|
|
720
|
+
type: "tool",
|
|
713
721
|
required: false,
|
|
714
722
|
typeable: false,
|
|
715
723
|
handle: {
|
|
716
724
|
type: "input",
|
|
717
725
|
label: "Tools",
|
|
718
726
|
name: "tools",
|
|
719
|
-
fieldType: "
|
|
727
|
+
fieldType: "tool",
|
|
728
|
+
acceptTypes: ["tool"]
|
|
720
729
|
}
|
|
721
730
|
},
|
|
722
731
|
{
|
|
723
732
|
id: "agent",
|
|
724
733
|
// O output agora é o próprio agente
|
|
725
734
|
label: "Agent",
|
|
726
|
-
type: "
|
|
735
|
+
type: "agent",
|
|
727
736
|
required: true,
|
|
728
737
|
typeable: false,
|
|
729
738
|
handle: {
|
|
730
739
|
type: "output",
|
|
731
740
|
label: "Agent",
|
|
732
741
|
name: "agent",
|
|
733
|
-
fieldType: "
|
|
742
|
+
fieldType: "agent"
|
|
734
743
|
}
|
|
735
744
|
},
|
|
736
745
|
{
|
|
@@ -818,7 +827,7 @@ var AiSupervisorNodeSchema = import_zod6.z.object({
|
|
|
818
827
|
systemMessage: import_zod6.z.string().optional().describe("Custom system message for the supervisor")
|
|
819
828
|
});
|
|
820
829
|
var AiSupervisorNode = {
|
|
821
|
-
label: "
|
|
830
|
+
label: "AI Supervisor",
|
|
822
831
|
type: "AiSupervisorNode",
|
|
823
832
|
category: "step",
|
|
824
833
|
description: "Coordinates multiple agents to perform tasks manually",
|
|
@@ -836,22 +845,47 @@ var AiSupervisorNode = {
|
|
|
836
845
|
required: true,
|
|
837
846
|
handle: { type: "input", label: "Message", name: "message", fieldType: "string" }
|
|
838
847
|
},
|
|
839
|
-
{
|
|
848
|
+
{
|
|
849
|
+
id: "systemMessage",
|
|
850
|
+
label: "System Message",
|
|
851
|
+
type: "textarea",
|
|
852
|
+
required: false,
|
|
853
|
+
placeholder: "You are a supervisor... (use {members} to list agents)",
|
|
854
|
+
handle: {
|
|
855
|
+
type: "input",
|
|
856
|
+
label: "System Message",
|
|
857
|
+
name: "systemMessage",
|
|
858
|
+
fieldType: "string"
|
|
859
|
+
}
|
|
860
|
+
},
|
|
840
861
|
{
|
|
841
862
|
id: "model",
|
|
842
863
|
label: "Model",
|
|
843
|
-
type: "
|
|
864
|
+
type: "model",
|
|
844
865
|
typeable: false,
|
|
845
866
|
required: true,
|
|
846
|
-
handle: {
|
|
867
|
+
handle: {
|
|
868
|
+
type: "input",
|
|
869
|
+
label: "Model",
|
|
870
|
+
name: "model",
|
|
871
|
+
fieldType: "model",
|
|
872
|
+
acceptTypes: ["model"],
|
|
873
|
+
maxConnections: 1
|
|
874
|
+
}
|
|
847
875
|
},
|
|
848
876
|
{
|
|
849
877
|
id: "agents",
|
|
850
878
|
label: "Agents",
|
|
851
|
-
type: "
|
|
879
|
+
type: "agent",
|
|
852
880
|
required: true,
|
|
853
881
|
typeable: false,
|
|
854
|
-
handle: {
|
|
882
|
+
handle: {
|
|
883
|
+
type: "input",
|
|
884
|
+
label: "Agents",
|
|
885
|
+
name: "agents",
|
|
886
|
+
fieldType: "agent",
|
|
887
|
+
acceptTypes: ["agent"]
|
|
888
|
+
}
|
|
855
889
|
},
|
|
856
890
|
{
|
|
857
891
|
id: "output",
|
|
@@ -1097,14 +1131,14 @@ var AiToolNode = {
|
|
|
1097
1131
|
{
|
|
1098
1132
|
id: "tool",
|
|
1099
1133
|
label: "Tool",
|
|
1100
|
-
type: "
|
|
1134
|
+
type: "tool",
|
|
1101
1135
|
required: true,
|
|
1102
1136
|
typeable: false,
|
|
1103
1137
|
handle: {
|
|
1104
1138
|
type: "output",
|
|
1105
1139
|
label: "Tool",
|
|
1106
1140
|
name: "tool",
|
|
1107
|
-
fieldType: "
|
|
1141
|
+
fieldType: "tool",
|
|
1108
1142
|
required: true
|
|
1109
1143
|
}
|
|
1110
1144
|
}
|
|
@@ -1160,10 +1194,10 @@ var AiToolNodeFunction = async (fieldValues) => {
|
|
|
1160
1194
|
|
|
1161
1195
|
// src/nodes/ia/model/data.ts
|
|
1162
1196
|
var IaModelNode = {
|
|
1163
|
-
label: "
|
|
1197
|
+
label: "AI Model",
|
|
1164
1198
|
type: "IaModelNode",
|
|
1165
1199
|
category: "step",
|
|
1166
|
-
description: "
|
|
1200
|
+
description: "AI Model",
|
|
1167
1201
|
icon: "\u{1F916}",
|
|
1168
1202
|
tags: {
|
|
1169
1203
|
execution: "async",
|
|
@@ -1172,7 +1206,7 @@ var IaModelNode = {
|
|
|
1172
1206
|
fields: [
|
|
1173
1207
|
{
|
|
1174
1208
|
id: "model",
|
|
1175
|
-
label: "
|
|
1209
|
+
label: "Model",
|
|
1176
1210
|
type: "select",
|
|
1177
1211
|
required: true,
|
|
1178
1212
|
defaultValue: "gemini-2.5-pro",
|
|
@@ -1191,16 +1225,16 @@ var IaModelNode = {
|
|
|
1191
1225
|
required: true
|
|
1192
1226
|
},
|
|
1193
1227
|
{
|
|
1194
|
-
id: "
|
|
1195
|
-
label: "
|
|
1196
|
-
type: "
|
|
1228
|
+
id: "model",
|
|
1229
|
+
label: "Model",
|
|
1230
|
+
type: "model",
|
|
1197
1231
|
required: true,
|
|
1198
1232
|
typeable: false,
|
|
1199
1233
|
handle: {
|
|
1200
1234
|
type: "output",
|
|
1201
|
-
label: "
|
|
1202
|
-
name: "
|
|
1203
|
-
fieldType: "
|
|
1235
|
+
label: "Model",
|
|
1236
|
+
name: "model",
|
|
1237
|
+
fieldType: "model",
|
|
1204
1238
|
required: true
|
|
1205
1239
|
}
|
|
1206
1240
|
}
|
|
@@ -1224,32 +1258,32 @@ var IaModelNodeFunction = async (inputs) => {
|
|
|
1224
1258
|
streaming: stream
|
|
1225
1259
|
});
|
|
1226
1260
|
return {
|
|
1227
|
-
llm
|
|
1261
|
+
model: llm
|
|
1228
1262
|
};
|
|
1229
1263
|
};
|
|
1230
1264
|
|
|
1231
1265
|
// src/nodes/ia/message/message.ts
|
|
1232
1266
|
var import_zod8 = require("zod");
|
|
1233
1267
|
var IaMessageNodeSchema = import_zod8.z.object({
|
|
1234
|
-
|
|
1268
|
+
model: import_zod8.z.any().describe("LLM model to use"),
|
|
1235
1269
|
systemMessage: import_zod8.z.string().optional().describe("System message for context"),
|
|
1236
|
-
|
|
1270
|
+
message: import_zod8.z.string().describe("User message to send to the LLM")
|
|
1237
1271
|
});
|
|
1238
1272
|
var IaMessageNodeFunction = async (fieldValues) => {
|
|
1239
|
-
const {
|
|
1240
|
-
if (!
|
|
1241
|
-
throw new Error("
|
|
1273
|
+
const { model, systemMessage, message } = fieldValues;
|
|
1274
|
+
if (!model) {
|
|
1275
|
+
throw new Error("Model is required");
|
|
1242
1276
|
}
|
|
1243
|
-
if (!
|
|
1244
|
-
throw new Error("
|
|
1277
|
+
if (!message) {
|
|
1278
|
+
throw new Error("Message is required");
|
|
1245
1279
|
}
|
|
1246
1280
|
const messages = [];
|
|
1247
1281
|
if (systemMessage) {
|
|
1248
1282
|
messages.push(["system", systemMessage]);
|
|
1249
1283
|
}
|
|
1250
|
-
messages.push(["human",
|
|
1284
|
+
messages.push(["human", message]);
|
|
1251
1285
|
try {
|
|
1252
|
-
const response = await
|
|
1286
|
+
const response = await model.invoke(messages);
|
|
1253
1287
|
return {
|
|
1254
1288
|
output: response.content,
|
|
1255
1289
|
response: response.content,
|
|
@@ -1257,14 +1291,14 @@ var IaMessageNodeFunction = async (fieldValues) => {
|
|
|
1257
1291
|
};
|
|
1258
1292
|
} catch (error) {
|
|
1259
1293
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1260
|
-
throw new Error(`Error invoking
|
|
1294
|
+
throw new Error(`Error invoking Model: ${errorMessage}`);
|
|
1261
1295
|
}
|
|
1262
1296
|
};
|
|
1263
1297
|
var IaMessageNode = {
|
|
1264
|
-
label: "
|
|
1298
|
+
label: "AI Message",
|
|
1265
1299
|
type: "IaMessageNode",
|
|
1266
1300
|
category: "step",
|
|
1267
|
-
description: "
|
|
1301
|
+
description: "Send message to AI model and return response",
|
|
1268
1302
|
icon: "\u{1F4AC}",
|
|
1269
1303
|
tags: {
|
|
1270
1304
|
execution: "async",
|
|
@@ -1272,48 +1306,56 @@ var IaMessageNode = {
|
|
|
1272
1306
|
},
|
|
1273
1307
|
fields: [
|
|
1274
1308
|
{
|
|
1275
|
-
id: "
|
|
1276
|
-
label: "
|
|
1277
|
-
type: "
|
|
1309
|
+
id: "model",
|
|
1310
|
+
label: "Model",
|
|
1311
|
+
type: "model",
|
|
1278
1312
|
required: true,
|
|
1279
1313
|
typeable: false,
|
|
1280
1314
|
handle: {
|
|
1281
1315
|
type: "input",
|
|
1282
|
-
label: "
|
|
1283
|
-
name: "
|
|
1284
|
-
fieldType: "
|
|
1316
|
+
label: "Model",
|
|
1317
|
+
name: "model",
|
|
1318
|
+
fieldType: "model",
|
|
1319
|
+
acceptTypes: ["model"],
|
|
1320
|
+
maxConnections: 1,
|
|
1285
1321
|
required: true
|
|
1286
1322
|
}
|
|
1287
1323
|
},
|
|
1288
1324
|
{
|
|
1289
1325
|
id: "systemMessage",
|
|
1290
|
-
label: "
|
|
1326
|
+
label: "System Message",
|
|
1291
1327
|
type: "string",
|
|
1292
1328
|
required: false,
|
|
1293
|
-
placeholder: "
|
|
1329
|
+
placeholder: "You are a helpful assistant...",
|
|
1330
|
+
handle: {
|
|
1331
|
+
type: "input",
|
|
1332
|
+
label: "System Message",
|
|
1333
|
+
name: "systemMessage",
|
|
1334
|
+
fieldType: "string"
|
|
1335
|
+
}
|
|
1294
1336
|
},
|
|
1295
1337
|
{
|
|
1296
|
-
id: "
|
|
1297
|
-
label: "
|
|
1338
|
+
id: "message",
|
|
1339
|
+
label: "Message",
|
|
1298
1340
|
type: "string",
|
|
1299
1341
|
required: true,
|
|
1300
|
-
placeholder: "
|
|
1342
|
+
placeholder: "Type your message...",
|
|
1301
1343
|
handle: {
|
|
1302
1344
|
type: "input",
|
|
1303
|
-
label: "
|
|
1304
|
-
name: "
|
|
1345
|
+
label: "Message",
|
|
1346
|
+
name: "message",
|
|
1305
1347
|
fieldType: "string"
|
|
1306
1348
|
}
|
|
1307
1349
|
},
|
|
1308
1350
|
{
|
|
1309
1351
|
id: "output",
|
|
1310
|
-
label: "
|
|
1352
|
+
label: "Output",
|
|
1311
1353
|
type: "string",
|
|
1312
1354
|
required: true,
|
|
1313
1355
|
typeable: false,
|
|
1314
1356
|
handle: {
|
|
1315
1357
|
type: "output",
|
|
1316
|
-
label: "
|
|
1358
|
+
label: "Output",
|
|
1317
1359
|
name: "output",
|
|
1318
1360
|
fieldType: "string",
|
|
1319
1361
|
required: true
|
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,9 @@ interface NodeHandle {
|
|
|
8
8
|
name: string;
|
|
9
9
|
fieldType: string;
|
|
10
10
|
required?: boolean;
|
|
11
|
+
acceptTypes?: string[];
|
|
12
|
+
rejectTypes?: string[];
|
|
13
|
+
maxConnections?: number;
|
|
11
14
|
}
|
|
12
15
|
interface NodeField {
|
|
13
16
|
id?: string;
|
|
@@ -15,7 +18,7 @@ interface NodeField {
|
|
|
15
18
|
label: string;
|
|
16
19
|
toolField?: boolean;
|
|
17
20
|
typeable?: boolean;
|
|
18
|
-
type: 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'json' | 'string' | 'object' | 'HttpOutput' | 'route' | 'code' | 'keyValue' | 'any' | 'llm' | 'function';
|
|
21
|
+
type: 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'json' | 'string' | 'object' | 'HttpOutput' | 'route' | 'code' | 'keyValue' | 'any' | 'llm' | 'function' | 'agent' | 'tool' | 'model' | 'supervisor';
|
|
19
22
|
required?: boolean;
|
|
20
23
|
placeholder?: string;
|
|
21
24
|
defaultValue?: any;
|
|
@@ -222,9 +225,9 @@ declare const IaModelNode: NodeData;
|
|
|
222
225
|
declare const IaModelNodeFunction: (inputs: any) => Promise<any>;
|
|
223
226
|
|
|
224
227
|
declare const IaMessageNodeSchema: z.ZodObject<{
|
|
225
|
-
|
|
228
|
+
model: z.ZodAny;
|
|
226
229
|
systemMessage: z.ZodOptional<z.ZodString>;
|
|
227
|
-
|
|
230
|
+
message: z.ZodString;
|
|
228
231
|
}, z.core.$strip>;
|
|
229
232
|
declare const IaMessageNodeFunction: (fieldValues: any) => Promise<any>;
|
|
230
233
|
declare const IaMessageNode: NodeData;
|
|
@@ -401,9 +404,9 @@ declare const schemas: {
|
|
|
401
404
|
currentResults: zod.ZodOptional<zod.ZodAny>;
|
|
402
405
|
}, zod_v4_core.$strip>;
|
|
403
406
|
IaMessageNode: zod.ZodObject<{
|
|
404
|
-
|
|
407
|
+
model: zod.ZodAny;
|
|
405
408
|
systemMessage: zod.ZodOptional<zod.ZodString>;
|
|
406
|
-
|
|
409
|
+
message: zod.ZodString;
|
|
407
410
|
}, zod_v4_core.$strip>;
|
|
408
411
|
};
|
|
409
412
|
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ interface NodeHandle {
|
|
|
8
8
|
name: string;
|
|
9
9
|
fieldType: string;
|
|
10
10
|
required?: boolean;
|
|
11
|
+
acceptTypes?: string[];
|
|
12
|
+
rejectTypes?: string[];
|
|
13
|
+
maxConnections?: number;
|
|
11
14
|
}
|
|
12
15
|
interface NodeField {
|
|
13
16
|
id?: string;
|
|
@@ -15,7 +18,7 @@ interface NodeField {
|
|
|
15
18
|
label: string;
|
|
16
19
|
toolField?: boolean;
|
|
17
20
|
typeable?: boolean;
|
|
18
|
-
type: 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'json' | 'string' | 'object' | 'HttpOutput' | 'route' | 'code' | 'keyValue' | 'any' | 'llm' | 'function';
|
|
21
|
+
type: 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'json' | 'string' | 'object' | 'HttpOutput' | 'route' | 'code' | 'keyValue' | 'any' | 'llm' | 'function' | 'agent' | 'tool' | 'model' | 'supervisor';
|
|
19
22
|
required?: boolean;
|
|
20
23
|
placeholder?: string;
|
|
21
24
|
defaultValue?: any;
|
|
@@ -222,9 +225,9 @@ declare const IaModelNode: NodeData;
|
|
|
222
225
|
declare const IaModelNodeFunction: (inputs: any) => Promise<any>;
|
|
223
226
|
|
|
224
227
|
declare const IaMessageNodeSchema: z.ZodObject<{
|
|
225
|
-
|
|
228
|
+
model: z.ZodAny;
|
|
226
229
|
systemMessage: z.ZodOptional<z.ZodString>;
|
|
227
|
-
|
|
230
|
+
message: z.ZodString;
|
|
228
231
|
}, z.core.$strip>;
|
|
229
232
|
declare const IaMessageNodeFunction: (fieldValues: any) => Promise<any>;
|
|
230
233
|
declare const IaMessageNode: NodeData;
|
|
@@ -401,9 +404,9 @@ declare const schemas: {
|
|
|
401
404
|
currentResults: zod.ZodOptional<zod.ZodAny>;
|
|
402
405
|
}, zod_v4_core.$strip>;
|
|
403
406
|
IaMessageNode: zod.ZodObject<{
|
|
404
|
-
|
|
407
|
+
model: zod.ZodAny;
|
|
405
408
|
systemMessage: zod.ZodOptional<zod.ZodString>;
|
|
406
|
-
|
|
409
|
+
message: zod.ZodString;
|
|
407
410
|
}, zod_v4_core.$strip>;
|
|
408
411
|
};
|
|
409
412
|
|
package/dist/index.js
CHANGED
|
@@ -586,7 +586,13 @@ var IaAgentNode = {
|
|
|
586
586
|
label: "System Message",
|
|
587
587
|
type: "textarea",
|
|
588
588
|
required: true,
|
|
589
|
-
placeholder: "You are a web researcher..."
|
|
589
|
+
placeholder: "You are a web researcher...",
|
|
590
|
+
handle: {
|
|
591
|
+
type: "input",
|
|
592
|
+
label: "System Message",
|
|
593
|
+
name: "systemMessage",
|
|
594
|
+
fieldType: "string"
|
|
595
|
+
}
|
|
590
596
|
},
|
|
591
597
|
{
|
|
592
598
|
id: "message",
|
|
@@ -604,41 +610,44 @@ var IaAgentNode = {
|
|
|
604
610
|
{
|
|
605
611
|
id: "model",
|
|
606
612
|
label: "Model",
|
|
607
|
-
type: "
|
|
613
|
+
type: "model",
|
|
608
614
|
typeable: false,
|
|
609
615
|
required: true,
|
|
610
616
|
handle: {
|
|
611
617
|
type: "input",
|
|
612
618
|
label: "Model",
|
|
613
619
|
name: "model",
|
|
614
|
-
fieldType: "
|
|
620
|
+
fieldType: "model",
|
|
621
|
+
acceptTypes: ["model"],
|
|
622
|
+
maxConnections: 1
|
|
615
623
|
}
|
|
616
624
|
},
|
|
617
625
|
{
|
|
618
626
|
id: "tools",
|
|
619
627
|
label: "Tools",
|
|
620
|
-
type: "
|
|
628
|
+
type: "tool",
|
|
621
629
|
required: false,
|
|
622
630
|
typeable: false,
|
|
623
631
|
handle: {
|
|
624
632
|
type: "input",
|
|
625
633
|
label: "Tools",
|
|
626
634
|
name: "tools",
|
|
627
|
-
fieldType: "
|
|
635
|
+
fieldType: "tool",
|
|
636
|
+
acceptTypes: ["tool"]
|
|
628
637
|
}
|
|
629
638
|
},
|
|
630
639
|
{
|
|
631
640
|
id: "agent",
|
|
632
641
|
// O output agora é o próprio agente
|
|
633
642
|
label: "Agent",
|
|
634
|
-
type: "
|
|
643
|
+
type: "agent",
|
|
635
644
|
required: true,
|
|
636
645
|
typeable: false,
|
|
637
646
|
handle: {
|
|
638
647
|
type: "output",
|
|
639
648
|
label: "Agent",
|
|
640
649
|
name: "agent",
|
|
641
|
-
fieldType: "
|
|
650
|
+
fieldType: "agent"
|
|
642
651
|
}
|
|
643
652
|
},
|
|
644
653
|
{
|
|
@@ -726,7 +735,7 @@ var AiSupervisorNodeSchema = z6.object({
|
|
|
726
735
|
systemMessage: z6.string().optional().describe("Custom system message for the supervisor")
|
|
727
736
|
});
|
|
728
737
|
var AiSupervisorNode = {
|
|
729
|
-
label: "
|
|
738
|
+
label: "AI Supervisor",
|
|
730
739
|
type: "AiSupervisorNode",
|
|
731
740
|
category: "step",
|
|
732
741
|
description: "Coordinates multiple agents to perform tasks manually",
|
|
@@ -744,22 +753,47 @@ var AiSupervisorNode = {
|
|
|
744
753
|
required: true,
|
|
745
754
|
handle: { type: "input", label: "Message", name: "message", fieldType: "string" }
|
|
746
755
|
},
|
|
747
|
-
{
|
|
756
|
+
{
|
|
757
|
+
id: "systemMessage",
|
|
758
|
+
label: "System Message",
|
|
759
|
+
type: "textarea",
|
|
760
|
+
required: false,
|
|
761
|
+
placeholder: "You are a supervisor... (use {members} to list agents)",
|
|
762
|
+
handle: {
|
|
763
|
+
type: "input",
|
|
764
|
+
label: "System Message",
|
|
765
|
+
name: "systemMessage",
|
|
766
|
+
fieldType: "string"
|
|
767
|
+
}
|
|
768
|
+
},
|
|
748
769
|
{
|
|
749
770
|
id: "model",
|
|
750
771
|
label: "Model",
|
|
751
|
-
type: "
|
|
772
|
+
type: "model",
|
|
752
773
|
typeable: false,
|
|
753
774
|
required: true,
|
|
754
|
-
handle: {
|
|
775
|
+
handle: {
|
|
776
|
+
type: "input",
|
|
777
|
+
label: "Model",
|
|
778
|
+
name: "model",
|
|
779
|
+
fieldType: "model",
|
|
780
|
+
acceptTypes: ["model"],
|
|
781
|
+
maxConnections: 1
|
|
782
|
+
}
|
|
755
783
|
},
|
|
756
784
|
{
|
|
757
785
|
id: "agents",
|
|
758
786
|
label: "Agents",
|
|
759
|
-
type: "
|
|
787
|
+
type: "agent",
|
|
760
788
|
required: true,
|
|
761
789
|
typeable: false,
|
|
762
|
-
handle: {
|
|
790
|
+
handle: {
|
|
791
|
+
type: "input",
|
|
792
|
+
label: "Agents",
|
|
793
|
+
name: "agents",
|
|
794
|
+
fieldType: "agent",
|
|
795
|
+
acceptTypes: ["agent"]
|
|
796
|
+
}
|
|
763
797
|
},
|
|
764
798
|
{
|
|
765
799
|
id: "output",
|
|
@@ -1005,14 +1039,14 @@ var AiToolNode = {
|
|
|
1005
1039
|
{
|
|
1006
1040
|
id: "tool",
|
|
1007
1041
|
label: "Tool",
|
|
1008
|
-
type: "
|
|
1042
|
+
type: "tool",
|
|
1009
1043
|
required: true,
|
|
1010
1044
|
typeable: false,
|
|
1011
1045
|
handle: {
|
|
1012
1046
|
type: "output",
|
|
1013
1047
|
label: "Tool",
|
|
1014
1048
|
name: "tool",
|
|
1015
|
-
fieldType: "
|
|
1049
|
+
fieldType: "tool",
|
|
1016
1050
|
required: true
|
|
1017
1051
|
}
|
|
1018
1052
|
}
|
|
@@ -1068,10 +1102,10 @@ var AiToolNodeFunction = async (fieldValues) => {
|
|
|
1068
1102
|
|
|
1069
1103
|
// src/nodes/ia/model/data.ts
|
|
1070
1104
|
var IaModelNode = {
|
|
1071
|
-
label: "
|
|
1105
|
+
label: "AI Model",
|
|
1072
1106
|
type: "IaModelNode",
|
|
1073
1107
|
category: "step",
|
|
1074
|
-
description: "
|
|
1108
|
+
description: "AI Model",
|
|
1075
1109
|
icon: "\u{1F916}",
|
|
1076
1110
|
tags: {
|
|
1077
1111
|
execution: "async",
|
|
@@ -1080,7 +1114,7 @@ var IaModelNode = {
|
|
|
1080
1114
|
fields: [
|
|
1081
1115
|
{
|
|
1082
1116
|
id: "model",
|
|
1083
|
-
label: "
|
|
1117
|
+
label: "Model",
|
|
1084
1118
|
type: "select",
|
|
1085
1119
|
required: true,
|
|
1086
1120
|
defaultValue: "gemini-2.5-pro",
|
|
@@ -1099,16 +1133,16 @@ var IaModelNode = {
|
|
|
1099
1133
|
required: true
|
|
1100
1134
|
},
|
|
1101
1135
|
{
|
|
1102
|
-
id: "
|
|
1103
|
-
label: "
|
|
1104
|
-
type: "
|
|
1136
|
+
id: "model",
|
|
1137
|
+
label: "Model",
|
|
1138
|
+
type: "model",
|
|
1105
1139
|
required: true,
|
|
1106
1140
|
typeable: false,
|
|
1107
1141
|
handle: {
|
|
1108
1142
|
type: "output",
|
|
1109
|
-
label: "
|
|
1110
|
-
name: "
|
|
1111
|
-
fieldType: "
|
|
1143
|
+
label: "Model",
|
|
1144
|
+
name: "model",
|
|
1145
|
+
fieldType: "model",
|
|
1112
1146
|
required: true
|
|
1113
1147
|
}
|
|
1114
1148
|
}
|
|
@@ -1132,32 +1166,32 @@ var IaModelNodeFunction = async (inputs) => {
|
|
|
1132
1166
|
streaming: stream
|
|
1133
1167
|
});
|
|
1134
1168
|
return {
|
|
1135
|
-
llm
|
|
1169
|
+
model: llm
|
|
1136
1170
|
};
|
|
1137
1171
|
};
|
|
1138
1172
|
|
|
1139
1173
|
// src/nodes/ia/message/message.ts
|
|
1140
1174
|
import { z as z8 } from "zod";
|
|
1141
1175
|
var IaMessageNodeSchema = z8.object({
|
|
1142
|
-
|
|
1176
|
+
model: z8.any().describe("LLM model to use"),
|
|
1143
1177
|
systemMessage: z8.string().optional().describe("System message for context"),
|
|
1144
|
-
|
|
1178
|
+
message: z8.string().describe("User message to send to the LLM")
|
|
1145
1179
|
});
|
|
1146
1180
|
var IaMessageNodeFunction = async (fieldValues) => {
|
|
1147
|
-
const {
|
|
1148
|
-
if (!
|
|
1149
|
-
throw new Error("
|
|
1181
|
+
const { model, systemMessage, message } = fieldValues;
|
|
1182
|
+
if (!model) {
|
|
1183
|
+
throw new Error("Model is required");
|
|
1150
1184
|
}
|
|
1151
|
-
if (!
|
|
1152
|
-
throw new Error("
|
|
1185
|
+
if (!message) {
|
|
1186
|
+
throw new Error("Message is required");
|
|
1153
1187
|
}
|
|
1154
1188
|
const messages = [];
|
|
1155
1189
|
if (systemMessage) {
|
|
1156
1190
|
messages.push(["system", systemMessage]);
|
|
1157
1191
|
}
|
|
1158
|
-
messages.push(["human",
|
|
1192
|
+
messages.push(["human", message]);
|
|
1159
1193
|
try {
|
|
1160
|
-
const response = await
|
|
1194
|
+
const response = await model.invoke(messages);
|
|
1161
1195
|
return {
|
|
1162
1196
|
output: response.content,
|
|
1163
1197
|
response: response.content,
|
|
@@ -1165,14 +1199,14 @@ var IaMessageNodeFunction = async (fieldValues) => {
|
|
|
1165
1199
|
};
|
|
1166
1200
|
} catch (error) {
|
|
1167
1201
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1168
|
-
throw new Error(`Error invoking
|
|
1202
|
+
throw new Error(`Error invoking Model: ${errorMessage}`);
|
|
1169
1203
|
}
|
|
1170
1204
|
};
|
|
1171
1205
|
var IaMessageNode = {
|
|
1172
|
-
label: "
|
|
1206
|
+
label: "AI Message",
|
|
1173
1207
|
type: "IaMessageNode",
|
|
1174
1208
|
category: "step",
|
|
1175
|
-
description: "
|
|
1209
|
+
description: "Send message to AI model and return response",
|
|
1176
1210
|
icon: "\u{1F4AC}",
|
|
1177
1211
|
tags: {
|
|
1178
1212
|
execution: "async",
|
|
@@ -1180,48 +1214,56 @@ var IaMessageNode = {
|
|
|
1180
1214
|
},
|
|
1181
1215
|
fields: [
|
|
1182
1216
|
{
|
|
1183
|
-
id: "
|
|
1184
|
-
label: "
|
|
1185
|
-
type: "
|
|
1217
|
+
id: "model",
|
|
1218
|
+
label: "Model",
|
|
1219
|
+
type: "model",
|
|
1186
1220
|
required: true,
|
|
1187
1221
|
typeable: false,
|
|
1188
1222
|
handle: {
|
|
1189
1223
|
type: "input",
|
|
1190
|
-
label: "
|
|
1191
|
-
name: "
|
|
1192
|
-
fieldType: "
|
|
1224
|
+
label: "Model",
|
|
1225
|
+
name: "model",
|
|
1226
|
+
fieldType: "model",
|
|
1227
|
+
acceptTypes: ["model"],
|
|
1228
|
+
maxConnections: 1,
|
|
1193
1229
|
required: true
|
|
1194
1230
|
}
|
|
1195
1231
|
},
|
|
1196
1232
|
{
|
|
1197
1233
|
id: "systemMessage",
|
|
1198
|
-
label: "
|
|
1234
|
+
label: "System Message",
|
|
1199
1235
|
type: "string",
|
|
1200
1236
|
required: false,
|
|
1201
|
-
placeholder: "
|
|
1237
|
+
placeholder: "You are a helpful assistant...",
|
|
1238
|
+
handle: {
|
|
1239
|
+
type: "input",
|
|
1240
|
+
label: "System Message",
|
|
1241
|
+
name: "systemMessage",
|
|
1242
|
+
fieldType: "string"
|
|
1243
|
+
}
|
|
1202
1244
|
},
|
|
1203
1245
|
{
|
|
1204
|
-
id: "
|
|
1205
|
-
label: "
|
|
1246
|
+
id: "message",
|
|
1247
|
+
label: "Message",
|
|
1206
1248
|
type: "string",
|
|
1207
1249
|
required: true,
|
|
1208
|
-
placeholder: "
|
|
1250
|
+
placeholder: "Type your message...",
|
|
1209
1251
|
handle: {
|
|
1210
1252
|
type: "input",
|
|
1211
|
-
label: "
|
|
1212
|
-
name: "
|
|
1253
|
+
label: "Message",
|
|
1254
|
+
name: "message",
|
|
1213
1255
|
fieldType: "string"
|
|
1214
1256
|
}
|
|
1215
1257
|
},
|
|
1216
1258
|
{
|
|
1217
1259
|
id: "output",
|
|
1218
|
-
label: "
|
|
1260
|
+
label: "Output",
|
|
1219
1261
|
type: "string",
|
|
1220
1262
|
required: true,
|
|
1221
1263
|
typeable: false,
|
|
1222
1264
|
handle: {
|
|
1223
1265
|
type: "output",
|
|
1224
|
-
label: "
|
|
1266
|
+
label: "Output",
|
|
1225
1267
|
name: "output",
|
|
1226
1268
|
fieldType: "string",
|
|
1227
1269
|
required: true
|