Skip to content

Commit

Permalink
Merge pull request #289 from receptron/more_version03
Browse files Browse the repository at this point in the history
WIP: More version 0.3
  • Loading branch information
snakajima authored May 9, 2024
2 parents a923450 + ee69c07 commit e63401f
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 109 deletions.
42 changes: 21 additions & 21 deletions tests/graphai/http_test_bypass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -97,7 +97,7 @@ test("test bypass2", async () => {
firstElement: true,
},
},
inputs: ["$0"],
inputs: [":$0"],
isResult: true,
},
},
Expand All @@ -108,7 +108,7 @@ test("test bypass2", async () => {
params: {
agent: "bypassAgent",
},
inputs: ["mapNode.bypassAgent"],
inputs: [":mapNode.bypassAgent"],
},
},
};
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -163,7 +163,7 @@ test("test bypass3", async () => {
firstElement: true,
},
},
inputs: ["bypassAgent2.$0"],
inputs: [":bypassAgent2.$0"],
isResult: true,
},
},
Expand All @@ -177,7 +177,7 @@ test("test bypass3", async () => {
firstElement: true,
},
},
inputs: ["mapNode.bypassAgent3"],
inputs: [":mapNode.bypassAgent3"],
},
},
};
Expand All @@ -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",
Expand All @@ -206,12 +206,12 @@ test("test bypass4", async () => {
},
mapNode: {
agent: "mapAgent",
inputs: ["echo.message"],
inputs: [":echo.message"],
params: {
injectionTo: ["memory"],
},
graph: {
version: 0.2,
version: 0.3,
nodes: {
memory: {
value: {},
Expand All @@ -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,
},
},
Expand All @@ -240,7 +240,7 @@ test("test bypass4", async () => {
agent: "bypassAgent",
firstElement: true,
},
inputs: ["mapNode.bypassAgent2"],
inputs: [":mapNode.bypassAgent2"],
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions tests/graphai/http_test_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const httpClientAgent: AgentFunction<Record<string, string>> = async (context) =
};

const graph_data = {
version: 0.2,
version: 0.3,
nodes: {
node1: {
params: {
Expand All @@ -28,7 +28,7 @@ const graph_data = {
params: {
url: "http://127.0.0.1:8080/llm2.json",
},
inputs: ["node1"],
inputs: [":node1"],
agent: "httpClientAgent",
},
},
Expand Down
14 changes: 7 additions & 7 deletions tests/graphai/test_any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand All @@ -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"],
},
},
};
Expand Down Expand Up @@ -62,7 +62,7 @@ test("test any no", async () => {
});

const graphdata_any2 = {
version: 0.2,
version: 0.3,
nodes: {
source1: {
value: { apple: "red" },
Expand All @@ -76,21 +76,21 @@ const graphdata_any2 = {
duration: 10,
},
isResult: true,
inputs: ["source1"],
inputs: [":source1"],
},
router2: {
agent: "sleeperAgent",
params: {
duration: 100,
},
isResult: true,
inputs: ["source2"],
inputs: [":source2"],
},
receiver: {
agent: "sleeperAgent",
anyInput: true,
isResult: true,
inputs: ["router1", "router2"],
inputs: [":router1", ":router2"],
},
},
};
Expand Down
Loading

0 comments on commit e63401f

Please sign in to comment.