wingbot 3.71.2 → 3.71.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/package.json +1 -1
- package/src/LLMSession.js +1 -3
- package/src/resolvers/message.js +11 -2
package/package.json
CHANGED
package/src/LLMSession.js
CHANGED
|
@@ -221,9 +221,7 @@ class LLMSession {
|
|
|
221
221
|
*/
|
|
222
222
|
messagesToSend (dontMarkAsSent = false) {
|
|
223
223
|
if (!this._generatedIndex) {
|
|
224
|
-
|
|
225
|
-
console.log('LLMSession', this.toString());
|
|
226
|
-
throw new Error('LLMSession: no message to send');
|
|
224
|
+
return [];
|
|
227
225
|
}
|
|
228
226
|
|
|
229
227
|
let messages = this._chat.splice(this._generatedIndex);
|
package/src/resolvers/message.js
CHANGED
|
@@ -419,7 +419,7 @@ function message (params, context = {}) {
|
|
|
419
419
|
if (params.type === 'prompt') {
|
|
420
420
|
const session = await res.llmSessionWithHistory(params.llmContextType);
|
|
421
421
|
|
|
422
|
-
|
|
422
|
+
await session.systemPrompt(text)
|
|
423
423
|
.debug()
|
|
424
424
|
.generate();
|
|
425
425
|
|
|
@@ -427,7 +427,16 @@ function message (params, context = {}) {
|
|
|
427
427
|
// // no response?
|
|
428
428
|
// }
|
|
429
429
|
|
|
430
|
-
|
|
430
|
+
const messages = session.messagesToSend();
|
|
431
|
+
|
|
432
|
+
const lastMessageI = messages.length - 1;
|
|
433
|
+
messages.forEach((m, i) => {
|
|
434
|
+
if (lastMessageI === i) {
|
|
435
|
+
text = m.content;
|
|
436
|
+
} else {
|
|
437
|
+
res.text(m.content);
|
|
438
|
+
}
|
|
439
|
+
});
|
|
431
440
|
}
|
|
432
441
|
|
|
433
442
|
res.text(text, sendReplies, voiceControl);
|