@ai.ntellect/core 0.2.0 → 0.2.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/agent/index.ts +6 -10
- package/llm/synthesizer/index.ts +1 -1
- package/package.json +1 -1
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
|
-
|
180
|
+
accumulatedResults
|
185
181
|
)
|
186
182
|
).toDataStreamResponse()
|
187
183
|
: await synthesizer.process(
|
188
184
|
actionsResult.initialPrompt,
|
189
|
-
|
185
|
+
accumulatedResults
|
190
186
|
);
|
191
187
|
}
|
192
188
|
|
package/llm/synthesizer/index.ts
CHANGED
@@ -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
|
|