symposium 0.14.1 → 0.14.3
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 +20 -0
- package/Symposium.js +1 -1
- package/package.json +3 -3
package/Agent.js
CHANGED
|
@@ -412,4 +412,24 @@ export default class Agent {
|
|
|
412
412
|
async getPromptWordsForTranscription(thread) {
|
|
413
413
|
return [this.name];
|
|
414
414
|
}
|
|
415
|
+
|
|
416
|
+
async createRealtimeSession() {
|
|
417
|
+
const model = Symposium.getModelByName(thread.state.model);
|
|
418
|
+
if(!model.hasOwnProperty('openai'))
|
|
419
|
+
throw new Error('Model does not support real-time sessions');
|
|
420
|
+
|
|
421
|
+
// Recupero il messaggio di sistema
|
|
422
|
+
const thread = new Thread('temp', 'default', this);
|
|
423
|
+
await this.resetState(thread);
|
|
424
|
+
await this.initThread(thread);
|
|
425
|
+
|
|
426
|
+
const instructions = thread.messages.filter(m => m.role === 'system').map(m => m.content.map(c => c.content).join("\n")).join("\n");
|
|
427
|
+
|
|
428
|
+
const openai = model.getOpenAi();
|
|
429
|
+
return openai.realtime.sessions.create({
|
|
430
|
+
model: 'gpt-4o-realtime-preview',
|
|
431
|
+
instructions,
|
|
432
|
+
tools: await this.getFunctions(),
|
|
433
|
+
});
|
|
434
|
+
}
|
|
415
435
|
}
|
package/Symposium.js
CHANGED
|
@@ -102,7 +102,7 @@ export default class Symposium {
|
|
|
102
102
|
break;
|
|
103
103
|
|
|
104
104
|
case 'base64':
|
|
105
|
-
file = new File([Buffer.from(audio.data, 'base64')], 'audio.' + this.getExtFromMime(audio.
|
|
105
|
+
file = new File([Buffer.from(audio.data, 'base64')], 'audio.' + this.getExtFromMime(audio.mime), {type: audio.mime});
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "symposium",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.3",
|
|
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.
|
|
11
|
-
"groq-sdk": "^0.
|
|
10
|
+
"@anthropic-ai/sdk": "^0.55.0",
|
|
11
|
+
"groq-sdk": "^0.26.0",
|
|
12
12
|
"openai": "^5.0.0",
|
|
13
13
|
"tiktoken": "^1.0.10"
|
|
14
14
|
}
|