@agent-smith/task 0.0.6 → 0.1.0

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.
Files changed (2) hide show
  1. package/dist/task.js +6 -7
  2. package/package.json +6 -6
package/dist/task.js CHANGED
@@ -15,7 +15,7 @@ class Task {
15
15
  return new Task(agent, data);
16
16
  }
17
17
  async run(params, conf) {
18
- //console.log("P", params);
18
+ //console.log("TASK CONF", conf);
19
19
  //console.log("TOOLS", this.agent.tools);
20
20
  if (!params?.prompt) {
21
21
  throw new Error("Please provide a prompt parameter");
@@ -46,11 +46,11 @@ class Task {
46
46
  }
47
47
  }
48
48
  if (!found) {
49
- if (["ollama", "llamacpp"].includes(this.agent.lm.providerType)) {
49
+ if (["ollama", "llamacpp", "openai"].includes(this.agent.lm.providerType)) {
50
50
  model = { name: conf.modelname };
51
51
  }
52
52
  else {
53
- throw new Error(`No model found for ${conf.modelname}. Available models:\n${params?.models}`);
53
+ throw new Error(`Provider type ${this.agent.lm.providerType}: no model found for ${conf.modelname}. Available models:\n${params?.models}`);
54
54
  }
55
55
  }
56
56
  }
@@ -88,16 +88,13 @@ class Task {
88
88
  if (agentToolsList.length > 0) {
89
89
  options.tools = agentToolsList;
90
90
  }
91
- if (conf?.debug) {
92
- options.debug = true;
93
- }
94
91
  if (conf?.debug) {
95
92
  console.log("-----------", model.name, "- Template:", tpl.name, "- Ctx:", ctx, "-----------");
96
93
  console.log(finalPrompt);
97
94
  console.log("----------------------------------------------");
98
95
  console.log("Infer params:", this.def.inferParams);
99
96
  console.log("----------------------------------------------");
100
- //options.debug = true
97
+ options.debug = true;
101
98
  }
102
99
  if (this.agent.lm.providerType == "ollama") {
103
100
  if (!this.def.inferParams?.extra) {
@@ -114,6 +111,8 @@ class Task {
114
111
  if (this.def?.shots) {
115
112
  options.history = this.def.shots;
116
113
  }
114
+ //console.log("RUN AGENT (TASK) params:", this.def.inferParams);
115
+ //console.log("RUN AGENT (TASK) options:", options);
117
116
  answer = await this.agent.run(finalPrompt, this.def.inferParams, options);
118
117
  }
119
118
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-smith/task",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "A toolkit to create human friendly agents: the language model tasks module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,10 +14,10 @@
14
14
  "docs": "typedoc --entryPointStrategy expand"
15
15
  },
16
16
  "dependencies": {
17
- "@agent-smith/agent": "^0.0.7",
17
+ "@agent-smith/agent": "^0.1.0",
18
18
  "@agent-smith/tfm": "^0.1.2",
19
- "@locallm/api": "^0.5.1",
20
- "modprompt": "^0.12.2",
19
+ "@locallm/api": "^0.6.1",
20
+ "modprompt": "^0.12.3",
21
21
  "yaml": "^2.8.1"
22
22
  },
23
23
  "devDependencies": {
@@ -25,10 +25,10 @@
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.9.2",
28
+ "@types/node": "^24.10.0",
29
29
  "markdown-it-replace-link": "^1.2.2",
30
30
  "restmix": "^0.5.0",
31
- "rollup": "^4.52.5",
31
+ "rollup": "^4.53.2",
32
32
  "tslib": "^2.8.1",
33
33
  "typedoc": "^0.28.14",
34
34
  "typedoc-plugin-markdown": "^4.9.0",