@ai.ntellect/core 0.2.4 ā 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- package/agent/index.ts +0 -2
- package/dist/agent/index.js +0 -2
- package/dist/llm/evaluator/index.js +2 -2
- package/dist/llm/synthesizer/context.d.ts +4 -4
- package/dist/llm/synthesizer/context.js +37 -37
- package/llm/evaluator/index.ts +2 -3
- package/llm/synthesizer/context.ts +37 -37
- package/llm/synthesizer/index.ts +1 -0
- package/package.json +1 -1
package/agent/index.ts
CHANGED
@@ -119,8 +119,6 @@ export class Agent {
|
|
119
119
|
this.orchestrator.tools,
|
120
120
|
this.persistentMemory
|
121
121
|
);
|
122
|
-
console.log("Accumulated results:");
|
123
|
-
console.dir(this.accumulatedResults, { depth: null });
|
124
122
|
|
125
123
|
// const sanitizedResults = ResultSanitizer.sanitize(this.accumulatedResults);
|
126
124
|
const evaluation = await evaluator.process(
|
package/dist/agent/index.js
CHANGED
@@ -57,8 +57,6 @@ class Agent {
|
|
57
57
|
});
|
58
58
|
}
|
59
59
|
const evaluator = new evaluator_1.Evaluator(this.orchestrator.tools, this.persistentMemory);
|
60
|
-
console.log("Accumulated results:");
|
61
|
-
console.dir(this.accumulatedResults, { depth: null });
|
62
60
|
// const sanitizedResults = ResultSanitizer.sanitize(this.accumulatedResults);
|
63
61
|
const evaluation = await evaluator.process(initialPrompt, this.accumulatedResults);
|
64
62
|
events.onMessage?.(evaluation);
|
@@ -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
|
})),
|
@@ -25,47 +25,47 @@ exports.synthesizerContext = {
|
|
25
25
|
"Respond in the same language as the user request.",
|
26
26
|
],
|
27
27
|
},
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
},
|
29
|
+
examplesMessages: [
|
30
|
+
{
|
31
|
+
role: "user",
|
32
|
+
content: "Analysis security of token/coin",
|
33
|
+
},
|
34
|
+
{
|
35
|
+
role: "assistant",
|
36
|
+
content: `
|
37
|
+
## Security analysis of x/y:
|
38
|
+
|
39
|
+
### Good:
|
40
|
+
Speak about the good points of the security check. If there is no good point, say "No good point found"
|
40
41
|
|
41
|
-
|
42
|
-
|
42
|
+
### Bad:
|
43
|
+
Speak about the bad points of the security check. If there is no bad point, say "No bad point found"
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
45
|
+
STOP AFTER SECURITY CHECK SECTION WITHOUT ANY CONCLUDING STATEMENT OR DISCLAIMER OR ADDITIONAL COMMENTS
|
46
|
+
--------------------------------
|
47
|
+
`,
|
48
|
+
},
|
49
|
+
{
|
50
|
+
role: "user",
|
51
|
+
content: "Analysis market sentiment of token/coin",
|
52
|
+
},
|
53
|
+
{
|
54
|
+
role: "assistant",
|
55
|
+
content: `
|
56
|
+
## Analysis of x/y:
|
56
57
|
|
57
|
-
|
58
|
+
Market sentiment: Bullish š (Adapt the emoji to the market sentiment)
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
### Fundamental analysis (No sub-sections):
|
61
|
+
Speak about important events, news, trends..etc
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
### Technical analysis (No sub-sections):
|
64
|
+
Speak about key price levels, trading volume, technical indicators, market activity..etc
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
},
|
66
|
+
STOP AFTER TECHNICAL ANALYSIS SECTION WITHOUT ANY CONCLUDING STATEMENT OR DISCLAIMER OR ADDITIONAL COMMENTS
|
67
|
+
--------------------------------
|
68
|
+
`,
|
69
|
+
},
|
70
|
+
],
|
71
71
|
};
|
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
|
})),
|
@@ -22,47 +22,47 @@ export const synthesizerContext = {
|
|
22
22
|
"Respond in the same language as the user request.",
|
23
23
|
],
|
24
24
|
},
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
},
|
26
|
+
examplesMessages: [
|
27
|
+
{
|
28
|
+
role: "user",
|
29
|
+
content: "Analysis security of token/coin",
|
30
|
+
},
|
31
|
+
{
|
32
|
+
role: "assistant",
|
33
|
+
content: `
|
34
|
+
## Security analysis of x/y:
|
35
|
+
|
36
|
+
### Good:
|
37
|
+
Speak about the good points of the security check. If there is no good point, say "No good point found"
|
37
38
|
|
38
|
-
|
39
|
-
|
39
|
+
### Bad:
|
40
|
+
Speak about the bad points of the security check. If there is no bad point, say "No bad point found"
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
42
|
+
STOP AFTER SECURITY CHECK SECTION WITHOUT ANY CONCLUDING STATEMENT OR DISCLAIMER OR ADDITIONAL COMMENTS
|
43
|
+
--------------------------------
|
44
|
+
`,
|
45
|
+
},
|
46
|
+
{
|
47
|
+
role: "user",
|
48
|
+
content: "Analysis market sentiment of token/coin",
|
49
|
+
},
|
50
|
+
{
|
51
|
+
role: "assistant",
|
52
|
+
content: `
|
53
|
+
## Analysis of x/y:
|
53
54
|
|
54
|
-
|
55
|
+
Market sentiment: Bullish š (Adapt the emoji to the market sentiment)
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
### Fundamental analysis (No sub-sections):
|
58
|
+
Speak about important events, news, trends..etc
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
### Technical analysis (No sub-sections):
|
61
|
+
Speak about key price levels, trading volume, technical indicators, market activity..etc
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
},
|
63
|
+
STOP AFTER TECHNICAL ANALYSIS SECTION WITHOUT ANY CONCLUDING STATEMENT OR DISCLAIMER OR ADDITIONAL COMMENTS
|
64
|
+
--------------------------------
|
65
|
+
`,
|
66
|
+
},
|
67
|
+
],
|
68
68
|
};
|
package/llm/synthesizer/index.ts
CHANGED
@@ -47,6 +47,7 @@ export class Synthesizer {
|
|
47
47
|
console.log("\nšØ Starting synthesis process");
|
48
48
|
console.log("Prompt:", prompt);
|
49
49
|
console.log("Results to synthesize:", JSON.stringify(results, null, 2));
|
50
|
+
|
50
51
|
const context = this.composeContext({
|
51
52
|
behavior: synthesizerContext.behavior,
|
52
53
|
userRequest: prompt,
|