@agent-smith/agent 0.0.7 → 0.1.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/dist/agent.js +10 -2
- package/package.json +6 -5
package/dist/agent.js
CHANGED
|
@@ -11,10 +11,14 @@ class Agent {
|
|
|
11
11
|
if (options?.debug) {
|
|
12
12
|
console.log("Agent inference params:", params);
|
|
13
13
|
console.log("Agent options:", options);
|
|
14
|
-
console.log("Agent template:", template);
|
|
15
|
-
console.log("Prompt:", prompt);
|
|
16
14
|
}
|
|
17
15
|
if (this.lm.providerType == "openai") {
|
|
16
|
+
this.tools = {};
|
|
17
|
+
if (options?.tools) {
|
|
18
|
+
options.tools.forEach(t => {
|
|
19
|
+
this.tools[t.name] = t;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
18
22
|
return await this.runAgentNoTemplate(1, prompt, params, options);
|
|
19
23
|
}
|
|
20
24
|
else {
|
|
@@ -83,6 +87,7 @@ class Agent {
|
|
|
83
87
|
options.verbose = true;
|
|
84
88
|
}
|
|
85
89
|
options.history = this.history;
|
|
90
|
+
console.dir(options.history, { depth: 8 });
|
|
86
91
|
_res = await this.runAgentNoTemplate(nit, " ", params, options);
|
|
87
92
|
}
|
|
88
93
|
else {
|
|
@@ -98,6 +103,9 @@ class Agent {
|
|
|
98
103
|
await this.lm.loadModel(params.model.name, params.model.ctx);
|
|
99
104
|
}
|
|
100
105
|
let res = await this.lm.infer(tpl.prompt(prompt), params, options);
|
|
106
|
+
if (typeof params?.model == "string") {
|
|
107
|
+
params.model = { name: params.model };
|
|
108
|
+
}
|
|
101
109
|
const { isToolCall, toolsCall, error } = tpl.processAnswer(res.text);
|
|
102
110
|
if (error) {
|
|
103
111
|
throw new Error(`error processing tool call answer:\n, ${error}`);
|
package/package.json
CHANGED
|
@@ -5,21 +5,22 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/synw/agent-smith.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.1.1",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
11
11
|
"build": "rm -rf dist/* && tsc"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@locallm/api": "^0.
|
|
15
|
-
"modprompt": "^0.12.
|
|
14
|
+
"@locallm/api": "^0.6.2",
|
|
15
|
+
"modprompt": "^0.12.3",
|
|
16
|
+
"restmix": "^0.5.0"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@locallm/types": "^0.4.2",
|
|
19
20
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
20
21
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
21
|
-
"@types/node": "^24.
|
|
22
|
-
"rollup": "^4.
|
|
22
|
+
"@types/node": "^24.10.0",
|
|
23
|
+
"rollup": "^4.53.2",
|
|
23
24
|
"ts-node": "^10.9.2",
|
|
24
25
|
"tslib": "2.8.1",
|
|
25
26
|
"typescript": "^5.9.3"
|