symposium 0.14.7 → 0.14.9

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 +7 -10
  2. package/package.json +4 -3
package/Agent.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Symposium from "./Symposium.js";
2
2
  import Thread from "./Thread.js";
3
+ import {v7 as uuid} from 'uuid';
3
4
 
4
5
  export default class Agent {
5
6
  name = 'Agent';
@@ -415,23 +416,19 @@ export default class Agent {
415
416
 
416
417
  async createRealtimeSession(thread_id = null, interface_name = 'default') {
417
418
  // Se viene passato un thread esistente, lo si usa, altrimenti si crea un nuovo thread temporaneo
418
- const thread = new Thread(thread_id || 'temp', interface_name, this);
419
- if (thread_id === null) {
420
- await this.resetState(thread);
421
- await this.initThread(thread);
422
- }
419
+ const thread = await this.getThread(thread_id || uuid(), interface_name);
423
420
 
424
- let system_message = '', conversation = [];
421
+ const system_message = [], conversation = [];
425
422
  for (let message of thread.messages) {
426
423
  if (message.role === 'system')
427
- system_message += message.content.map(c => c.content).join("\n") + "\n";
424
+ system_message.push(message.content.map(c => c.content).join("\n"));
428
425
  else
429
- conversation.push(message.role + ': ' + message.content.map(c => (typeof c.content === 'string' ? c.content : (c.content.transcription || null))).filter(c => !!c).join("\n"));
426
+ conversation.push('[' + message.role + '] ' + message.content.map(c => (typeof c.content === 'string' ? c.content : (c.content.transcription || null))).filter(c => !!c).join("\n"));
430
427
  }
431
428
 
432
- let instructions = system_message.trim();
429
+ let instructions = system_message.join('\n');
433
430
  if (conversation.length)
434
- instructions += '\n\nPrevious conversation:\n-------------------\n' + conversation.join('\n\n');
431
+ instructions += '\n\n# Ecco la tua conversazione fino ad ora: #\n' + conversation.join('\n');
435
432
 
436
433
  const tools = (await this.getFunctions()).map(t => ({
437
434
  type: 'function',
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.14.7",
4
+ "version": "0.14.9",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",
8
8
  "license": "ISC",
9
9
  "dependencies": {
10
- "@anthropic-ai/sdk": "^0.55.0",
10
+ "@anthropic-ai/sdk": "^0.56.0",
11
11
  "groq-sdk": "^0.26.0",
12
12
  "openai": "^5.0.0",
13
- "tiktoken": "^1.0.10"
13
+ "tiktoken": "^1.0.10",
14
+ "uuid": "^11.1.0"
14
15
  }
15
16
  }