natureco-cli 2.13.9 → 2.13.11
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 +17 -8
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.11</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.11',
|
|
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,29 @@ 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
|
-
model: providerConfig.model,
|
|
425
|
-
messages: messages,
|
|
426
|
-
tools: tools,
|
|
427
|
-
tool_choice: 'auto',
|
|
428
|
-
temperature: 0.7,
|
|
429
|
-
max_tokens: 2000,
|
|
430
|
-
}),
|
|
439
|
+
body: bodyStr,
|
|
431
440
|
});
|
|
432
441
|
|
|
433
442
|
if (!response.ok) {
|