natureco-cli 2.13.27 → 2.13.28
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/commands/dashboard.js +2 -2
- package/src/utils/memory.js +9 -7
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v2.13.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.13.28</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
|
@@ -341,7 +341,7 @@ function dashboard(action) {
|
|
|
341
341
|
apiKey: cfg.apiKey,
|
|
342
342
|
defaultBot: cfg.defaultBot,
|
|
343
343
|
defaultBotId: cfg.defaultBotId,
|
|
344
|
-
version: 'v2.13.
|
|
344
|
+
version: 'v2.13.28',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/memory.js
CHANGED
|
@@ -237,15 +237,17 @@ function getMemoryPrompt(botId) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
if (facts.length > 0) {
|
|
240
|
-
//
|
|
241
|
-
const
|
|
242
|
-
const topFacts = sorted.slice(0, 15)
|
|
240
|
+
// Normalize all facts to objects with score, then sort and limit
|
|
241
|
+
const topFacts = facts
|
|
243
242
|
.map(f => {
|
|
244
|
-
if (typeof f === 'string') return f;
|
|
245
|
-
if (f && typeof f === 'object') return f.value || '';
|
|
246
|
-
return
|
|
243
|
+
if (typeof f === 'string') return { value: f, score: 5 };
|
|
244
|
+
if (f && typeof f === 'object') return { value: f.value || '', score: f.score || 5 };
|
|
245
|
+
return null;
|
|
247
246
|
})
|
|
248
|
-
.filter(f => f && f.length > 0)
|
|
247
|
+
.filter(f => f && f.value && f.value.length > 0)
|
|
248
|
+
.sort((a, b) => (b.score || 0) - (a.score || 0))
|
|
249
|
+
.slice(0, 15)
|
|
250
|
+
.map(f => f.value);
|
|
249
251
|
|
|
250
252
|
if (topFacts.length > 0) {
|
|
251
253
|
parts.push(`Bilgiler: ${topFacts.join(', ')}`);
|