graphai 0.6.5 → 0.6.6
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/lib/bundle.cjs.js +1 -1
- package/lib/bundle.cjs.js.map +1 -1
- package/lib/bundle.esm.js +18 -5
- package/lib/bundle.esm.js.map +1 -1
- package/lib/bundle.umd.js +1 -1
- package/lib/bundle.umd.js.map +1 -1
- package/lib/graphai.d.ts +2 -0
- package/lib/graphai.js +12 -4
- package/lib/node.js +6 -1
- package/package.json +2 -2
package/lib/graphai.js
CHANGED
|
@@ -22,7 +22,6 @@ class GraphAI {
|
|
|
22
22
|
else {
|
|
23
23
|
_nodes[nodeId] = new node_1.StaticNode(nodeId, nodeData, this);
|
|
24
24
|
}
|
|
25
|
-
// throw new Error("Unknown node type (neither value nor agent): " + nodeId);
|
|
26
25
|
return _nodes;
|
|
27
26
|
}, {});
|
|
28
27
|
// Generate the waitlist for each node.
|
|
@@ -197,7 +196,7 @@ class GraphAI {
|
|
|
197
196
|
throw new Error("Static node must have value. Set value or injectValue or set update");
|
|
198
197
|
}
|
|
199
198
|
if (this.isRunning()) {
|
|
200
|
-
throw new Error("This
|
|
199
|
+
throw new Error("This GraphAI instance is already running");
|
|
201
200
|
}
|
|
202
201
|
this.pushReadyNodesIntoQueue();
|
|
203
202
|
if (!this.isRunning()) {
|
|
@@ -250,14 +249,23 @@ class GraphAI {
|
|
|
250
249
|
return false; // while condition is not met
|
|
251
250
|
}
|
|
252
251
|
}
|
|
253
|
-
this.
|
|
254
|
-
this.initializeStaticNodes();
|
|
252
|
+
this.initializeGraphAI();
|
|
255
253
|
this.updateStaticNodes(previousResults, true);
|
|
256
254
|
this.pushReadyNodesIntoQueue();
|
|
257
255
|
return true; // Indicating that we are going to continue.
|
|
258
256
|
}
|
|
259
257
|
return false;
|
|
260
258
|
}
|
|
259
|
+
initializeGraphAI() {
|
|
260
|
+
if (this.isRunning()) {
|
|
261
|
+
throw new Error("This GraphAI instance is running");
|
|
262
|
+
}
|
|
263
|
+
this.nodes = this.createNodes(this.data);
|
|
264
|
+
this.initializeStaticNodes();
|
|
265
|
+
}
|
|
266
|
+
setPreviousResults(previousResults) {
|
|
267
|
+
this.updateStaticNodes(previousResults);
|
|
268
|
+
}
|
|
261
269
|
setLoopLog(log) {
|
|
262
270
|
log.isLoop = !!this.loop;
|
|
263
271
|
log.repeatCount = this.repeatCount;
|
package/lib/node.js
CHANGED
|
@@ -36,7 +36,12 @@ class Node {
|
|
|
36
36
|
console.log(typeof result === "string" ? result : JSON.stringify(result, null, 2));
|
|
37
37
|
}
|
|
38
38
|
else if (this.console.after) {
|
|
39
|
-
|
|
39
|
+
if ((0, utils_2.isObject)(this.console.after)) {
|
|
40
|
+
console.log(JSON.stringify((0, result_1.resultsOf)(this.console.after, { self: this }, this.graph.propFunctions, true), null, 2));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.log(this.console.after);
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphai",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Asynchronous data flow execution engine for agentic AI apps.",
|
|
5
5
|
"main": "lib/bundle.cjs.js",
|
|
6
6
|
"module": "lib/bundle.esm.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/receptron/graphai#readme",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"typedoc": "^0.27.
|
|
30
|
+
"typedoc": "^0.27.4"
|
|
31
31
|
},
|
|
32
32
|
"types": "./lib/index.d.ts",
|
|
33
33
|
"directories": {
|