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 +2 -1
- package/Summarizer.js +3 -3
- package/Symposium.js +9 -4
- package/package.json +1 -1
package/Agent.js
CHANGED
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
|
|
82
|
-
if (
|
|
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" +
|
|
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
|
|
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
|
-
|
|
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
|
|
50
|
+
return functions;
|
|
46
51
|
}
|
|
47
52
|
}
|