symposium 0.5.3 → 0.5.4
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/Summarizer.js +3 -3
- package/Symposium.js +10 -0
- package/package.json +1 -1
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 =
|
|
82
|
-
if (
|
|
81
|
+
const functionResponse = Symposium.extractFunctionFromResponse(summary);
|
|
82
|
+
if (functionResponse)
|
|
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
|
|
85
|
+
summarizedThread.addMessage('system', "This is what happened until now:\n" + functionResponse.summary, undefined, ['summary']);
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
}
|
package/Symposium.js
CHANGED
|
@@ -36,4 +36,14 @@ export default class Symposium {
|
|
|
36
36
|
static getModelByLabel(label) {
|
|
37
37
|
return Array.from(this.models.values()).find(model => model.label === label);
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
static extractFunctionFromResponse(messages) {
|
|
41
|
+
for (let message of messages) {
|
|
42
|
+
const functionResponse = message.content.filter(c => c.type === 'function');
|
|
43
|
+
if (functionResponse.length)
|
|
44
|
+
return functionResponse[0].arguments;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
39
49
|
}
|