@agent-smith/cli 0.0.16 → 0.0.17

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.
@@ -20,15 +20,9 @@ async function executeJobCmd(name, args = [], options = {}) {
20
20
  if (task.type == "task") {
21
21
  let conf = {};
22
22
  let vars = {};
23
- if (i == 0) {
24
- const tv = initTaskVars(args);
25
- conf = tv.conf;
26
- vars = tv.vars;
27
- }
28
- else {
29
- conf = {};
30
- vars = params;
31
- }
23
+ const tv = initTaskVars(args);
24
+ conf = tv.conf;
25
+ vars = i == 0 ? tv.vars : params;
32
26
  const { found, path } = getFeatureSpec(name, "task");
33
27
  if (!found) {
34
28
  return { ok: false, data: {}, error: `Task ${name} not found` };
@@ -38,9 +32,17 @@ async function executeJobCmd(name, args = [], options = {}) {
38
32
  throw new Error(`Task ${name}, ${path} not found`);
39
33
  }
40
34
  const taskSpec = taskBuilder.readFromYaml(tres.ymlTask);
41
- const ex = brain.getOrCreateExpertForModel(taskSpec.model.name, taskSpec.template.name);
35
+ let m = taskSpec.model.name;
36
+ let t = taskSpec.template.name;
37
+ if (conf?.model) {
38
+ m = conf.model;
39
+ }
40
+ if (conf?.template) {
41
+ t = conf.template;
42
+ }
43
+ const ex = brain.getOrCreateExpertForModel(m, t);
42
44
  if (!ex) {
43
- throw new Error("No expert found for model " + taskSpec.model.name);
45
+ throw new Error("No expert found for model " + m);
44
46
  }
45
47
  ex.checkStatus();
46
48
  ex.backend.setOnToken((t) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@agent-smith/cli",
3
3
  "description": "Agent Smith: terminal client for language model agents",
4
4
  "repository": "https://github.com/synw/agent-smith",
5
- "version": "0.0.16",
5
+ "version": "0.0.17",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",