@ai.ntellect/core 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
package/agent/index.ts CHANGED
@@ -48,6 +48,8 @@ export class Agent {
48
48
  }
49
49
 
50
50
  async process(prompt: string, events: AgentEvent): Promise<any> {
51
+ this.accumulatedResults = [];
52
+ this.evaluatorIteration = 0;
51
53
  console.log("Requesting orchestrator for actions..");
52
54
  const request = await this.orchestrator.process(
53
55
  prompt,
@@ -170,9 +172,6 @@ export class Agent {
170
172
  }
171
173
 
172
174
  const accumulatedResults = this.accumulatedResults;
173
- this.accumulatedResults = [];
174
- this.evaluatorIteration = 0;
175
-
176
175
  return this.stream
177
176
  ? (
178
177
  await synthesizer.streamProcess(
@@ -19,6 +19,8 @@ class Agent {
19
19
  this.accumulatedResults = [];
20
20
  }
21
21
  async process(prompt, events) {
22
+ this.accumulatedResults = [];
23
+ this.evaluatorIteration = 0;
22
24
  console.log("Requesting orchestrator for actions..");
23
25
  const request = await this.orchestrator.process(prompt, this.accumulatedResults);
24
26
  events.onMessage?.(request);
@@ -86,8 +88,6 @@ class Agent {
86
88
  }
87
89
  }
88
90
  const accumulatedResults = this.accumulatedResults;
89
- this.accumulatedResults = [];
90
- this.evaluatorIteration = 0;
91
91
  return this.stream
92
92
  ? (await synthesizer.streamProcess(actionsResult.initialPrompt, accumulatedResults)).toDataStreamResponse()
93
93
  : await synthesizer.process(actionsResult.initialPrompt, accumulatedResults);
@@ -43,6 +43,8 @@ class Evaluator {
43
43
  const response = await (0, ai_1.generateObject)({
44
44
  model: this.model,
45
45
  schema: zod_1.z.object({
46
+ actionsCompleted: zod_1.z.array(zod_1.z.string()),
47
+ actionsFailed: zod_1.z.array(zod_1.z.string()),
46
48
  isRemindNeeded: zod_1.z.boolean(),
47
49
  importantToRemembers: zod_1.z.array(zod_1.z.object({
48
50
  memoryType: zod_1.z.string(),
@@ -26,6 +26,7 @@ class Synthesizer {
26
26
  # STEPS: ${steps?.join("\n") || ""}
27
27
  # MESSAGES EXAMPLES: ${JSON.stringify(examplesMessages, null, 2)}
28
28
  `;
29
+ console.log("Synthesizer Context:", context);
29
30
  return context;
30
31
  }
31
32
  async process(prompt, results, onFinish) {
@@ -50,6 +50,8 @@ export class Evaluator {
50
50
  const response = await generateObject({
51
51
  model: this.model,
52
52
  schema: z.object({
53
+ actionsCompleted: z.array(z.string()),
54
+ actionsFailed: z.array(z.string()),
53
55
  isRemindNeeded: z.boolean(),
54
56
  importantToRemembers: z.array(
55
57
  z.object({
@@ -26,7 +26,7 @@ export class Synthesizer {
26
26
  # STEPS: ${steps?.join("\n") || ""}
27
27
  # MESSAGES EXAMPLES: ${JSON.stringify(examplesMessages, null, 2)}
28
28
  `;
29
-
29
+ console.log("Synthesizer Context:", context);
30
30
  return context;
31
31
  }
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai.ntellect/core",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {