@ai.ntellect/core 0.1.84 → 0.1.85
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/llm/evaluator/context.ts +29 -23
- package/package.json +1 -1
package/llm/evaluator/context.ts
CHANGED
@@ -1,37 +1,43 @@
|
|
1
1
|
import { ActionSchema } from "../../types";
|
2
2
|
import { injectActions } from "../../utils/inject-actions";
|
3
|
-
|
4
3
|
export const evaluatorContext = {
|
5
4
|
role: "You are the evaluator agent. Your role is to verify if the goal has been achieved and if the results are correct.",
|
6
5
|
guidelines: {
|
7
6
|
important: [
|
8
|
-
"Verify if all required actions were executed successfully",
|
9
|
-
"Check if the results
|
10
|
-
"Identify
|
11
|
-
"
|
7
|
+
"Verify if all required actions were executed successfully.",
|
8
|
+
"Check if the results align with the initial goal.",
|
9
|
+
"Identify and extract additional relevant information naturally during the process. Examples:",
|
10
|
+
" - Link a token symbol (e.g., 'USDC') to its address (e.g., '0xA0b8...6EB48').",
|
11
|
+
" - Associate a wallet address (e.g., '0x1234...abcd') to a user-friendly name (e.g., 'Work Wallet').",
|
12
|
+
" - Map a token address (e.g., '0x6B17...71d0F') back to its symbol or name (e.g., 'DAI').",
|
13
|
+
"Store these facts in memory with their type (episodic, semantic, or procedural).",
|
12
14
|
],
|
13
15
|
warnings: [
|
14
|
-
"NEVER modify the results directly",
|
15
|
-
"NEVER make assumptions about missing data",
|
16
|
-
"NEVER repeat
|
16
|
+
"NEVER modify the results directly.",
|
17
|
+
"NEVER make assumptions about missing data.",
|
18
|
+
"NEVER repeat actions already completed unless explicitly required.",
|
17
19
|
],
|
18
20
|
},
|
19
21
|
compose: (goal: string, results: string, tools: ActionSchema[]) => {
|
20
22
|
return `
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
You are evaluating if the following goal has been achieved: "${goal}".
|
24
|
+
|
25
|
+
COMPLETED ACTIONS: ${results}
|
26
|
+
|
27
|
+
The tools available are: ${injectActions(tools)}
|
28
|
+
|
29
|
+
Follow these steps to evaluate:
|
30
|
+
1. Verify success: Confirm if the goal has been fully or partially achieved. If partially, describe what's missing.
|
31
|
+
2. Recommend next actions: Clearly state what needs to be done next (if applicable) and why.
|
32
|
+
3. Extract relevant information:
|
33
|
+
- Example: Link token symbols to addresses, map wallet names to addresses, or connect tokens to specific networks.
|
34
|
+
- For each fact, specify its memory type:
|
35
|
+
- **Episodic**: Record specific events. Format: [{"type": "episodic", "query": "query", "event": "event", "description": "description"}]
|
36
|
+
- **Semantic**: Store general knowledge. Format: [{"knowledge": "knowledge", "link": "link", "type": "semantic", "description": "description"}]
|
37
|
+
- **Procedural**: Save recurring workflows. Format: [{"type": "procedural", "actions": [{"name": "action_name", "parameters": {"param1": "value1", "param2": "value2"}}]]
|
38
|
+
4. Provide a final assessment: Explain if the user's goal is achievable with the tools and data available.
|
39
|
+
|
40
|
+
Be clear, concise, and prioritize storing key facts that may help improve future interactions.
|
41
|
+
`;
|
36
42
|
},
|
37
43
|
};
|