symposium 0.9.6 → 0.9.7

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/Agent.js +9 -2
  2. package/package.json +1 -1
package/Agent.js CHANGED
@@ -103,7 +103,9 @@ export default class Agent {
103
103
  if (completion) {
104
104
  try {
105
105
  thread = await this.afterExecute(thread, completion);
106
- await this.handleCompletion(thread, completion);
106
+ const interrupt = await this.handleCompletion(thread, completion);
107
+ if (!interrupt)
108
+ await this.execute(thread);
107
109
  } catch (e) {
108
110
  console.error(e);
109
111
 
@@ -205,12 +207,17 @@ export default class Agent {
205
207
  await this.log('function_response', response);
206
208
  }
207
209
 
208
- await this.execute(thread);
210
+ return this.afterHandle(thread, completion, true);
209
211
  } else {
210
212
  await thread.storeState();
213
+ return this.afterHandle(thread, completion, false);
211
214
  }
212
215
  }
213
216
 
217
+ async afterHandle(thread, completion, executed_function) {
218
+ return !executed_function;
219
+ }
220
+
214
221
  async getFunctions(parsed = true) {
215
222
  if (this.functions === null) {
216
223
  this.functions = new Map();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.9.6",
4
+ "version": "0.9.7",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",