symposium 1.3.1 → 1.3.3

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 (3) hide show
  1. package/Agent.js +7 -4
  2. package/Tool.js +3 -0
  3. package/package.json +1 -1
package/Agent.js CHANGED
@@ -430,13 +430,13 @@ export default class Agent {
430
430
  }
431
431
  }
432
432
 
433
- async confirmFunctions({thread, functions, completion, emitter}) {
434
- const response = await this.callFunctions(thread, emitter, completion, functions, true);
433
+ async confirmFunctions({thread, functions, completion, emitter}, always = false) {
434
+ const response = await this.callFunctions(thread, emitter, completion, functions, true, always);
435
435
  if (response?.type === 'continue')
436
436
  return this.execute(thread, emitter);
437
437
  }
438
438
 
439
- async callFunctions(thread, emitter, completion, functions_to_call, force_authorize = false) {
439
+ async callFunctions(thread, emitter, completion, functions_to_call, authorize = false, authorize_always = false) {
440
440
  const functions = await this.getFunctions(false);
441
441
 
442
442
  let is_authorized = true;
@@ -444,7 +444,10 @@ export default class Agent {
444
444
  if (!functions.has(f.name))
445
445
  throw new Error('Unrecognized function ' + f.name);
446
446
 
447
- if (!force_authorize && !(await functions.get(f.name).tool.authorize(thread, f.name, f.arguments))) {
447
+ if (authorize && authorize_always)
448
+ await functions.get(f.name).tool.authorizeAlways(thread, f.name, f.arguments);
449
+
450
+ if (!authorize && !(await functions.get(f.name).tool.authorize(thread, f.name, f.arguments))) {
448
451
  is_authorized = false;
449
452
  break;
450
453
  }
package/Tool.js CHANGED
@@ -12,4 +12,7 @@ export default class Tool {
12
12
  async authorize(thread, name, payload) {
13
13
  return true;
14
14
  }
15
+
16
+ async authorizeAlways(thread, name, payload) {
17
+ }
15
18
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "1.3.1",
4
+ "version": "1.3.3",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",