@agent-smith/task 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/dist/task.js +28 -15
  2. package/package.json +10 -10
package/dist/task.js CHANGED
@@ -100,21 +100,6 @@ class Task {
100
100
  if (hasTools) {
101
101
  options.tools = this.def.tools;
102
102
  }
103
- if (conf?.debug) {
104
- if (this.agent?.history) {
105
- this.agent.history.forEach(t => {
106
- if (t?.assistant || t?.tools) {
107
- tpl.pushToHistory(t);
108
- }
109
- });
110
- }
111
- console.log("-----------", model.name, "- Template:", tpl.name, "- Ctx:", ctx, "-----------");
112
- console.log(this.agent.lm.providerType != 'openai' ? tpl.prompt(finalPrompt) : finalPrompt);
113
- console.log("----------------------------------------------");
114
- console.log("Infer params:", this.def.inferParams);
115
- console.log("----------------------------------------------");
116
- //options.debug = true
117
- }
118
103
  if (this.agent.lm.providerType == "ollama") {
119
104
  if (!this.def.inferParams?.extra) {
120
105
  this.def.inferParams["extra"] = {};
@@ -137,9 +122,37 @@ class Task {
137
122
  if (this.def.template?.system) {
138
123
  options.system = this.def.template.system;
139
124
  }
125
+ if (this.def.template?.afterSystem) {
126
+ if (options?.system) {
127
+ options.system = options.system + this.def.template.afterSystem;
128
+ }
129
+ else {
130
+ options.system = this.def.template.afterSystem;
131
+ }
132
+ }
140
133
  if (this.def?.shots) {
141
134
  options.history = options?.history ? [...this.def.shots, ...options.history] : this.def.shots;
142
135
  }
136
+ if (conf?.debug) {
137
+ if (this.agent?.history) {
138
+ this.agent.history.forEach(t => {
139
+ if (t?.assistant || t?.tools) {
140
+ tpl.pushToHistory(t);
141
+ }
142
+ });
143
+ }
144
+ console.log("-----------", model.name, "- Template:", tpl.name, "- Ctx:", ctx, "-----------");
145
+ if (this.agent.lm.providerType == 'openai') {
146
+ if (options?.system) {
147
+ console.log("SYSTEM:", options.system, "\n");
148
+ }
149
+ }
150
+ console.log(this.agent.lm.providerType != 'openai' ? tpl.prompt(finalPrompt) : finalPrompt);
151
+ console.log("----------------------------------------------");
152
+ console.log("Infer params:", this.def.inferParams);
153
+ console.log("----------------------------------------------");
154
+ //options.debug = true
155
+ }
143
156
  //console.log("RUN AGENT (TASK) params:", this.def.inferParams);
144
157
  //console.log("RUN AGENT (TASK) options:", options);
145
158
  answer = await this.agent.run(finalPrompt, this.def.inferParams, options, tpl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-smith/task",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A toolkit to create human friendly agents: the language model tasks module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,23 +14,23 @@
14
14
  "docs": "typedoc --entryPointStrategy expand"
15
15
  },
16
16
  "dependencies": {
17
- "@agent-smith/agent": "^0.4.0",
18
- "@agent-smith/tfm": "^0.3.0",
19
- "modprompt": "^0.14.2",
20
- "yaml": "^2.8.2"
17
+ "@agent-smith/agent": "^0.4.1",
18
+ "@agent-smith/tfm": "^0.3.1",
19
+ "modprompt": "^0.14.3",
20
+ "yaml": "^2.8.3"
21
21
  },
22
22
  "devDependencies": {
23
- "@locallm/api": "^0.7.3",
23
+ "@locallm/api": "^0.8.0",
24
24
  "@locallm/types": "^0.7.1",
25
25
  "@rollup/plugin-node-resolve": "^16.0.3",
26
26
  "@rollup/plugin-terser": "^1.0.0",
27
27
  "@rollup/plugin-typescript": "^12.3.0",
28
- "@types/node": "^25.3.5",
29
- "openai": "6.27.0",
28
+ "@types/node": "^25.5.2",
29
+ "openai": "6.33.0",
30
30
  "restmix": "^0.6.1",
31
- "rollup": "^4.59.0",
31
+ "rollup": "^4.60.1",
32
32
  "tslib": "^2.8.1",
33
- "typescript": "^5.9.3"
33
+ "typescript": "^6.0.2"
34
34
  },
35
35
  "files": [
36
36
  "dist"