natureco-cli 2.23.11 → 2.23.13
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/chat.js +7 -3
- package/src/utils/api.js +18 -2
package/package.json
CHANGED
package/src/commands/chat.js
CHANGED
|
@@ -126,9 +126,13 @@ async function chat(botName, options = {}) {
|
|
|
126
126
|
const memoryPrompt = getMemoryPrompt(bot.id);
|
|
127
127
|
|
|
128
128
|
let systemPrompt = '';
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
if (config.providerUrl && config.providerUrl.includes('natureco.me')) {
|
|
130
|
+
systemPrompt = 'Sen yardımcı bir AI asistansın.';
|
|
131
|
+
} else {
|
|
132
|
+
if (skillPrompts) systemPrompt += skillPrompts;
|
|
133
|
+
if (agentsPrompt) systemPrompt += `\n\n## Project Instructions\n${agentsPrompt}`;
|
|
134
|
+
if (memoryPrompt) systemPrompt += '\n\n' + memoryPrompt;
|
|
135
|
+
}
|
|
132
136
|
|
|
133
137
|
// ── Session ─────────────────────────────────────────────────────────────────
|
|
134
138
|
let session;
|
package/src/utils/api.js
CHANGED
|
@@ -463,7 +463,16 @@ async function sendMessageOpenAICompatible(providerConfig, messages, tools) {
|
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
const data = await response.json();
|
|
466
|
-
|
|
466
|
+
console.error('DEBUG response:', JSON.stringify(data).slice(0, 200));
|
|
467
|
+
return {
|
|
468
|
+
role: 'assistant',
|
|
469
|
+
content: data.choices?.[0]?.message?.content
|
|
470
|
+
|| data.choices?.[0]?.text
|
|
471
|
+
|| data.response
|
|
472
|
+
|| data.content
|
|
473
|
+
|| '',
|
|
474
|
+
tool_calls: data.choices?.[0]?.message?.tool_calls || undefined,
|
|
475
|
+
};
|
|
467
476
|
}
|
|
468
477
|
|
|
469
478
|
/**
|
|
@@ -731,7 +740,14 @@ async function sendMessage(apiKey, botId, message, conversationId = null, chatSy
|
|
|
731
740
|
|
|
732
741
|
// Get config to check MCP status
|
|
733
742
|
const config = getConfig();
|
|
734
|
-
|
|
743
|
+
const providerConfig = getProviderConfig();
|
|
744
|
+
|
|
745
|
+
// NatureCo — minimal system prompt, skip tool descriptions/MCP
|
|
746
|
+
if (providerConfig && providerConfig.url.includes('api.natureco.me')) {
|
|
747
|
+
const prompt = chatSystemPrompt || 'Sen yardımcı bir AI asistansın.';
|
|
748
|
+
return sendMessageToProvider(apiKey, message, conversationId, prompt, options);
|
|
749
|
+
}
|
|
750
|
+
|
|
735
751
|
// Base system prompt — sıkıştırılmış (~120 token)
|
|
736
752
|
const toolDefs = getToolDefinitions();
|
|
737
753
|
const toolsDesc = toolDefs.map(t => t.name + (t.description ? ' (' + t.description.slice(0, 30) + ')' : '')).join(', ');
|