graphai 0.6.18 → 0.6.19
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 +10 -4
- 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 +1 -0
- package/lib/graphai.js +1 -0
- package/lib/node.js +9 -4
- package/lib/type.d.ts +1 -0
- package/package.json +2 -2
package/lib/graphai.js
CHANGED
package/lib/node.js
CHANGED
|
@@ -235,7 +235,8 @@ class ComputedNode extends Node {
|
|
|
235
235
|
if (typeof agentId === "function") {
|
|
236
236
|
this.agentFunction = agentId;
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const hasNestedGraph = Boolean(this.nestedGraph) || Boolean(agentId && this.graph.getAgentFunctionInfo(agentId).hasGraphData);
|
|
239
|
+
const config = this.getConfig(hasNestedGraph, agentId);
|
|
239
240
|
const transactionId = Date.now();
|
|
240
241
|
this.prepareExecute(transactionId, Object.values(previousResults));
|
|
241
242
|
if (this.timeout && this.timeout > 0) {
|
|
@@ -249,10 +250,14 @@ class ComputedNode extends Node {
|
|
|
249
250
|
const context = this.getContext(previousResults, localLog, agentId, config);
|
|
250
251
|
// NOTE: We use the existence of graph object in the agent-specific params to determine
|
|
251
252
|
// if this is a nested agent or not.
|
|
252
|
-
if (
|
|
253
|
+
if (hasNestedGraph) {
|
|
253
254
|
this.graph.taskManager.prepareForNesting();
|
|
254
255
|
context.forNestedGraph = {
|
|
255
|
-
graphData:
|
|
256
|
+
graphData: this.nestedGraph
|
|
257
|
+
? "nodes" in this.nestedGraph
|
|
258
|
+
? this.nestedGraph
|
|
259
|
+
: this.graph.resultOf(this.nestedGraph) // HACK: compiler work-around
|
|
260
|
+
: { version: 0, nodes: {} },
|
|
256
261
|
agents: this.graph.agentFunctionInfoDictionary,
|
|
257
262
|
graphOptions: {
|
|
258
263
|
agentFilters: this.graph.agentFilters,
|
|
@@ -267,7 +272,7 @@ class ComputedNode extends Node {
|
|
|
267
272
|
this.beforeConsoleLog(context);
|
|
268
273
|
const result = await this.agentFilterHandler(context, agentFunction, agentId);
|
|
269
274
|
this.afterConsoleLog(result);
|
|
270
|
-
if (
|
|
275
|
+
if (hasNestedGraph) {
|
|
271
276
|
this.graph.taskManager.restoreAfterNesting();
|
|
272
277
|
}
|
|
273
278
|
if (!this.isCurrentTransaction(transactionId)) {
|
package/lib/type.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphai",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
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.6"
|
|
31
31
|
},
|
|
32
32
|
"types": "./lib/index.d.ts",
|
|
33
33
|
"directories": {
|