@agent-smith/cli 0.0.24 → 0.0.26

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.
@@ -18,11 +18,6 @@ async function executeJobCmd(name, args = [], options = {}) {
18
18
  let i = 0;
19
19
  for (const [name, task] of Object.entries(job.tasks)) {
20
20
  if (task.type == "task") {
21
- let conf = {};
22
- let vars = {};
23
- const tv = initTaskVars(args);
24
- conf = tv.conf;
25
- vars = i == 0 ? tv.vars : params;
26
21
  const { found, path } = getFeatureSpec(name, "task");
27
22
  if (!found) {
28
23
  return { ok: false, data: {}, error: `Task ${name} not found` };
@@ -34,6 +29,13 @@ async function executeJobCmd(name, args = [], options = {}) {
34
29
  const taskSpec = taskBuilder.readFromYaml(tres.ymlTask);
35
30
  let m = taskSpec.model.name;
36
31
  let t = taskSpec.model.template;
32
+ let conf = {};
33
+ let vars = {};
34
+ const tv = initTaskVars(args, taskSpec?.inferParams ? taskSpec.inferParams : {});
35
+ console.log("TIP", taskSpec.inferParams);
36
+ console.log("IP", tv.conf.inferParams);
37
+ conf = tv.conf;
38
+ vars = i == 0 ? tv.vars : params;
37
39
  if (conf?.model) {
38
40
  m = conf.model;
39
41
  }
@@ -32,7 +32,7 @@ async function executeTaskCmd(args = [], options = {}) {
32
32
  }
33
33
  const taskSpec = taskBuilder.readFromYaml(res.ymlTask);
34
34
  const task = taskBuilder.fromYaml(res.ymlTask);
35
- const { conf, vars } = initTaskVars(args);
35
+ const { conf, vars } = initTaskVars(args, taskSpec?.inferParams ? taskSpec.inferParams : {});
36
36
  if (isDebug.value) {
37
37
  console.log("Task conf:", conf);
38
38
  console.log("Task vars:", vars);
@@ -48,7 +48,7 @@ async function executeTaskCmd(args = [], options = {}) {
48
48
  else {
49
49
  const gt = tfm.guess(m);
50
50
  if (gt == "none") {
51
- throw new Error(`Unable to guess the template for ${conf.model}: please provide a template name: m="modelname/templatename"`);
51
+ throw new Error(`Unable to guess the template for ${conf.model}: please provide a template name"`);
52
52
  }
53
53
  t = gt;
54
54
  }
@@ -6,7 +6,7 @@ declare function readTask(taskpath: string): {
6
6
  ymlTask: string;
7
7
  };
8
8
  declare function readTasksDir(dir: string): Array<string>;
9
- declare function initTaskVars(args: Array<any>): {
9
+ declare function initTaskVars(args: Array<any>, inferParams: Record<string, any>): {
10
10
  conf: Record<string, any>;
11
11
  vars: Record<string, any>;
12
12
  };
@@ -73,8 +73,8 @@ function readTasksDir(dir) {
73
73
  });
74
74
  return tasks;
75
75
  }
76
- function initTaskVars(args) {
77
- const conf = {};
76
+ function initTaskVars(args, inferParams) {
77
+ const conf = { inferParams: inferParams };
78
78
  const vars = {};
79
79
  args.forEach((a) => {
80
80
  if (a.includes("=")) {
@@ -92,12 +92,10 @@ function initTaskVars(args) {
92
92
  }
93
93
  }
94
94
  else if (k == "ip") {
95
- const ip = {};
96
95
  v.split(",").forEach((p) => {
97
96
  const s = p.split(":");
98
- ip[s[0]] = parseFloat(s[1]);
97
+ conf["inferParams"][s[0]] = parseFloat(s[1]);
99
98
  });
100
- conf.inferParams = ip;
101
99
  }
102
100
  else if (k == "s") {
103
101
  conf.size = v;
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.24",
5
+ "version": "0.0.26",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",