@agent-smith/task 0.1.1 → 0.1.3
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/interfaces.d.ts +0 -2
- package/dist/task.js +4 -25
- package/package.json +7 -7
package/dist/interfaces.d.ts
CHANGED
|
@@ -24,14 +24,12 @@ interface TaskInput {
|
|
|
24
24
|
*
|
|
25
25
|
* @interface TaskConf
|
|
26
26
|
* @param {ModelSpec} [model] - Optional model configuration.
|
|
27
|
-
* @param {ModelSpec} [modelname] - Optional model name for the task models list.
|
|
28
27
|
* @param {InferenceParams} [inferParams] - Optional inference parameters.
|
|
29
28
|
* @param {boolean} [debug] - Optional debug flag.
|
|
30
29
|
* @param {boolean} [quiet] - Optional quiet flag.
|
|
31
30
|
*/
|
|
32
31
|
interface TaskConf {
|
|
33
32
|
model?: ModelSpec;
|
|
34
|
-
modelname?: string;
|
|
35
33
|
inferParams?: InferenceParams;
|
|
36
34
|
options?: InferenceOptions;
|
|
37
35
|
debug?: boolean;
|
package/dist/task.js
CHANGED
|
@@ -30,30 +30,9 @@ class Task {
|
|
|
30
30
|
ctx = model.ctx;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for (const [modelName, _mod] of Object.entries(this.def.models)) {
|
|
37
|
-
if (modelName == conf.modelname) {
|
|
38
|
-
found = true;
|
|
39
|
-
const m = _mod;
|
|
40
|
-
if (m?.ctx) {
|
|
41
|
-
ctx = m.ctx;
|
|
42
|
-
}
|
|
43
|
-
model = m;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (!found) {
|
|
49
|
-
if (["ollama", "llamacpp", "openai"].includes(this.agent.lm.providerType)) {
|
|
50
|
-
model = { name: conf.modelname };
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
throw new Error(`Provider type ${this.agent.lm.providerType}: no model found for ${conf.modelname}. Available models:\n${params?.models}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
33
|
+
/*else {
|
|
34
|
+
throw new Error("No model found in task")
|
|
35
|
+
}*/
|
|
57
36
|
}
|
|
58
37
|
//console.log("CONF", conf)
|
|
59
38
|
if (this.agent.lm.providerType == "ollama") {
|
|
@@ -118,7 +97,7 @@ class Task {
|
|
|
118
97
|
else {
|
|
119
98
|
answer = await this.agent.run(finalPrompt, this.def.inferParams, options, tpl);
|
|
120
99
|
}
|
|
121
|
-
return { answer: answer, errors: {}, template:
|
|
100
|
+
return { answer: answer.result, errors: {}, template: answer.template };
|
|
122
101
|
}
|
|
123
102
|
addTools(tools) {
|
|
124
103
|
tools.forEach(t => this.agent.tools[t.name] = t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-smith/task",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A toolkit to create human friendly agents: the language model tasks module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
"docs": "typedoc --entryPointStrategy expand"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@agent-smith/agent": "^0.1.
|
|
18
|
-
"@agent-smith/tfm": "^0.
|
|
19
|
-
"modprompt": "^0.12.
|
|
17
|
+
"@agent-smith/agent": "^0.1.2",
|
|
18
|
+
"@agent-smith/tfm": "^0.2.0",
|
|
19
|
+
"modprompt": "^0.12.5",
|
|
20
20
|
"yaml": "^2.8.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"openai": "6.
|
|
24
|
-
"@locallm/types": "^0.
|
|
23
|
+
"openai": "6.9.0",
|
|
24
|
+
"@locallm/types": "^0.5.0",
|
|
25
25
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
26
26
|
"@rollup/plugin-terser": "^0.4.4",
|
|
27
27
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
28
|
-
"@types/node": "^24.10.
|
|
28
|
+
"@types/node": "^24.10.1",
|
|
29
29
|
"markdown-it-replace-link": "^1.2.2",
|
|
30
30
|
"restmix": "^0.5.0",
|
|
31
31
|
"rollup": "^4.53.2",
|