symposium 0.14.7 → 0.14.8
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 +5 -5
- package/package.json +1 -1
package/Agent.js
CHANGED
|
@@ -421,17 +421,17 @@ export default class Agent {
|
|
|
421
421
|
await this.initThread(thread);
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
|
|
424
|
+
const system_message = [], conversation = [];
|
|
425
425
|
for (let message of thread.messages) {
|
|
426
426
|
if (message.role === 'system')
|
|
427
|
-
system_message
|
|
427
|
+
system_message.push(message.content.map(c => c.content).join("\n"));
|
|
428
428
|
else
|
|
429
|
-
conversation.push(message.role + '
|
|
429
|
+
conversation.push('[' + message.role + '] ' + message.content.map(c => (typeof c.content === 'string' ? c.content : (c.content.transcription || null))).filter(c => !!c).join("\n"));
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
-
let instructions = system_message.
|
|
432
|
+
let instructions = system_message.join('\n');
|
|
433
433
|
if (conversation.length)
|
|
434
|
-
instructions += '\n\
|
|
434
|
+
instructions += '\n\n# Ecco la tua conversazione fino ad ora: #\n' + conversation.join('\n');
|
|
435
435
|
|
|
436
436
|
const tools = (await this.getFunctions()).map(t => ({
|
|
437
437
|
type: 'function',
|