From 5e44ce2eb82ad87fde7fe12064b0f63b9d92ec2c Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:02:31 -0700 Subject: [PATCH 1/8] more version 0.3 --- tests/graphs/test_cli.yaml | 2 +- tests/graphs/test_dispatch.yml | 8 ++++---- tests/graphs/test_error.yml | 8 ++++---- tests/graphs/test_multiple_functions_1.yml | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/graphs/test_cli.yaml b/tests/graphs/test_cli.yaml index b6bdde122..4bb911d71 100644 --- a/tests/graphs/test_cli.yaml +++ b/tests/graphs/test_cli.yaml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: agent: testAgent diff --git a/tests/graphs/test_dispatch.yml b/tests/graphs/test_dispatch.yml index b4927f1c6..e52e218dc 100644 --- a/tests/graphs/test_dispatch.yml +++ b/tests/graphs/test_dispatch.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: params: @@ -17,19 +17,19 @@ nodes: duration: 500 value: node3: output - inputs: [node1, node2.port1] + inputs: [:node1, :node2.port1] agent: sleeperAgent node4: params: duration: 100 value: node4: output - inputs: [node3] + inputs: [:node3] agent: sleeperAgent node5: params: duration: 500 value: node5: output - inputs: [node2.port1, node4] + inputs: [:node2.port1, :node4] agent: sleeperAgent diff --git a/tests/graphs/test_error.yml b/tests/graphs/test_error.yml index 4d29dc179..d6e2487ff 100644 --- a/tests/graphs/test_error.yml +++ b/tests/graphs/test_error.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: agent: sleeperAgentDebug @@ -19,7 +19,7 @@ nodes: fail: true value: node3: output - inputs: [node1, node2] + inputs: [:node1, :node2] node4: agent: sleeperAgentDebug timeout: 200 @@ -28,11 +28,11 @@ nodes: duration: 300 value: node4: output - inputs: [node3] + inputs: [:node3] node5: agent: sleeperAgentDebug params: duration: 100 value: node5: output - inputs: [node4] + inputs: [:node4] diff --git a/tests/graphs/test_multiple_functions_1.yml b/tests/graphs/test_multiple_functions_1.yml index 054654ccf..ac2675498 100644 --- a/tests/graphs/test_multiple_functions_1.yml +++ b/tests/graphs/test_multiple_functions_1.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: params: @@ -11,21 +11,21 @@ nodes: node3: params: delay: 500 - inputs: [node1, node2] + inputs: [:node1, :node2] agent: test2 node4: params: delay: 100 - inputs: [node3] + inputs: [:node3] agent: test1 node5: params: delay: 500 - inputs: [node2, node4] + inputs: [:node2, :node4] agent: test2 node6: params: delay: 100 number: 10 - inputs: [node4] + inputs: [:node4] agent: numberTestAgent From 8724bb9bf72218da7eb543291c98586ca4814c6b Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:04:40 -0700 Subject: [PATCH 2/8] more version 0.3 --- tests/graphs/test_nested.yml | 14 +++++++------- tests/graphs/test_retry.yml | 8 ++++---- tests/graphs/test_source.yml | 8 ++++---- tests/graphs/test_source2.yml | 8 ++++---- tests/graphs/test_timeout.yml | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/graphs/test_nested.yml b/tests/graphs/test_nested.yml index 4c3249677..cec3420dd 100644 --- a/tests/graphs/test_nested.yml +++ b/tests/graphs/test_nested.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: outer1: agent: sleeperAgent @@ -8,9 +8,9 @@ nodes: outer1: output outer2: agent: nestedAgent - inputs: [outer1] + inputs: [:outer1] graph: - version: 0.2 + version: 0.3 nodes: inner1: agent: sleeperAgent @@ -31,25 +31,25 @@ nodes: duration: 500 value: inner3: output - inputs: [$0, inner1, inner2] + inputs: [:$0, :inner1, :inner2] outer3: agent: sleeperAgent params: duration: 500 value: outer3: output - inputs: [outer2.inner3] + inputs: [:outer2.inner3] outer4: agent: sleeperAgent params: duration: 100 value: outer4: output - inputs: [outer3] + inputs: [:outer3] outer5: agent: sleeperAgent params: duration: 500 value: outer5: output - inputs: [outer2.inner3, outer4] + inputs: [:outer2.inner3, :outer4] diff --git a/tests/graphs/test_retry.yml b/tests/graphs/test_retry.yml index 28f8042ff..88b1d8137 100644 --- a/tests/graphs/test_retry.yml +++ b/tests/graphs/test_retry.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: agent: sleeperAgentDebug @@ -19,7 +19,7 @@ nodes: fail: true value: node3: output - inputs: [node1, node2] + inputs: [:node1, :node2] retry: 2 node4: agent: sleeperAgentDebug @@ -29,11 +29,11 @@ nodes: duration: 300 value: node4: output - inputs: [node3] + inputs: [:node3] node5: agent: sleeperAgentDebug params: duration: 100 value: node5: output - inputs: [node4] + inputs: [:node4] diff --git a/tests/graphs/test_source.yml b/tests/graphs/test_source.yml index a8a9cc1a7..53e8fd231 100644 --- a/tests/graphs/test_source.yml +++ b/tests/graphs/test_source.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: agent: sleeperAgent @@ -15,18 +15,18 @@ nodes: duration: 500 value: node3: output - inputs: [node1, node2] + inputs: [:node1, :node2] node4: agent: sleeperAgent params: duration: 100 value: node4: output - inputs: [node3] + inputs: [:node3] node5: agent: sleeperAgent params: duration: 500 value: node5: output - inputs: [node2, node4] + inputs: [:node2, :node4] diff --git a/tests/graphs/test_source2.yml b/tests/graphs/test_source2.yml index 35a7ec197..a606c7b44 100644 --- a/tests/graphs/test_source2.yml +++ b/tests/graphs/test_source2.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: value: @@ -12,18 +12,18 @@ nodes: duration: 500 value: node3: output - inputs: [node1, node2] + inputs: [:node1, :node2] node4: agent: sleeperAgent params: duration: 100 value: node4: output - inputs: [node3] + inputs: [:node3] node5: agent: sleeperAgent params: duration: 500 value: node5: output - inputs: [node2, node4] + inputs: [:node2, :node4] diff --git a/tests/graphs/test_timeout.yml b/tests/graphs/test_timeout.yml index b6dc60eb7..c4b8e80e5 100644 --- a/tests/graphs/test_timeout.yml +++ b/tests/graphs/test_timeout.yml @@ -1,4 +1,4 @@ -version: 0.2 +version: 0.3 nodes: node1: agent: sleeperAgentDebug @@ -19,7 +19,7 @@ nodes: fail: true value: node3: output - inputs: [node1, node2] + inputs: [:node1, :node2] retry: 2 node4: agent: sleeperAgentDebug @@ -28,11 +28,11 @@ nodes: duration: 300 value: node4: output - inputs: [node3] + inputs: [:node3] node5: agent: sleeperAgentDebug params: duration: 100 value: node5: output - inputs: [node4] + inputs: [:node4] From 6a0ee547b3d8d6f7fc6e8cada8dc814225ee7579 Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:06:51 -0700 Subject: [PATCH 3/8] bypass 0.3 --- tests/graphai/http_test_bypass.ts | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/graphai/http_test_bypass.ts b/tests/graphai/http_test_bypass.ts index 327c4908f..edabb198b 100644 --- a/tests/graphai/http_test_bypass.ts +++ b/tests/graphai/http_test_bypass.ts @@ -24,7 +24,7 @@ const httpAgent: AgentFunction = async ({ inputs, params }) => { test("test bypass1", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "httpAgent", @@ -37,14 +37,14 @@ test("test bypass1", async () => { }, bypassAgent: { agent: "httpAgent", - inputs: ["echo"], + inputs: [":echo"], params: { agent: "bypassAgent", }, }, bypassAgent2: { agent: "httpAgent", - inputs: ["bypassAgent.$0"], + inputs: [":bypassAgent.$0"], params: { agent: "bypassAgent", }, @@ -72,7 +72,7 @@ test("test bypass1", async () => { test("test bypass2", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "httpAgent", @@ -85,9 +85,9 @@ test("test bypass2", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], graph: { - version: 0.2, + version: 0.3, nodes: { bypassAgent: { agent: "httpAgent", @@ -108,7 +108,7 @@ test("test bypass2", async () => { params: { agent: "bypassAgent", }, - inputs: ["mapNode.bypassAgent"], + inputs: [":mapNode.bypassAgent"], }, }, }; @@ -124,7 +124,7 @@ test("test bypass2", async () => { test("test bypass3", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "httpAgent", @@ -137,23 +137,23 @@ test("test bypass3", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], graph: { - version: 0.2, + version: 0.3, nodes: { bypassAgent: { agent: "httpAgent", params: { agent: "bypassAgent", }, - inputs: ["$0"], + inputs: [":$0"], }, bypassAgent2: { agent: "httpAgent", params: { agent: "bypassAgent", }, - inputs: ["bypassAgent.$0"], + inputs: [":bypassAgent.$0"], }, bypassAgent3: { agent: "httpAgent", @@ -163,7 +163,7 @@ test("test bypass3", async () => { firstElement: true, }, }, - inputs: ["bypassAgent2.$0"], + inputs: [":bypassAgent2.$0"], isResult: true, }, }, @@ -177,7 +177,7 @@ test("test bypass3", async () => { firstElement: true, }, }, - inputs: ["mapNode.bypassAgent3"], + inputs: [":mapNode.bypassAgent3"], }, }, }; @@ -193,7 +193,7 @@ test("test bypass3", async () => { test("test bypass4", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "httpAgent", @@ -211,7 +211,7 @@ test("test bypass4", async () => { injectionTo: ["memory"], }, graph: { - version: 0.2, + version: 0.3, nodes: { memory: { value: {}, @@ -221,14 +221,14 @@ test("test bypass4", async () => { params: { agent: "bypassAgent", }, - inputs: ["memory"], + inputs: [":memory"], }, bypassAgent2: { agent: "httpAgent", params: { agent: "bypassAgent", }, - inputs: ["bypassAgent.$0", "memory"], + inputs: [":bypassAgent.$0", "memory"], isResult: true, }, }, @@ -240,7 +240,7 @@ test("test bypass4", async () => { agent: "bypassAgent", firstElement: true, }, - inputs: ["mapNode.bypassAgent2"], + inputs: [":mapNode.bypassAgent2"], }, }, }; From d2c59f8d5d1a4bcde29dee5399e8699a77e9ef97 Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:08:12 -0700 Subject: [PATCH 4/8] any and client --- tests/graphai/http_test_client.ts | 4 ++-- tests/graphai/test_any.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/graphai/http_test_client.ts b/tests/graphai/http_test_client.ts index 3b0976003..b9126f74e 100644 --- a/tests/graphai/http_test_client.ts +++ b/tests/graphai/http_test_client.ts @@ -16,7 +16,7 @@ const httpClientAgent: AgentFunction> = async (context) = }; const graph_data = { - version: 0.2, + version: 0.3, nodes: { node1: { params: { @@ -28,7 +28,7 @@ const graph_data = { params: { url: "http://127.0.0.1:8080/llm2.json", }, - inputs: ["node1"], + inputs: [":node1"], agent: "httpClientAgent", }, }, diff --git a/tests/graphai/test_any.ts b/tests/graphai/test_any.ts index 4ed93c5cb..d65026a6e 100644 --- a/tests/graphai/test_any.ts +++ b/tests/graphai/test_any.ts @@ -6,7 +6,7 @@ import test from "node:test"; import assert from "node:assert"; const graphdata_any = { - version: 0.2, + version: 0.3, nodes: { source: { value: {}, @@ -15,13 +15,13 @@ const graphdata_any = { agent: "sleeperAgent", anyInput: true, isResult: true, - inputs: ["source.yes"], + inputs: [":source.yes"], }, negative: { agent: "sleeperAgent", anyInput: true, isResult: true, - inputs: ["source.no"], + inputs: [":source.no"], }, }, }; @@ -62,7 +62,7 @@ test("test any no", async () => { }); const graphdata_any2 = { - version: 0.2, + version: 0.3, nodes: { source1: { value: { apple: "red" }, @@ -76,7 +76,7 @@ const graphdata_any2 = { duration: 10, }, isResult: true, - inputs: ["source1"], + inputs: [":source1"], }, router2: { agent: "sleeperAgent", @@ -84,13 +84,13 @@ const graphdata_any2 = { duration: 100, }, isResult: true, - inputs: ["source2"], + inputs: [":source2"], }, receiver: { agent: "sleeperAgent", anyInput: true, isResult: true, - inputs: ["router1", "router2"], + inputs: [":router1", ":router2"], }, }, }; From 0e6fcce5f6ca7c502ccefcfcbd2e16b76b1f65ab Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:10:25 -0700 Subject: [PATCH 5/8] more bypass --- tests/graphai/test_bypass.ts | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/graphai/test_bypass.ts b/tests/graphai/test_bypass.ts index 551df3387..3115aaaf3 100644 --- a/tests/graphai/test_bypass.ts +++ b/tests/graphai/test_bypass.ts @@ -6,7 +6,7 @@ import assert from "node:assert"; test("test bypass1", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -16,11 +16,11 @@ test("test bypass1", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo"], + inputs: [":echo"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent.$0"], + inputs: [":bypassAgent.$0"], }, }, }; @@ -46,7 +46,7 @@ test("test bypass1", async () => { test("test bypass2", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -56,13 +56,13 @@ test("test bypass2", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], graph: { - version: 0.2, + version: 0.3, nodes: { bypassAgent: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], isResult: true, params: { firstElement: true, @@ -73,7 +73,7 @@ test("test bypass2", async () => { }, bypassAgent2: { agent: "bypassAgent", - inputs: ["mapNode.bypassAgent"], + inputs: [":mapNode.bypassAgent"], }, }, }; @@ -89,7 +89,7 @@ test("test bypass2", async () => { test("test bypass3", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -99,21 +99,21 @@ test("test bypass3", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], graph: { - version: 0.2, + version: 0.3, nodes: { bypassAgent: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent.$0"], + inputs: [":bypassAgent.$0"], }, bypassAgent3: { agent: "bypassAgent", - inputs: ["bypassAgent2.$0"], + inputs: [":bypassAgent2.$0"], params: { firstElement: true, }, @@ -127,7 +127,7 @@ test("test bypass3", async () => { params: { firstElement: true, }, - inputs: ["mapNode.bypassAgent3"], + inputs: [":mapNode.bypassAgent3"], }, }, }; @@ -143,7 +143,7 @@ test("test bypass3", async () => { test("test bypass4", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -153,17 +153,17 @@ test("test bypass4", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], graph: { - version: 0.2, + version: 0.3, nodes: { bypassAgent: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent.$0", "$0"], + inputs: [":bypassAgent.$0", ":$0"], isResult: true, }, }, @@ -171,7 +171,7 @@ test("test bypass4", async () => { }, bypassAgent3: { agent: "bypassAgent", - inputs: ["mapNode.bypassAgent2"], + inputs: [":mapNode.bypassAgent2"], params: { firstElement: true, }, @@ -201,7 +201,7 @@ test("test bypass4", async () => { test("test bypass 5", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -211,15 +211,15 @@ test("test bypass 5", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo", "echo", "echo"], + inputs: [":echo", ":echo", ":echo"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent", "bypassAgent"], + inputs: [":bypassAgent", ":bypassAgent"], }, bypassAgent3: { agent: "bypassAgent", - inputs: ["bypassAgent2", "bypassAgent2"], + inputs: [":bypassAgent2", ":bypassAgent2"], }, }, }; From ce3ffdd9b46e93fb2e5f68c38bae8905f927a2af Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:12:26 -0700 Subject: [PATCH 6/8] fork in 0.3 --- tests/graphai/test_fork.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/graphai/test_fork.ts b/tests/graphai/test_fork.ts index b1f41b02f..ab2c439ff 100644 --- a/tests/graphai/test_fork.ts +++ b/tests/graphai/test_fork.ts @@ -33,7 +33,7 @@ const testAgent1a: AgentFunction = async ({ debugInfo: { nodeId }, inputs }) => test("test fork 1", async () => { const forkGraph = { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "testAgent1a", @@ -41,27 +41,27 @@ test("test fork 1", async () => { node2: { agent: "copy2ArrayAgent", params: { count: 10 }, - inputs: ["node1"], + inputs: [":node1"], }, mapNode: { agent: "mapAgent", - inputs: ["node2"], + inputs: [":node2"], params: { injectionTo: ["buffer"], }, graph: { - version: 0.2, + version: 0.3, nodes: { buffer: { value: {}, }, node2: { agent: "testAgent1a", - inputs: ["buffer"], + inputs: [":buffer"], }, node3: { agent: "testAgent1a", - inputs: ["node2"], + inputs: [":node2"], isResult: true, }, }, @@ -107,7 +107,7 @@ test("test fork 1", async () => { test("test fork 2", async () => { const forkGraph = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "copyMessageAgent", @@ -118,9 +118,9 @@ test("test fork 2", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.messages"], + inputs: [":echo.messages"], graph: { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "testAgent1", @@ -129,12 +129,12 @@ test("test fork 2", async () => { node2: { agent: "testAgent1", params: {}, - inputs: ["node1"], + inputs: [":node1"], }, node3: { agent: "testAgent1", params: {}, - inputs: ["node2"], + inputs: [":node2"], isResult: true, }, }, @@ -168,30 +168,30 @@ test("test fork 2", async () => { test("test fork 3", async () => { const forkGraph = { - version: 0.2, + version: 0.3, nodes: { source: { value: { content: [{ level1: { level2: "hello1" } }, { level1: { level2: "hello2" } }] }, }, mapNode: { agent: "mapAgent", - inputs: ["source.content"], + inputs: [":source.content"], params: { injectionTo: ["workingMemory"], }, graph: { - version: 0.2, + version: 0.3, nodes: { workingMemory: { value: {}, }, forked: { agent: "sleeperAgent", - inputs: ["workingMemory.level1"], + inputs: [":workingMemory.level1"], }, forked2: { agent: "sleeperAgent", - inputs: ["forked"], + inputs: [":forked"], isResult: true, }, }, @@ -199,7 +199,7 @@ test("test fork 3", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["mapNode"], + inputs: [":mapNode"], }, }, }; From 382c3f2c293e40f38a9b7fa039e1688c29c96cac Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:28:57 -0700 Subject: [PATCH 7/8] fix http --- tests/graphai/http_test_bypass.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/graphai/http_test_bypass.ts b/tests/graphai/http_test_bypass.ts index edabb198b..09226ddd6 100644 --- a/tests/graphai/http_test_bypass.ts +++ b/tests/graphai/http_test_bypass.ts @@ -97,7 +97,7 @@ test("test bypass2", async () => { firstElement: true, }, }, - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -206,7 +206,7 @@ test("test bypass4", async () => { }, mapNode: { agent: "mapAgent", - inputs: ["echo.message"], + inputs: [":echo.message"], params: { injectionTo: ["memory"], }, From ee69c072fd81e8a744ca5816e845719b063ef5a6 Mon Sep 17 00:00:00 2001 From: snakajima Date: Thu, 9 May 2024 14:34:32 -0700 Subject: [PATCH 8/8] memory bug --- tests/graphai/http_test_bypass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/graphai/http_test_bypass.ts b/tests/graphai/http_test_bypass.ts index 09226ddd6..ac0bd946b 100644 --- a/tests/graphai/http_test_bypass.ts +++ b/tests/graphai/http_test_bypass.ts @@ -228,7 +228,7 @@ test("test bypass4", async () => { params: { agent: "bypassAgent", }, - inputs: [":bypassAgent.$0", "memory"], + inputs: [":bypassAgent.$0", ":memory"], isResult: true, }, },