symposium 1.2.13 → 1.3.0

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.
package/Agent.js CHANGED
@@ -432,7 +432,7 @@ export default class Agent {
432
432
 
433
433
  async confirmFunctions({thread, functions, completion, emitter}) {
434
434
  const response = await this.callFunctions(thread, emitter, completion, functions, true);
435
- if (response.continue)
435
+ if (response?.type === 'continue')
436
436
  return this.execute(thread, emitter);
437
437
  }
438
438
 
@@ -464,7 +464,7 @@ export default class Agent {
464
464
  content: {
465
465
  name: response.function.name,
466
466
  id: response.function.id || undefined,
467
- response,
467
+ response: response.response,
468
468
  },
469
469
  },
470
470
  ], response.function.name);
package/Thread.js CHANGED
@@ -6,6 +6,7 @@ export default class Thread {
6
6
  unique;
7
7
  agent;
8
8
  messages = [];
9
+ planned_messages = [];
9
10
  state = {};
10
11
 
11
12
  constructor(id, agent) {
@@ -68,6 +69,15 @@ export default class Thread {
68
69
  this.addDirectMessage(new Message(role, content, name, tags));
69
70
  }
70
71
 
72
+ addPlannedMessage(role, content = [], name = undefined, tags = []) {
73
+ this.planned_messages.push(new Message(role, content, name, tags));
74
+ }
75
+
76
+ flushPlannedMessages() {
77
+ this.messages = this.messages.concat(this.planned_messages);
78
+ this.planned_messages = [];
79
+ }
80
+
71
81
  removeMessagesWithTag(tag) {
72
82
  this.messages = this.messages.filter(m => !m.tags.includes(tag));
73
83
  }
@@ -95,7 +95,7 @@ export default class AnthropicModel extends Model {
95
95
  ];
96
96
  } catch (e) {
97
97
  if (e.error?.error?.type === 'rate_limit_error') {
98
- console.error('Rate limite exceeded for Anthropic API, waiting 60 seconds...');
98
+ console.warn('Rate limite exceeded for Anthropic API, waiting 60 seconds...');
99
99
  await new Promise(resolve => setTimeout(resolve, 60000));
100
100
  if ((options.counter || 0) < 3)
101
101
  return this.generate(thread, functions, {...options, counter: (options.counter || 0) + 1});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "1.2.13",
4
+ "version": "1.3.0",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",