@aigne/core 0.4.204 → 0.4.205-1
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/cjs/agent.js +60 -0
- package/lib/cjs/definitions/data-type-schema.js +46 -0
- package/lib/cjs/definitions/memory.js +21 -0
- package/lib/cjs/function-agent.js +1 -1
- package/lib/cjs/function-runner.js +2 -2
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/llm-agent.js +93 -87
- package/lib/cjs/llm-decision-agent.js +40 -33
- package/lib/cjs/llm-model.js +2 -2
- package/lib/cjs/local-function-agent.js +11 -9
- package/lib/cjs/memorable.js +32 -0
- package/lib/cjs/pipeline-agent.js +2 -4
- package/lib/cjs/runnable.js +3 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/message-utils.js +72 -0
- package/lib/cjs/utils/nullable.js +2 -0
- package/lib/cjs/utils/ordered-map.js +25 -0
- package/lib/cjs/utils/stream-utils.js +43 -5
- package/lib/cjs/utils/structured-output-schema.js +39 -0
- package/lib/esm/agent.js +53 -0
- package/lib/esm/definitions/data-type-schema.js +43 -0
- package/lib/esm/definitions/memory.js +18 -0
- package/lib/esm/function-agent.js +1 -1
- package/lib/esm/function-runner.js +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/llm-agent.js +94 -88
- package/lib/esm/llm-decision-agent.js +41 -34
- package/lib/esm/llm-model.js +2 -2
- package/lib/esm/local-function-agent.js +11 -9
- package/lib/esm/memorable.js +27 -0
- package/lib/esm/pipeline-agent.js +2 -4
- package/lib/esm/runnable.js +3 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/message-utils.js +64 -0
- package/lib/esm/utils/nullable.js +1 -0
- package/lib/esm/utils/ordered-map.js +25 -0
- package/lib/esm/utils/stream-utils.js +42 -5
- package/lib/esm/utils/structured-output-schema.js +33 -0
- package/lib/types/agent.d.ts +42 -0
- package/lib/types/context.d.ts +5 -1
- package/lib/types/definitions/data-type-schema.d.ts +40 -0
- package/lib/types/definitions/memory.d.ts +40 -0
- package/lib/types/function-agent.d.ts +1 -1
- package/lib/types/function-runner.d.ts +2 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/llm-agent.d.ts +74 -19
- package/lib/types/llm-decision-agent.d.ts +54 -30
- package/lib/types/llm-model.d.ts +2 -1
- package/lib/types/local-function-agent.d.ts +51 -20
- package/lib/types/memorable.d.ts +183 -0
- package/lib/types/pipeline-agent.d.ts +2 -3
- package/lib/types/runnable.d.ts +23 -2
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/message-utils.d.ts +20 -0
- package/lib/types/utils/nullable.d.ts +7 -0
- package/lib/types/utils/ordered-map.d.ts +6 -0
- package/lib/types/utils/stream-utils.d.ts +12 -1
- package/lib/types/utils/structured-output-schema.d.ts +3 -0
- package/lib/types/utils/union.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ const lodash_1 = require("lodash");
|
|
|
22
22
|
const nanoid_1 = require("nanoid");
|
|
23
23
|
const tsyringe_1 = require("tsyringe");
|
|
24
24
|
const constants_1 = require("./constants");
|
|
25
|
-
const data_type_schema_1 = require("./data-type-schema");
|
|
25
|
+
const data_type_schema_1 = require("./definitions/data-type-schema");
|
|
26
26
|
const logger_1 = __importDefault(require("./logger"));
|
|
27
27
|
const runnable_1 = require("./runnable");
|
|
28
28
|
const utils_1 = require("./utils");
|
|
@@ -30,15 +30,13 @@ const is_non_nullable_1 = require("./utils/is-non-nullable");
|
|
|
30
30
|
const ordered_map_1 = require("./utils/ordered-map");
|
|
31
31
|
let PipelineAgent = PipelineAgent_1 = class PipelineAgent extends runnable_1.Runnable {
|
|
32
32
|
definition;
|
|
33
|
-
context;
|
|
34
33
|
static create(options) {
|
|
35
34
|
const definition = createPipelineAgentDefinition(options);
|
|
36
35
|
return new PipelineAgent_1(definition);
|
|
37
36
|
}
|
|
38
37
|
constructor(definition, context) {
|
|
39
|
-
super(definition);
|
|
38
|
+
super(definition, context);
|
|
40
39
|
this.definition = definition;
|
|
41
|
-
this.context = context;
|
|
42
40
|
}
|
|
43
41
|
async run(input, options) {
|
|
44
42
|
// TODO: validate the input against the definition
|
package/lib/cjs/runnable.js
CHANGED
|
@@ -6,8 +6,10 @@ exports.isRunnableResponseError = isRunnableResponseError;
|
|
|
6
6
|
const ordered_map_1 = require("./utils/ordered-map");
|
|
7
7
|
class Runnable {
|
|
8
8
|
definition;
|
|
9
|
-
|
|
9
|
+
context;
|
|
10
|
+
constructor(definition, context) {
|
|
10
11
|
this.definition = definition;
|
|
12
|
+
this.context = context;
|
|
11
13
|
this.inputs = Object.fromEntries(ordered_map_1.OrderedRecord.map(definition.inputs, (i) => [i.name || i.id, i]));
|
|
12
14
|
this.outputs = Object.fromEntries(ordered_map_1.OrderedRecord.map(definition.outputs, (i) => [i.name || i.id, i]));
|
|
13
15
|
}
|