graphai 0.1.2 → 0.2.0
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/README.md +107 -78
- package/lib/experimental_agents/array_agents/packages.d.ts +4 -0
- package/lib/experimental_agents/array_agents/packages.js +12 -0
- package/lib/experimental_agents/array_agents/pop_agent.d.ts +26 -0
- package/lib/experimental_agents/array_agents/pop_agent.js +40 -0
- package/lib/experimental_agents/array_agents/push_agent.d.ts +16 -0
- package/lib/experimental_agents/array_agents/push_agent.js +18 -0
- package/lib/experimental_agents/array_agents/shift_agent.d.ts +26 -0
- package/lib/experimental_agents/array_agents/shift_agent.js +29 -0
- package/lib/experimental_agents/data_agents/data_object_merge_template_agent.d.ts +57 -2
- package/lib/experimental_agents/data_agents/data_object_merge_template_agent.js +13 -1
- package/lib/experimental_agents/data_agents/data_sum_template_agent.d.ts +1 -0
- package/lib/experimental_agents/data_agents/data_sum_template_agent.js +1 -0
- package/lib/experimental_agents/data_agents/packages.d.ts +4 -0
- package/lib/experimental_agents/data_agents/packages.js +12 -0
- package/lib/experimental_agents/data_agents/total_agent.d.ts +1 -0
- package/lib/experimental_agents/data_agents/total_agent.js +1 -0
- package/lib/experimental_agents/embedding_agent.d.ts +17 -3
- package/lib/experimental_agents/embedding_agent.js +13 -1
- package/lib/experimental_agents/graph_agents/index.d.ts +2 -0
- package/lib/experimental_agents/graph_agents/index.js +7 -0
- package/lib/experimental_agents/graph_agents/map_agent.d.ts +20 -0
- package/lib/experimental_agents/{map_agent.js → graph_agents/map_agent.js} +31 -10
- package/lib/experimental_agents/graph_agents/nested_agent.d.ts +22 -0
- package/lib/experimental_agents/graph_agents/nested_agent.js +70 -0
- package/lib/experimental_agents/graph_agents/packages.d.ts +3 -0
- package/lib/experimental_agents/graph_agents/packages.js +10 -0
- package/lib/experimental_agents/index.d.ts +4 -5
- package/lib/experimental_agents/index.js +4 -5
- package/lib/experimental_agents/matrix_agents/dot_product_agent.d.ts +17 -3
- package/lib/experimental_agents/matrix_agents/dot_product_agent.js +26 -1
- package/lib/experimental_agents/matrix_agents/packages.d.ts +3 -0
- package/lib/experimental_agents/matrix_agents/packages.js +10 -0
- package/lib/experimental_agents/matrix_agents/sort_by_values_agent.d.ts +17 -3
- package/lib/experimental_agents/matrix_agents/sort_by_values_agent.js +13 -1
- package/lib/experimental_agents/packages.d.ts +11 -0
- package/lib/experimental_agents/packages.js +33 -0
- package/lib/experimental_agents/slashgpt_agent.d.ts +24 -0
- package/lib/experimental_agents/slashgpt_agent.js +12 -0
- package/lib/experimental_agents/sleeper_agents/packages.d.ts +3 -0
- package/lib/experimental_agents/sleeper_agents/packages.js +10 -0
- package/lib/experimental_agents/sleeper_agents/sleeper_agent.d.ts +18 -0
- package/lib/experimental_agents/sleeper_agents/sleeper_agent.js +12 -0
- package/lib/experimental_agents/sleeper_agents/sleeper_agent_debug.d.ts +20 -0
- package/lib/experimental_agents/sleeper_agents/sleeper_agent_debug.js +13 -1
- package/lib/experimental_agents/string_agents/packages.d.ts +3 -0
- package/lib/experimental_agents/string_agents/packages.js +10 -0
- package/lib/experimental_agents/string_agents/string_splitter_agent.d.ts +1 -0
- package/lib/experimental_agents/string_agents/string_splitter_agent.js +1 -0
- package/lib/experimental_agents/string_agents/string_template_agent.d.ts +1 -0
- package/lib/experimental_agents/string_agents/string_template_agent.js +1 -0
- package/lib/experimental_agents/test_agents/bypass_agent.d.ts +3 -0
- package/lib/experimental_agents/test_agents/bypass_agent.js +24 -0
- package/lib/experimental_agents/test_agents/copy2array_agent.d.ts +6 -1
- package/lib/experimental_agents/test_agents/copy2array_agent.js +32 -2
- package/lib/experimental_agents/test_agents/copy_message_agent.d.ts +9 -1
- package/lib/experimental_agents/test_agents/copy_message_agent.js +19 -0
- package/lib/experimental_agents/test_agents/counting_agent.d.ts +8 -1
- package/lib/experimental_agents/test_agents/counting_agent.js +19 -0
- package/lib/experimental_agents/test_agents/echo_agent.d.ts +3 -0
- package/lib/experimental_agents/test_agents/echo_agent.js +13 -0
- package/lib/experimental_agents/test_agents/merge_node_id_agent.d.ts +3 -0
- package/lib/experimental_agents/test_agents/merge_node_id_agent.js +22 -0
- package/lib/experimental_agents/test_agents/packages.d.ts +7 -0
- package/lib/experimental_agents/test_agents/packages.js +18 -0
- package/lib/experimental_agents/token_agent.d.ts +20 -0
- package/lib/experimental_agents/token_agent.js +12 -0
- package/lib/graphai.d.ts +1 -1
- package/lib/graphai.js +8 -11
- package/lib/node.d.ts +1 -0
- package/lib/node.js +17 -10
- package/lib/type.d.ts +4 -3
- package/lib/utils/test_utils.js +1 -1
- package/lib/utils/utils.d.ts +3 -1
- package/lib/utils/utils.js +30 -2
- package/package.json +3 -2
- package/lib/experimental_agents/map_agent.d.ts +0 -4
- package/lib/experimental_agents/nested_agent.d.ts +0 -5
- package/lib/experimental_agents/nested_agent.js +0 -40
|
@@ -38,6 +38,18 @@ const stringEmbeddingsAgent = async ({ params, inputs }) => {
|
|
|
38
38
|
const embeddings = jsonResponse.data.map((object) => {
|
|
39
39
|
return object.embedding;
|
|
40
40
|
});
|
|
41
|
-
return
|
|
41
|
+
return embeddings;
|
|
42
42
|
};
|
|
43
43
|
exports.stringEmbeddingsAgent = stringEmbeddingsAgent;
|
|
44
|
+
const stringEmbeddingsAgentInfo = {
|
|
45
|
+
name: "stringEmbeddingsAgent",
|
|
46
|
+
agent: exports.stringEmbeddingsAgent,
|
|
47
|
+
mock: exports.stringEmbeddingsAgent,
|
|
48
|
+
samples: [],
|
|
49
|
+
description: "Embeddings Agent",
|
|
50
|
+
category: [],
|
|
51
|
+
author: "Receptron team",
|
|
52
|
+
repository: "https://github.com/receptron/graphai",
|
|
53
|
+
license: "MIT",
|
|
54
|
+
};
|
|
55
|
+
exports.default = stringEmbeddingsAgentInfo;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapAgent = exports.nestedAgent = void 0;
|
|
4
|
+
var nested_agent_1 = require("../../experimental_agents/graph_agents/nested_agent");
|
|
5
|
+
Object.defineProperty(exports, "nestedAgent", { enumerable: true, get: function () { return nested_agent_1.nestedAgent; } });
|
|
6
|
+
var map_agent_1 = require("../../experimental_agents/graph_agents/map_agent");
|
|
7
|
+
Object.defineProperty(exports, "mapAgent", { enumerable: true, get: function () { return map_agent_1.mapAgent; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AgentFunction } from "../../graphai";
|
|
2
|
+
export declare const mapAgent: AgentFunction<{
|
|
3
|
+
injectionTo?: Array<string>;
|
|
4
|
+
}, Record<string, Array<any>>, any>;
|
|
5
|
+
declare const mapAgentInfo: {
|
|
6
|
+
name: string;
|
|
7
|
+
agent: AgentFunction<{
|
|
8
|
+
injectionTo?: string[] | undefined;
|
|
9
|
+
}, Record<string, any[]>, any>;
|
|
10
|
+
mock: AgentFunction<{
|
|
11
|
+
injectionTo?: string[] | undefined;
|
|
12
|
+
}, Record<string, any[]>, any>;
|
|
13
|
+
samples: never[];
|
|
14
|
+
description: string;
|
|
15
|
+
category: never[];
|
|
16
|
+
author: string;
|
|
17
|
+
repository: string;
|
|
18
|
+
license: string;
|
|
19
|
+
};
|
|
20
|
+
export default mapAgentInfo;
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapAgent = void 0;
|
|
4
|
-
const graphai_1 = require("
|
|
5
|
-
const utils_1 = require("
|
|
4
|
+
const graphai_1 = require("../../graphai");
|
|
5
|
+
const utils_1 = require("../../utils/utils");
|
|
6
|
+
const nested_agent_1 = require("./nested_agent");
|
|
6
7
|
const mapAgent = async ({ params, inputs, agents, log, taskManager, graphData }) => {
|
|
7
8
|
if (taskManager) {
|
|
8
9
|
const status = taskManager.getStatus();
|
|
9
10
|
(0, utils_1.assert)(status.concurrency > status.running, `mapAgent: Concurrency is too low: ${status.concurrency}`);
|
|
10
11
|
}
|
|
11
|
-
(0,
|
|
12
|
+
const nestedGraphData = (0, nested_agent_1.getNestedGraphData)(graphData, inputs);
|
|
12
13
|
const input = Array.isArray(inputs[0]) ? inputs[0] : inputs;
|
|
13
|
-
const injectionTo = params.injectionTo ??
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const injectionTo = params.injectionTo ??
|
|
15
|
+
inputs.map((__input, index) => {
|
|
16
|
+
return `$${index}`;
|
|
17
|
+
});
|
|
18
|
+
injectionTo.forEach((nodeId) => {
|
|
19
|
+
if (nestedGraphData.nodes[nodeId] === undefined) {
|
|
20
|
+
// If the input node does not exist, automatically create a static node
|
|
21
|
+
nestedGraphData.nodes[nodeId] = { value: {} };
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
const graphs = input.map((data) => {
|
|
19
|
-
const graphAI = new graphai_1.GraphAI(
|
|
20
|
-
|
|
25
|
+
const graphAI = new graphai_1.GraphAI(nestedGraphData, agents || {}, taskManager);
|
|
26
|
+
// Only the first input will be mapped
|
|
27
|
+
injectionTo.forEach((injectToNodeId, index) => {
|
|
28
|
+
graphAI.injectValue(injectToNodeId, index === 0 ? data : inputs[index], "__mapAgent_inputs__");
|
|
29
|
+
});
|
|
21
30
|
return graphAI;
|
|
22
31
|
});
|
|
23
32
|
const runs = graphs.map((graph) => {
|
|
@@ -44,3 +53,15 @@ const mapAgent = async ({ params, inputs, agents, log, taskManager, graphData })
|
|
|
44
53
|
return compositeResult;
|
|
45
54
|
};
|
|
46
55
|
exports.mapAgent = mapAgent;
|
|
56
|
+
const mapAgentInfo = {
|
|
57
|
+
name: "mapAgent",
|
|
58
|
+
agent: exports.mapAgent,
|
|
59
|
+
mock: exports.mapAgent,
|
|
60
|
+
samples: [],
|
|
61
|
+
description: "Map Agent",
|
|
62
|
+
category: [],
|
|
63
|
+
author: "Receptron team",
|
|
64
|
+
repository: "https://github.com/receptron/graphai",
|
|
65
|
+
license: "MIT",
|
|
66
|
+
};
|
|
67
|
+
exports.default = mapAgentInfo;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AgentFunction } from "../../graphai";
|
|
2
|
+
import { GraphData } from "../../type";
|
|
3
|
+
export declare const getNestedGraphData: (graphData: GraphData | string | undefined, inputs: Array<any>) => GraphData;
|
|
4
|
+
export declare const nestedAgent: AgentFunction<{
|
|
5
|
+
injectionTo?: Array<string>;
|
|
6
|
+
}>;
|
|
7
|
+
declare const nestedAgentInfo: {
|
|
8
|
+
name: string;
|
|
9
|
+
agent: AgentFunction<{
|
|
10
|
+
injectionTo?: string[] | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
mock: AgentFunction<{
|
|
13
|
+
injectionTo?: string[] | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
samples: never[];
|
|
16
|
+
description: string;
|
|
17
|
+
category: never[];
|
|
18
|
+
author: string;
|
|
19
|
+
repository: string;
|
|
20
|
+
license: string;
|
|
21
|
+
};
|
|
22
|
+
export default nestedAgentInfo;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nestedAgent = exports.getNestedGraphData = void 0;
|
|
4
|
+
const graphai_1 = require("../../graphai");
|
|
5
|
+
const utils_1 = require("../../utils/utils");
|
|
6
|
+
// This function allows us to use one of inputs as the graph data for this nested agent,
|
|
7
|
+
// which is equivalent to "eval" of JavaScript.
|
|
8
|
+
const getNestedGraphData = (graphData, inputs) => {
|
|
9
|
+
(0, utils_1.assert)(graphData !== undefined, "nestedAgent: graphData is required");
|
|
10
|
+
if (typeof graphData === "string") {
|
|
11
|
+
const regex = /^\$(\d+)$/;
|
|
12
|
+
const match = graphData.match(regex);
|
|
13
|
+
if (match) {
|
|
14
|
+
const index = parseInt(match[1], 10);
|
|
15
|
+
if (index < inputs.length) {
|
|
16
|
+
return inputs[index];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
(0, utils_1.assert)(false, `getNestedGraphData: Invalid graphData string: ${graphData}`);
|
|
20
|
+
}
|
|
21
|
+
return graphData;
|
|
22
|
+
};
|
|
23
|
+
exports.getNestedGraphData = getNestedGraphData;
|
|
24
|
+
const nestedAgent = async ({ params, inputs, agents, log, taskManager, graphData }) => {
|
|
25
|
+
if (taskManager) {
|
|
26
|
+
const status = taskManager.getStatus(false);
|
|
27
|
+
(0, utils_1.assert)(status.concurrency > status.running, `nestedAgent: Concurrency is too low: ${status.concurrency}`);
|
|
28
|
+
}
|
|
29
|
+
const nestedGraphData = (0, exports.getNestedGraphData)(graphData, inputs);
|
|
30
|
+
const injectionTo = params.injectionTo ??
|
|
31
|
+
inputs.map((__input, index) => {
|
|
32
|
+
return `$${index}`;
|
|
33
|
+
});
|
|
34
|
+
injectionTo.forEach((nodeId) => {
|
|
35
|
+
if (nestedGraphData.nodes[nodeId] === undefined) {
|
|
36
|
+
// If the input node does not exist, automatically create a static node
|
|
37
|
+
nestedGraphData.nodes[nodeId] = { value: {} };
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const graphAI = new graphai_1.GraphAI(nestedGraphData, agents || {}, taskManager);
|
|
41
|
+
try {
|
|
42
|
+
// Inject inputs to specified source nodes
|
|
43
|
+
injectionTo.forEach((injectToNodeId, index) => {
|
|
44
|
+
graphAI.injectValue(injectToNodeId, inputs[index]);
|
|
45
|
+
});
|
|
46
|
+
const results = await graphAI.run(false);
|
|
47
|
+
log?.push(...graphAI.transactionLogs());
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
log?.push(...graphAI.transactionLogs());
|
|
52
|
+
if (error instanceof Error) {
|
|
53
|
+
console.log("Error:", error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.nestedAgent = nestedAgent;
|
|
59
|
+
const nestedAgentInfo = {
|
|
60
|
+
name: "nestedAgent",
|
|
61
|
+
agent: exports.nestedAgent,
|
|
62
|
+
mock: exports.nestedAgent,
|
|
63
|
+
samples: [],
|
|
64
|
+
description: "nested Agent",
|
|
65
|
+
category: [],
|
|
66
|
+
author: "Receptron team",
|
|
67
|
+
repository: "https://github.com/receptron/graphai",
|
|
68
|
+
license: "MIT",
|
|
69
|
+
};
|
|
70
|
+
exports.default = nestedAgentInfo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mapAgent = exports.nestedAgent = void 0;
|
|
7
|
+
const nested_agent_1 = __importDefault(require("../../experimental_agents/graph_agents/nested_agent"));
|
|
8
|
+
exports.nestedAgent = nested_agent_1.default;
|
|
9
|
+
const map_agent_1 = __importDefault(require("../../experimental_agents/graph_agents/map_agent"));
|
|
10
|
+
exports.mapAgent = map_agent_1.default;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export * from "./string_agents";
|
|
2
|
-
export * from "./slashgpt_agent";
|
|
3
2
|
export * from "./sleeper_agents";
|
|
4
3
|
export * from "./data_agents";
|
|
5
|
-
export * from "./nested_agent";
|
|
6
4
|
export * from "./array_agents";
|
|
7
|
-
export * from "./embedding_agent";
|
|
8
5
|
export * from "./matrix_agents";
|
|
9
|
-
export * from "./token_agent";
|
|
10
6
|
export * from "./test_agents";
|
|
11
|
-
export * from "./
|
|
7
|
+
export * from "./graph_agents";
|
|
8
|
+
export * from "./slashgpt_agent";
|
|
9
|
+
export * from "./embedding_agent";
|
|
10
|
+
export * from "./token_agent";
|
|
@@ -15,13 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./string_agents"), exports);
|
|
18
|
-
__exportStar(require("./slashgpt_agent"), exports);
|
|
19
18
|
__exportStar(require("./sleeper_agents"), exports);
|
|
20
19
|
__exportStar(require("./data_agents"), exports);
|
|
21
|
-
__exportStar(require("./nested_agent"), exports);
|
|
22
20
|
__exportStar(require("./array_agents"), exports);
|
|
23
|
-
__exportStar(require("./embedding_agent"), exports);
|
|
24
21
|
__exportStar(require("./matrix_agents"), exports);
|
|
25
|
-
__exportStar(require("./token_agent"), exports);
|
|
26
22
|
__exportStar(require("./test_agents"), exports);
|
|
27
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./graph_agents"), exports);
|
|
24
|
+
__exportStar(require("./slashgpt_agent"), exports);
|
|
25
|
+
__exportStar(require("./embedding_agent"), exports);
|
|
26
|
+
__exportStar(require("./token_agent"), exports);
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { AgentFunction } from "../../graphai";
|
|
2
|
-
export declare const dotProductAgent: AgentFunction<Record<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const dotProductAgent: AgentFunction<Record<never, never>, Array<number>, Array<Array<number>>>;
|
|
3
|
+
declare const dotProductAgentInfo: {
|
|
4
|
+
name: string;
|
|
5
|
+
agent: AgentFunction<Record<never, never>, number[], number[][]>;
|
|
6
|
+
mock: AgentFunction<Record<never, never>, number[], number[][]>;
|
|
7
|
+
samples: {
|
|
8
|
+
inputs: number[][][];
|
|
9
|
+
params: {};
|
|
10
|
+
result: number[];
|
|
11
|
+
}[];
|
|
12
|
+
description: string;
|
|
13
|
+
category: never[];
|
|
14
|
+
author: string;
|
|
15
|
+
repository: string;
|
|
16
|
+
license: string;
|
|
17
|
+
};
|
|
18
|
+
export default dotProductAgentInfo;
|
|
@@ -19,6 +19,31 @@ const dotProductAgent = async ({ inputs }) => {
|
|
|
19
19
|
return dotProduct + value * reference[index];
|
|
20
20
|
}, 0);
|
|
21
21
|
});
|
|
22
|
-
return
|
|
22
|
+
return contents;
|
|
23
23
|
};
|
|
24
24
|
exports.dotProductAgent = dotProductAgent;
|
|
25
|
+
const dotProductAgentInfo = {
|
|
26
|
+
name: "dotProductAgent",
|
|
27
|
+
agent: exports.dotProductAgent,
|
|
28
|
+
mock: exports.dotProductAgent,
|
|
29
|
+
samples: [
|
|
30
|
+
{
|
|
31
|
+
inputs: [
|
|
32
|
+
[
|
|
33
|
+
[1, 2],
|
|
34
|
+
[3, 4],
|
|
35
|
+
[5, 6],
|
|
36
|
+
],
|
|
37
|
+
[[3, 2]],
|
|
38
|
+
],
|
|
39
|
+
params: {},
|
|
40
|
+
result: [7, 17, 27],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
description: "dotProduct Agent",
|
|
44
|
+
category: [],
|
|
45
|
+
author: "Receptron team",
|
|
46
|
+
repository: "https://github.com/receptron/graphai",
|
|
47
|
+
license: "MIT",
|
|
48
|
+
};
|
|
49
|
+
exports.default = dotProductAgentInfo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sortByValuesAgent = exports.dotProductAgent = void 0;
|
|
7
|
+
const dot_product_agent_1 = __importDefault(require("../../experimental_agents/matrix_agents/dot_product_agent"));
|
|
8
|
+
exports.dotProductAgent = dot_product_agent_1.default;
|
|
9
|
+
const sort_by_values_agent_1 = __importDefault(require("../../experimental_agents/matrix_agents/sort_by_values_agent"));
|
|
10
|
+
exports.sortByValuesAgent = sort_by_values_agent_1.default;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { AgentFunction } from "../../graphai";
|
|
2
2
|
export declare const sortByValuesAgent: AgentFunction<{
|
|
3
3
|
assendant?: boolean;
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
}, Array<any>, Array<any>>;
|
|
5
|
+
declare const sortByValuesAgentInfo: {
|
|
6
|
+
name: string;
|
|
7
|
+
agent: AgentFunction<{
|
|
8
|
+
assendant?: boolean | undefined;
|
|
9
|
+
}, any[], any[]>;
|
|
10
|
+
mock: AgentFunction<{
|
|
11
|
+
assendant?: boolean | undefined;
|
|
12
|
+
}, any[], any[]>;
|
|
13
|
+
samples: never[];
|
|
14
|
+
description: string;
|
|
15
|
+
category: never[];
|
|
16
|
+
author: string;
|
|
17
|
+
repository: string;
|
|
18
|
+
license: string;
|
|
19
|
+
};
|
|
20
|
+
export default sortByValuesAgentInfo;
|
|
@@ -24,6 +24,18 @@ const sortByValuesAgent = async ({ params, inputs }) => {
|
|
|
24
24
|
.map((a) => {
|
|
25
25
|
return a.item;
|
|
26
26
|
});
|
|
27
|
-
return
|
|
27
|
+
return contents;
|
|
28
28
|
};
|
|
29
29
|
exports.sortByValuesAgent = sortByValuesAgent;
|
|
30
|
+
const sortByValuesAgentInfo = {
|
|
31
|
+
name: "sortByValuesAgent",
|
|
32
|
+
agent: exports.sortByValuesAgent,
|
|
33
|
+
mock: exports.sortByValuesAgent,
|
|
34
|
+
samples: [],
|
|
35
|
+
description: "sortByValues Agent",
|
|
36
|
+
category: [],
|
|
37
|
+
author: "Receptron team",
|
|
38
|
+
repository: "https://github.com/receptron/graphai",
|
|
39
|
+
license: "MIT",
|
|
40
|
+
};
|
|
41
|
+
exports.default = sortByValuesAgentInfo;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./string_agents/packages";
|
|
2
|
+
export * from "./sleeper_agents/packages";
|
|
3
|
+
export * from "./data_agents/packages";
|
|
4
|
+
export * from "./array_agents/packages";
|
|
5
|
+
export * from "./matrix_agents/packages";
|
|
6
|
+
export * from "./test_agents/packages";
|
|
7
|
+
export * from "./graph_agents/packages";
|
|
8
|
+
import slashGPTAgent from "./slashgpt_agent";
|
|
9
|
+
import stringEmbeddingsAgent from "./embedding_agent";
|
|
10
|
+
import tokenBoundStringsAgent from "./token_agent";
|
|
11
|
+
export { slashGPTAgent, stringEmbeddingsAgent, tokenBoundStringsAgent };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.tokenBoundStringsAgent = exports.stringEmbeddingsAgent = exports.slashGPTAgent = void 0;
|
|
21
|
+
__exportStar(require("./string_agents/packages"), exports);
|
|
22
|
+
__exportStar(require("./sleeper_agents/packages"), exports);
|
|
23
|
+
__exportStar(require("./data_agents/packages"), exports);
|
|
24
|
+
__exportStar(require("./array_agents/packages"), exports);
|
|
25
|
+
__exportStar(require("./matrix_agents/packages"), exports);
|
|
26
|
+
__exportStar(require("./test_agents/packages"), exports);
|
|
27
|
+
__exportStar(require("./graph_agents/packages"), exports);
|
|
28
|
+
const slashgpt_agent_1 = __importDefault(require("./slashgpt_agent"));
|
|
29
|
+
exports.slashGPTAgent = slashgpt_agent_1.default;
|
|
30
|
+
const embedding_agent_1 = __importDefault(require("./embedding_agent"));
|
|
31
|
+
exports.stringEmbeddingsAgent = embedding_agent_1.default;
|
|
32
|
+
const token_agent_1 = __importDefault(require("./token_agent"));
|
|
33
|
+
exports.tokenBoundStringsAgent = token_agent_1.default;
|
|
@@ -7,3 +7,27 @@ export declare const slashGPTAgent: AgentFunction<{
|
|
|
7
7
|
}, {
|
|
8
8
|
content: string;
|
|
9
9
|
}, string>;
|
|
10
|
+
declare const slashGPTAgentInfo: {
|
|
11
|
+
name: string;
|
|
12
|
+
agent: AgentFunction<{
|
|
13
|
+
manifest: ManifestData;
|
|
14
|
+
query?: string | undefined;
|
|
15
|
+
function_result?: boolean | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
content: string;
|
|
18
|
+
}, string>;
|
|
19
|
+
mock: AgentFunction<{
|
|
20
|
+
manifest: ManifestData;
|
|
21
|
+
query?: string | undefined;
|
|
22
|
+
function_result?: boolean | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
content: string;
|
|
25
|
+
}, string>;
|
|
26
|
+
samples: never[];
|
|
27
|
+
description: string;
|
|
28
|
+
category: never[];
|
|
29
|
+
author: string;
|
|
30
|
+
repository: string;
|
|
31
|
+
license: string;
|
|
32
|
+
};
|
|
33
|
+
export default slashGPTAgentInfo;
|
|
@@ -28,3 +28,15 @@ const slashGPTAgent = async ({ params, inputs, debugInfo: { verbose, nodeId } })
|
|
|
28
28
|
return message;
|
|
29
29
|
};
|
|
30
30
|
exports.slashGPTAgent = slashGPTAgent;
|
|
31
|
+
const slashGPTAgentInfo = {
|
|
32
|
+
name: "slashGPTAgent",
|
|
33
|
+
agent: exports.slashGPTAgent,
|
|
34
|
+
mock: exports.slashGPTAgent,
|
|
35
|
+
samples: [],
|
|
36
|
+
description: "Slash GPT Agent",
|
|
37
|
+
category: [],
|
|
38
|
+
author: "Receptron team",
|
|
39
|
+
repository: "https://github.com/receptron/graphai",
|
|
40
|
+
license: "MIT",
|
|
41
|
+
};
|
|
42
|
+
exports.default = slashGPTAgentInfo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sleeperAgentDebug = exports.sleeperAgent = void 0;
|
|
7
|
+
const sleeper_agent_1 = __importDefault(require("../../experimental_agents/sleeper_agents/sleeper_agent"));
|
|
8
|
+
exports.sleeperAgent = sleeper_agent_1.default;
|
|
9
|
+
const sleeper_agent_debug_1 = __importDefault(require("../../experimental_agents/sleeper_agents/sleeper_agent_debug"));
|
|
10
|
+
exports.sleeperAgentDebug = sleeper_agent_debug_1.default;
|
|
@@ -3,3 +3,21 @@ export declare const sleeperAgent: AgentFunction<{
|
|
|
3
3
|
duration?: number;
|
|
4
4
|
value?: Record<string, any>;
|
|
5
5
|
}>;
|
|
6
|
+
declare const sleeperAgentInfo: {
|
|
7
|
+
name: string;
|
|
8
|
+
agent: AgentFunction<{
|
|
9
|
+
duration?: number | undefined;
|
|
10
|
+
value?: Record<string, any> | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
mock: AgentFunction<{
|
|
13
|
+
duration?: number | undefined;
|
|
14
|
+
value?: Record<string, any> | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
samples: never[];
|
|
17
|
+
description: string;
|
|
18
|
+
category: never[];
|
|
19
|
+
author: string;
|
|
20
|
+
repository: string;
|
|
21
|
+
license: string;
|
|
22
|
+
};
|
|
23
|
+
export default sleeperAgentInfo;
|
|
@@ -14,3 +14,15 @@ const sleeperAgent = async (context) => {
|
|
|
14
14
|
}, params.value ?? {});
|
|
15
15
|
};
|
|
16
16
|
exports.sleeperAgent = sleeperAgent;
|
|
17
|
+
const sleeperAgentInfo = {
|
|
18
|
+
name: "sleeperAgent",
|
|
19
|
+
agent: exports.sleeperAgent,
|
|
20
|
+
mock: exports.sleeperAgent,
|
|
21
|
+
samples: [],
|
|
22
|
+
description: "sleeper Agent",
|
|
23
|
+
category: [],
|
|
24
|
+
author: "Receptron team",
|
|
25
|
+
repository: "https://github.com/receptron/graphai",
|
|
26
|
+
license: "MIT",
|
|
27
|
+
};
|
|
28
|
+
exports.default = sleeperAgentInfo;
|
|
@@ -4,3 +4,23 @@ export declare const sleeperAgentDebug: AgentFunction<{
|
|
|
4
4
|
value?: Record<string, any>;
|
|
5
5
|
fail?: boolean;
|
|
6
6
|
}>;
|
|
7
|
+
declare const sleeperAgentDebugInfo: {
|
|
8
|
+
name: string;
|
|
9
|
+
agent: AgentFunction<{
|
|
10
|
+
duration: number;
|
|
11
|
+
value?: Record<string, any> | undefined;
|
|
12
|
+
fail?: boolean | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
mock: AgentFunction<{
|
|
15
|
+
duration: number;
|
|
16
|
+
value?: Record<string, any> | undefined;
|
|
17
|
+
fail?: boolean | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
samples: never[];
|
|
20
|
+
description: string;
|
|
21
|
+
category: never[];
|
|
22
|
+
author: string;
|
|
23
|
+
repository: string;
|
|
24
|
+
license: string;
|
|
25
|
+
};
|
|
26
|
+
export default sleeperAgentDebugInfo;
|
|
@@ -10,10 +10,22 @@ const sleeperAgentDebug = async ({ params, inputs, debugInfo: { retry }, }) => {
|
|
|
10
10
|
await (0, utils_1.sleep)(params.duration / (retry + 1));
|
|
11
11
|
if (params.fail && retry < 2) {
|
|
12
12
|
// console.log("failed (intentional)", nodeId, retry);
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error(utils_1.strIntentionalError);
|
|
14
14
|
}
|
|
15
15
|
return inputs.reduce((result, input) => {
|
|
16
16
|
return (0, deepmerge_1.default)(result, input);
|
|
17
17
|
}, params.value ?? {});
|
|
18
18
|
};
|
|
19
19
|
exports.sleeperAgentDebug = sleeperAgentDebug;
|
|
20
|
+
const sleeperAgentDebugInfo = {
|
|
21
|
+
name: "sleeperAgentDebug",
|
|
22
|
+
agent: exports.sleeperAgentDebug,
|
|
23
|
+
mock: exports.sleeperAgentDebug,
|
|
24
|
+
samples: [],
|
|
25
|
+
description: "sleeper debug Agent",
|
|
26
|
+
category: [],
|
|
27
|
+
author: "Receptron team",
|
|
28
|
+
repository: "https://github.com/receptron/graphai",
|
|
29
|
+
license: "MIT",
|
|
30
|
+
};
|
|
31
|
+
exports.default = sleeperAgentDebugInfo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.stringTemplateAgent = exports.stringSplitterAgent = void 0;
|
|
7
|
+
const string_splitter_agent_1 = __importDefault(require("../../experimental_agents/string_agents/string_splitter_agent"));
|
|
8
|
+
exports.stringSplitterAgent = string_splitter_agent_1.default;
|
|
9
|
+
const string_template_agent_1 = __importDefault(require("../../experimental_agents/string_agents/string_template_agent"));
|
|
10
|
+
exports.stringTemplateAgent = string_template_agent_1.default;
|