@ai.ntellect/core 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/agent/index.ts CHANGED
@@ -12,7 +12,6 @@ import {
12
12
  User,
13
13
  } from "../types";
14
14
  import { QueueItemTransformer } from "../utils/queue-item-transformer";
15
- import { ResultSanitizer } from "../utils/sanitize-results";
16
15
  import { ActionHandler } from "./handlers/ActionHandler";
17
16
 
18
17
  export class Agent {
@@ -158,13 +157,6 @@ export class Agent {
158
157
  initialPrompt: string;
159
158
  }) {
160
159
  const synthesizer = new Synthesizer();
161
- const sanitizedResults = ResultSanitizer.sanitize(this.accumulatedResults);
162
- const summaryData = JSON.stringify({
163
- result: sanitizedResults,
164
- });
165
-
166
- this.accumulatedResults = [];
167
- this.evaluatorIteration = 0;
168
160
 
169
161
  for (const action of actionsResult.data) {
170
162
  if (!action.error) {
@@ -177,16 +169,20 @@ export class Agent {
177
169
  }
178
170
  }
179
171
 
172
+ const accumulatedResults = this.accumulatedResults;
173
+ this.accumulatedResults = [];
174
+ this.evaluatorIteration = 0;
175
+
180
176
  return this.stream
181
177
  ? (
182
178
  await synthesizer.streamProcess(
183
179
  actionsResult.initialPrompt,
184
- this.accumulatedResults
180
+ accumulatedResults
185
181
  )
186
182
  ).toDataStreamResponse()
187
183
  : await synthesizer.process(
188
184
  actionsResult.initialPrompt,
189
- this.accumulatedResults
185
+ accumulatedResults
190
186
  );
191
187
  }
192
188
 
@@ -102,11 +102,11 @@ export class Synthesizer {
102
102
 
103
103
  const result = await streamText({
104
104
  model: this.model,
105
- prompt,
106
105
  onFinish: (event) => {
107
106
  console.log("\n✅ Streaming synthesis completed");
108
107
  if (onFinish) onFinish(event);
109
108
  },
109
+ prompt,
110
110
  system: context,
111
111
  });
112
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai.ntellect/core",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {