graphai 0.5.1 → 0.5.2
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 +1 -2
- package/lib/index.js +1 -3
- package/lib/type.d.ts +8 -6
- package/lib/type.js +1 -0
- package/package.json +1 -1
- package/lib/utils/runner.d.ts +0 -2
- package/lib/utils/runner.js +0 -20
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { GraphAI } from "./graphai";
|
|
2
|
-
export { AgentFunction, AgentFunctionInfo, AgentFunctionInfoDictionary, AgentFunctionContext, GraphData, ResultDataDictionary, ResultData, NodeState, AgentFilterFunction, AgentFilterInfo, NodeData, StaticNodeData, ComputedNodeData, DefaultResultData, DefaultInputData, } from "./type";
|
|
2
|
+
export { AgentFunction, AgentFunctionInfo, AgentFunctionInfoDictionary, AgentFunctionInfoSample, AgentFunctionContext, GraphData, ResultDataDictionary, ResultData, NodeState, AgentFilterFunction, AgentFilterInfo, NodeData, StaticNodeData, ComputedNodeData, DefaultResultData, DefaultInputData, } from "./type";
|
|
3
3
|
export type { TransactionLog } from "./transaction_log";
|
|
4
|
-
export { agentFilterRunnerBuilder } from "./utils/runner";
|
|
5
4
|
export { defaultAgentInfo, agentInfoWrapper, defaultTestContext, strIntentionalError, assert, sleep } from "./utils/utils";
|
|
6
5
|
export { ValidationError } from "./validators/common";
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidationError = exports.sleep = exports.assert = exports.strIntentionalError = exports.defaultTestContext = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.
|
|
3
|
+
exports.ValidationError = exports.sleep = exports.assert = exports.strIntentionalError = exports.defaultTestContext = exports.agentInfoWrapper = exports.defaultAgentInfo = 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
|
-
var runner_1 = require("./utils/runner");
|
|
9
|
-
Object.defineProperty(exports, "agentFilterRunnerBuilder", { enumerable: true, get: function () { return runner_1.agentFilterRunnerBuilder; } });
|
|
10
8
|
var utils_1 = require("./utils/utils");
|
|
11
9
|
Object.defineProperty(exports, "defaultAgentInfo", { enumerable: true, get: function () { return utils_1.defaultAgentInfo; } });
|
|
12
10
|
Object.defineProperty(exports, "agentInfoWrapper", { enumerable: true, get: function () { return utils_1.agentInfoWrapper; } });
|
package/lib/type.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare enum NodeState {
|
|
|
4
4
|
Waiting = "waiting",
|
|
5
5
|
Queued = "queued",
|
|
6
6
|
Executing = "executing",
|
|
7
|
+
ExecutingServer = "executing-server",
|
|
7
8
|
Failed = "failed",
|
|
8
9
|
TimedOut = "timed-out",
|
|
9
10
|
Completed = "completed",
|
|
@@ -89,18 +90,19 @@ export type AgentFilterInfo = {
|
|
|
89
90
|
nodeIds?: string[];
|
|
90
91
|
filterParams?: AgentFilterParams;
|
|
91
92
|
};
|
|
93
|
+
export type AgentFunctionInfoSample = {
|
|
94
|
+
inputs: any;
|
|
95
|
+
params: DefaultParamsType;
|
|
96
|
+
result: any;
|
|
97
|
+
graph?: GraphData;
|
|
98
|
+
};
|
|
92
99
|
export type AgentFunctionInfo = {
|
|
93
100
|
name: string;
|
|
94
101
|
agent: AgentFunction<any, any, any, any>;
|
|
95
102
|
mock: AgentFunction<any, any, any, any>;
|
|
96
103
|
inputs?: any;
|
|
97
104
|
output?: any;
|
|
98
|
-
samples:
|
|
99
|
-
inputs: any;
|
|
100
|
-
params: DefaultParamsType;
|
|
101
|
-
result: any;
|
|
102
|
-
graph?: GraphData;
|
|
103
|
-
}[];
|
|
105
|
+
samples: AgentFunctionInfoSample[];
|
|
104
106
|
description: string;
|
|
105
107
|
category: string[];
|
|
106
108
|
author: string;
|
package/lib/type.js
CHANGED
|
@@ -6,6 +6,7 @@ var NodeState;
|
|
|
6
6
|
NodeState["Waiting"] = "waiting";
|
|
7
7
|
NodeState["Queued"] = "queued";
|
|
8
8
|
NodeState["Executing"] = "executing";
|
|
9
|
+
NodeState["ExecutingServer"] = "executing-server";
|
|
9
10
|
NodeState["Failed"] = "failed";
|
|
10
11
|
NodeState["TimedOut"] = "timed-out";
|
|
11
12
|
NodeState["Completed"] = "completed";
|
package/package.json
CHANGED
package/lib/utils/runner.d.ts
DELETED
package/lib/utils/runner.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.agentFilterRunnerBuilder = void 0;
|
|
4
|
-
// for test and server.
|
|
5
|
-
const agentFilterRunnerBuilder = (__agentFilters) => {
|
|
6
|
-
const agentFilters = __agentFilters;
|
|
7
|
-
const agentFilterRunner = (context, agent) => {
|
|
8
|
-
let index = 0;
|
|
9
|
-
const next = (context) => {
|
|
10
|
-
const agentFilter = agentFilters[index++];
|
|
11
|
-
if (agentFilter) {
|
|
12
|
-
return agentFilter.agent(context, next);
|
|
13
|
-
}
|
|
14
|
-
return agent(context);
|
|
15
|
-
};
|
|
16
|
-
return next(context);
|
|
17
|
-
};
|
|
18
|
-
return agentFilterRunner;
|
|
19
|
-
};
|
|
20
|
-
exports.agentFilterRunnerBuilder = agentFilterRunnerBuilder;
|