graphai 0.4.5 → 0.4.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/index.d.ts +3 -1
- package/lib/index.js +8 -1
- package/lib/utils/utils.d.ts +11 -0
- package/lib/utils/utils.js +12 -1
- package/package.json +3 -31
- package/lib/experimental_agent_filters/stream.d.ts +0 -2
- package/lib/experimental_agent_filters/stream.js +0 -13
- package/lib/utils/test_utils.d.ts +0 -11
- package/lib/utils/test_utils.js +0 -14
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { GraphAI } from "./graphai";
|
|
2
|
-
export { AgentFunction, AgentFunctionInfo, AgentFunctionInfoDictionary, AgentFunctionContext, GraphData, ResultDataDictionary, ResultData, NodeState, AgentFilterFunction, AgentFilterInfo, StaticNodeData, } from "./type";
|
|
2
|
+
export { AgentFunction, AgentFunctionInfo, AgentFunctionInfoDictionary, AgentFunctionContext, GraphData, ResultDataDictionary, ResultData, NodeState, AgentFilterFunction, AgentFilterInfo, NodeData, StaticNodeData, ComputedNodeData, DefaultResultData, DefaultInputData, } from "./type";
|
|
3
3
|
export type { TransactionLog } from "./transaction_log";
|
|
4
4
|
export { agentFilterRunnerBuilder } from "./utils/runner";
|
|
5
|
+
export { defaultAgentInfo, agentInfoWrapper, defaultTestContext, strIntentionalError, } from "./utils/utils";
|
|
6
|
+
export { ValidationError } from "./validators/common";
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.agentFilterRunnerBuilder = exports.NodeState = exports.GraphAI = void 0;
|
|
3
|
+
exports.ValidationError = exports.strIntentionalError = exports.defaultTestContext = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.agentFilterRunnerBuilder = exports.NodeState = exports.GraphAI = void 0;
|
|
4
4
|
var graphai_1 = require("./graphai");
|
|
5
5
|
Object.defineProperty(exports, "GraphAI", { enumerable: true, get: function () { return graphai_1.GraphAI; } });
|
|
6
6
|
var type_1 = require("./type");
|
|
7
7
|
Object.defineProperty(exports, "NodeState", { enumerable: true, get: function () { return type_1.NodeState; } });
|
|
8
8
|
var runner_1 = require("./utils/runner");
|
|
9
9
|
Object.defineProperty(exports, "agentFilterRunnerBuilder", { enumerable: true, get: function () { return runner_1.agentFilterRunnerBuilder; } });
|
|
10
|
+
var utils_1 = require("./utils/utils");
|
|
11
|
+
Object.defineProperty(exports, "defaultAgentInfo", { enumerable: true, get: function () { return utils_1.defaultAgentInfo; } });
|
|
12
|
+
Object.defineProperty(exports, "agentInfoWrapper", { enumerable: true, get: function () { return utils_1.agentInfoWrapper; } });
|
|
13
|
+
Object.defineProperty(exports, "defaultTestContext", { enumerable: true, get: function () { return utils_1.defaultTestContext; } });
|
|
14
|
+
Object.defineProperty(exports, "strIntentionalError", { enumerable: true, get: function () { return utils_1.strIntentionalError; } });
|
|
15
|
+
var common_1 = require("./validators/common");
|
|
16
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return common_1.ValidationError; } });
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -35,3 +35,14 @@ export declare const agentInfoWrapper: (agent: AgentFunction<any, any, any>) =>
|
|
|
35
35
|
};
|
|
36
36
|
export declare const debugResultKey: (agentId: string, result: any) => string[];
|
|
37
37
|
export declare const isLogicallyTrue: (value: any) => boolean;
|
|
38
|
+
export declare const defaultTestContext: {
|
|
39
|
+
debugInfo: {
|
|
40
|
+
nodeId: string;
|
|
41
|
+
retry: number;
|
|
42
|
+
verbose: boolean;
|
|
43
|
+
};
|
|
44
|
+
params: {};
|
|
45
|
+
filterParams: {};
|
|
46
|
+
agents: {};
|
|
47
|
+
log: never[];
|
|
48
|
+
};
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLogicallyTrue = exports.debugResultKey = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.strIntentionalError = exports.getDataFromSource = exports.isObject = exports.assert = exports.parseNodeName = exports.sleep = void 0;
|
|
3
|
+
exports.defaultTestContext = exports.isLogicallyTrue = exports.debugResultKey = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.strIntentionalError = exports.getDataFromSource = exports.isObject = exports.assert = exports.parseNodeName = exports.sleep = void 0;
|
|
4
4
|
const sleep = async (milliseconds) => {
|
|
5
5
|
return await new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
6
6
|
};
|
|
@@ -155,3 +155,14 @@ const isLogicallyTrue = (value) => {
|
|
|
155
155
|
return true;
|
|
156
156
|
};
|
|
157
157
|
exports.isLogicallyTrue = isLogicallyTrue;
|
|
158
|
+
exports.defaultTestContext = {
|
|
159
|
+
debugInfo: {
|
|
160
|
+
nodeId: "test",
|
|
161
|
+
retry: 0,
|
|
162
|
+
verbose: true,
|
|
163
|
+
},
|
|
164
|
+
params: {},
|
|
165
|
+
filterParams: {},
|
|
166
|
+
agents: {},
|
|
167
|
+
log: [],
|
|
168
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphai",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Asynchronous data flow execution engine for agentic AI apps.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "rm -r lib/* && tsc && tsc-alias",
|
|
11
11
|
"eslint": "eslint",
|
|
12
|
-
"
|
|
12
|
+
"doc": " npx typedoc src/index.ts --out ../../docs/apiDoc",
|
|
13
13
|
"format": "prettier --write '{src,tests,samples}/**/*.ts'",
|
|
14
14
|
"test": "node --test -r tsconfig-paths/register --require ts-node/register ./tests/**/test_*.ts",
|
|
15
15
|
"b": "yarn run format && yarn run eslint && yarn run build"
|
|
@@ -25,35 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/receptron/graphai#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"@google/generative-ai": "^0.11.4",
|
|
30
|
-
"@graphai/vanilla": "^0.0.1",
|
|
31
|
-
"@inquirer/prompts": "^5.0.0",
|
|
32
|
-
"@types/cors": "^2.8.17",
|
|
33
|
-
"@types/express": "^4.17.21",
|
|
34
|
-
"@types/node": "^20.12.11",
|
|
35
|
-
"@types/xml2js": "^0.4.14",
|
|
36
|
-
"arxiv-api-ts": "^1.0.3",
|
|
37
|
-
"cors": "^2.8.5",
|
|
38
|
-
"deepmerge": "^4.3.1",
|
|
39
|
-
"dotenv": "^16.4.5",
|
|
40
|
-
"eslint": "^9.2.0",
|
|
41
|
-
"express": "^4.19.2",
|
|
42
|
-
"globals": "^15.2.0",
|
|
43
|
-
"groq-sdk": "^0.3.3",
|
|
44
|
-
"openai": "^4.47.1",
|
|
45
|
-
"prettier": "^3.2.5",
|
|
46
|
-
"slashgpt": "^0.0.9",
|
|
47
|
-
"tiktoken": "^1.0.14",
|
|
48
|
-
"ts-node": "^10.9.2",
|
|
49
|
-
"tsc-alias": "^1.8.8",
|
|
50
|
-
"tsconfig-paths": "^4.2.0",
|
|
51
|
-
"typedoc": "^0.25.13",
|
|
52
|
-
"typescript": "^5.4.5",
|
|
53
|
-
"typescript-eslint": "^7.8.0",
|
|
54
|
-
"wikipedia": "^2.1.2",
|
|
55
|
-
"xml2js": "^0.6.2",
|
|
56
|
-
"yaml": "^2.4.1"
|
|
28
|
+
"typedoc": "^0.25.13"
|
|
57
29
|
},
|
|
58
30
|
"types": "./lib/index.d.ts",
|
|
59
31
|
"directories": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.streamAgentFilterGenerator = void 0;
|
|
4
|
-
const streamAgentFilterGenerator = (callback) => {
|
|
5
|
-
const streamAgentFilter = async (context, next) => {
|
|
6
|
-
context.filterParams.streamTokenCallback = (data) => {
|
|
7
|
-
callback(context, data);
|
|
8
|
-
};
|
|
9
|
-
return next(context);
|
|
10
|
-
};
|
|
11
|
-
return streamAgentFilter;
|
|
12
|
-
};
|
|
13
|
-
exports.streamAgentFilterGenerator = streamAgentFilterGenerator;
|
package/lib/utils/test_utils.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultTestContext = void 0;
|
|
4
|
-
exports.defaultTestContext = {
|
|
5
|
-
debugInfo: {
|
|
6
|
-
nodeId: "test",
|
|
7
|
-
retry: 0,
|
|
8
|
-
verbose: true,
|
|
9
|
-
},
|
|
10
|
-
params: {},
|
|
11
|
-
filterParams: {},
|
|
12
|
-
agents: {},
|
|
13
|
-
log: [],
|
|
14
|
-
};
|