@saltcorn/agents 0.6.5 → 0.6.6

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/index.js +14 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -7,6 +7,7 @@ const {
7
7
  get_skills,
8
8
  getCompletionArguments,
9
9
  process_interaction,
10
+ get_skill_instances,
10
11
  } = require("./common");
11
12
  const { applyAsync } = require("@saltcorn/data/utils");
12
13
  const WorkflowRun = require("@saltcorn/data/models/workflow_run");
@@ -49,9 +50,22 @@ module.exports = {
49
50
  user,
50
51
  row,
51
52
  );
53
+ const skills = get_skill_instances(action.configuration);
54
+ const skill_tools = [];
55
+ for (const skill of skills) {
56
+ const skillTools = skill.provideTools?.();
57
+ const tools = !skillTools
58
+ ? []
59
+ : Array.isArray(skillTools)
60
+ ? skillTools
61
+ : [skillTools];
62
+ skill_tools.push(...tools);
63
+ }
52
64
  return {
53
65
  ...complArgs,
54
66
  action,
67
+ skills,
68
+ skill_tools,
55
69
  };
56
70
  },
57
71
  isAsync: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/agents",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "AI agents for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {