symposium 0.6.8 → 0.6.10

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
@@ -188,7 +188,8 @@ export default class Agent {
188
188
  break;
189
189
 
190
190
  case 'function':
191
- functions.push(m.content);
191
+ for (let f of m.content)
192
+ functions.push(f);
192
193
  break;
193
194
  }
194
195
  }
package/Summarizer.js CHANGED
@@ -78,11 +78,11 @@ export default class Summarizer extends MemoryHandler {
78
78
  if (message.role === 'system' && !message.tags.includes('summary')) {
79
79
  summarizedThread.messages.push(message);
80
80
  } else {
81
- const functionResponse = Symposium.extractFunctionFromResponse(summary);
82
- if (functionResponse)
81
+ const functionsResponse = Symposium.extractFunctionsFromResponse(summary);
82
+ if (functionsResponse.length)
83
83
  throw new Error('Errore durante la generazione di un riassunto interno');
84
84
 
85
- summarizedThread.addMessage('system', "This is what happened until now:\n" + functionResponse.summary, undefined, ['summary']);
85
+ summarizedThread.addMessage('system', "This is what happened until now:\n" + functionsResponse[0].summary, undefined, ['summary']);
86
86
  break;
87
87
  }
88
88
  }
package/Symposium.js CHANGED
@@ -35,13 +35,18 @@ export default class Symposium {
35
35
  return Array.from(this.models.values()).find(model => model.label === label);
36
36
  }
37
37
 
38
- static extractFunctionFromResponse(messages) {
38
+ static extractFunctionsFromResponse(messages) {
39
+ const functions = [];
39
40
  for (let message of messages) {
40
41
  const functionResponse = message.content.filter(c => c.type === 'function');
41
- if (functionResponse.length)
42
- return functionResponse[0].content.arguments;
42
+ if (functionResponse.length) {
43
+ for (let f of functionResponse) {
44
+ for (let r of f.content)
45
+ functions.push(r.arguments);
46
+ }
47
+ }
43
48
  }
44
49
 
45
- return null;
50
+ return functions;
46
51
  }
47
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.6.8",
4
+ "version": "0.6.10",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",