natureco-cli 1.0.56 → 1.0.58
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 +9 -14
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">v1.0.
|
|
214
|
+
<div class="version-badge" id="version-badge">v1.0.58</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: 'v1.0.
|
|
344
|
+
version: 'v1.0.58',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/api.js
CHANGED
|
@@ -31,22 +31,23 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
31
31
|
// agent_id boş veya undefined ise config'den oku
|
|
32
32
|
const agentId = botId || config.defaultBotId;
|
|
33
33
|
|
|
34
|
-
//
|
|
35
|
-
|
|
34
|
+
// system_prompt'u kısalt - sadece skill adı ve açıklaması
|
|
35
|
+
const shortPrompt = skillPrompts
|
|
36
|
+
? skillPrompts.split('## Skill:').filter(Boolean).map(s => {
|
|
37
|
+
const lines = s.trim().split('\n');
|
|
38
|
+
return '- ' + lines[0].trim();
|
|
39
|
+
}).join('\n')
|
|
40
|
+
: '';
|
|
36
41
|
|
|
37
42
|
const body = {
|
|
38
43
|
agent_id: agentId,
|
|
39
44
|
message,
|
|
40
45
|
conversation_id: conversationId,
|
|
41
46
|
platform: 'cli',
|
|
42
|
-
user_id: 'cli-user'
|
|
47
|
+
user_id: 'cli-user',
|
|
48
|
+
system_prompt: shortPrompt
|
|
43
49
|
};
|
|
44
50
|
|
|
45
|
-
// Skill prompts varsa system_prompt olarak ekle
|
|
46
|
-
if (skillPrompts && skillPrompts.trim().length > 0) {
|
|
47
|
-
body.system_prompt = skillPrompts;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
51
|
// Custom AI provider varsa ekle
|
|
51
52
|
if (config.aiProvider && config.aiApiKey) {
|
|
52
53
|
body.custom_provider = config.aiProvider;
|
|
@@ -58,9 +59,6 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
// API'ye gönderilen body'yi logla
|
|
62
|
-
console.log('API body:', JSON.stringify(body));
|
|
63
|
-
|
|
64
62
|
const data = await request('/api/agent/chat', {
|
|
65
63
|
method: 'POST',
|
|
66
64
|
headers: {
|
|
@@ -70,9 +68,6 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
70
68
|
body: JSON.stringify(body),
|
|
71
69
|
});
|
|
72
70
|
|
|
73
|
-
// API'den gelen response'u logla
|
|
74
|
-
console.log('API response:', JSON.stringify(data));
|
|
75
|
-
|
|
76
71
|
return data;
|
|
77
72
|
}
|
|
78
73
|
|