natureco-cli 2.13.8 → 2.13.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/package.json +1 -1
- package/src/commands/dashboard.js +2 -2
- package/src/utils/api.js +18 -8
- package/src/utils/memory.js +7 -1
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.10</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.10',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/api.js
CHANGED
|
@@ -414,20 +414,30 @@ function formatToolsForAnthropic() {
|
|
|
414
414
|
async function sendMessageOpenAICompatible(providerConfig, messages, tools) {
|
|
415
415
|
const endpoint = `${providerConfig.url}/chat/completions`;
|
|
416
416
|
|
|
417
|
+
// Log request size before sending
|
|
418
|
+
const requestBody = {
|
|
419
|
+
model: providerConfig.model,
|
|
420
|
+
messages: messages,
|
|
421
|
+
tools: tools,
|
|
422
|
+
tool_choice: 'auto',
|
|
423
|
+
temperature: 0.7,
|
|
424
|
+
max_tokens: 2000,
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
const bodyStr = JSON.stringify(requestBody);
|
|
428
|
+
console.log('[API] Request size:', bodyStr.length, 'chars, ~', Math.round(bodyStr.length / 4), 'tokens');
|
|
429
|
+
console.log('[API] Messages count:', messages.length);
|
|
430
|
+
console.log('[API] Tools count:', tools?.length || 0);
|
|
431
|
+
console.log('[API] System prompt length:', messages[0]?.content?.length || 0);
|
|
432
|
+
|
|
417
433
|
const response = await fetch(endpoint, {
|
|
418
434
|
method: 'POST',
|
|
419
435
|
headers: {
|
|
420
436
|
'Authorization': `Bearer ${providerConfig.apiKey}`,
|
|
421
437
|
'Content-Type': 'application/json',
|
|
422
438
|
},
|
|
423
|
-
body:
|
|
424
|
-
|
|
425
|
-
messages: messages,
|
|
426
|
-
tools: tools,
|
|
427
|
-
tool_choice: 'auto',
|
|
428
|
-
temperature: 0.7,
|
|
429
|
-
max_tokens: 2000,
|
|
430
|
-
}),
|
|
439
|
+
body: bodyStr,
|
|
440
|
+
});
|
|
431
441
|
});
|
|
432
442
|
|
|
433
443
|
if (!response.ok) {
|
package/src/utils/memory.js
CHANGED
|
@@ -234,6 +234,9 @@ function getMemoryPrompt(botId) {
|
|
|
234
234
|
// Limit to top 15 facts to reduce token usage
|
|
235
235
|
const sorted = facts.sort((a, b) => b.score - a.score);
|
|
236
236
|
const topFacts = sorted.slice(0, 15);
|
|
237
|
+
|
|
238
|
+
console.log('[MEMORY] Facts count:', facts.length, '→ showing:', topFacts.length);
|
|
239
|
+
|
|
237
240
|
parts.push(`Bilgiler: ${topFacts.map(f => f.value).join(', ')}`);
|
|
238
241
|
|
|
239
242
|
if (facts.length > 15) {
|
|
@@ -242,7 +245,10 @@ function getMemoryPrompt(botId) {
|
|
|
242
245
|
}
|
|
243
246
|
}
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
const prompt = parts.join('\n');
|
|
249
|
+
console.log('[MEMORY] Prompt length:', prompt.length, 'chars, ~', Math.round(prompt.length / 4), 'tokens');
|
|
250
|
+
|
|
251
|
+
return prompt;
|
|
246
252
|
}
|
|
247
253
|
|
|
248
254
|
// Clear memory for a bot
|