@ai.ntellect/core 0.2.5 ā 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/agent/index.ts +4 -4
- package/dist/agent/index.js +4 -4
- package/dist/llm/evaluator/index.js +2 -2
- package/llm/evaluator/index.ts +2 -3
- package/package.json +1 -1
package/agent/index.ts
CHANGED
@@ -92,10 +92,10 @@ export class Agent {
|
|
92
92
|
}
|
93
93
|
);
|
94
94
|
|
95
|
-
this.accumulatedResults = [
|
95
|
+
this.accumulatedResults = this.formatResults([
|
96
96
|
...this.accumulatedResults,
|
97
97
|
...actionsResult.data,
|
98
|
-
];
|
98
|
+
]);
|
99
99
|
|
100
100
|
const isOnChainAction = actions.some(
|
101
101
|
(action) => action.type === "on-chain"
|
@@ -155,12 +155,12 @@ export class Agent {
|
|
155
155
|
? (
|
156
156
|
await synthesizer.streamProcess(
|
157
157
|
actionsResult.initialPrompt,
|
158
|
-
|
158
|
+
actionsResult.data
|
159
159
|
)
|
160
160
|
).toDataStreamResponse()
|
161
161
|
: await synthesizer.process(
|
162
162
|
actionsResult.initialPrompt,
|
163
|
-
|
163
|
+
actionsResult.data
|
164
164
|
);
|
165
165
|
}
|
166
166
|
|
package/dist/agent/index.js
CHANGED
@@ -39,10 +39,10 @@ class Agent {
|
|
39
39
|
onQueueComplete: events.onQueueComplete,
|
40
40
|
onConfirmationRequired: events.onConfirmationRequired,
|
41
41
|
});
|
42
|
-
this.accumulatedResults = [
|
42
|
+
this.accumulatedResults = this.formatResults([
|
43
43
|
...this.accumulatedResults,
|
44
44
|
...actionsResult.data,
|
45
|
-
];
|
45
|
+
]);
|
46
46
|
const isOnChainAction = actions.some((action) => action.type === "on-chain");
|
47
47
|
if (isOnChainAction) {
|
48
48
|
return {
|
@@ -75,8 +75,8 @@ class Agent {
|
|
75
75
|
async handleActionResults(actionsResult) {
|
76
76
|
const synthesizer = new synthesizer_1.Synthesizer();
|
77
77
|
return this.stream
|
78
|
-
? (await synthesizer.streamProcess(actionsResult.initialPrompt,
|
79
|
-
: await synthesizer.process(actionsResult.initialPrompt,
|
78
|
+
? (await synthesizer.streamProcess(actionsResult.initialPrompt, actionsResult.data)).toDataStreamResponse()
|
79
|
+
: await synthesizer.process(actionsResult.initialPrompt, actionsResult.data);
|
80
80
|
}
|
81
81
|
transformActions(actions) {
|
82
82
|
let predefinedActions = queue_item_transformer_1.QueueItemTransformer.transformActionsToQueueItems(actions) || [];
|
@@ -27,6 +27,7 @@ class Evaluator {
|
|
27
27
|
# CURRENT_RESULTS: ${results.map((r) => r.result).join(", ")}
|
28
28
|
# STEPS: ${steps?.join("\n") || ""}
|
29
29
|
`;
|
30
|
+
console.log("Evaluator Context:", context);
|
30
31
|
return context;
|
31
32
|
}
|
32
33
|
async process(prompt, results) {
|
@@ -39,7 +40,6 @@ class Evaluator {
|
|
39
40
|
});
|
40
41
|
console.log("\nš Evaluator processing");
|
41
42
|
console.log("Goal:", prompt);
|
42
|
-
console.log("Results to evaluate:", JSON.stringify(results, null, 2));
|
43
43
|
const response = await (0, ai_1.generateObject)({
|
44
44
|
model: this.model,
|
45
45
|
schema: zod_1.z.object({
|
@@ -68,7 +68,7 @@ class Evaluator {
|
|
68
68
|
});
|
69
69
|
const validatedResponse = {
|
70
70
|
...response.object,
|
71
|
-
|
71
|
+
nextActionsNeeded: response.object.nextActionsNeeded.map((action) => ({
|
72
72
|
...action,
|
73
73
|
parameters: action.parameters || {},
|
74
74
|
})),
|
package/llm/evaluator/index.ts
CHANGED
@@ -31,7 +31,7 @@ export class Evaluator {
|
|
31
31
|
# CURRENT_RESULTS: ${results.map((r) => r.result).join(", ")}
|
32
32
|
# STEPS: ${steps?.join("\n") || ""}
|
33
33
|
`;
|
34
|
-
|
34
|
+
console.log("Evaluator Context:", context);
|
35
35
|
return context;
|
36
36
|
}
|
37
37
|
|
@@ -45,7 +45,6 @@ export class Evaluator {
|
|
45
45
|
});
|
46
46
|
console.log("\nš Evaluator processing");
|
47
47
|
console.log("Goal:", prompt);
|
48
|
-
console.log("Results to evaluate:", JSON.stringify(results, null, 2));
|
49
48
|
|
50
49
|
const response = await generateObject({
|
51
50
|
model: this.model,
|
@@ -82,7 +81,7 @@ export class Evaluator {
|
|
82
81
|
|
83
82
|
const validatedResponse = {
|
84
83
|
...response.object,
|
85
|
-
|
84
|
+
nextActionsNeeded: response.object.nextActionsNeeded.map((action) => ({
|
86
85
|
...action,
|
87
86
|
parameters: action.parameters || {},
|
88
87
|
})),
|