natureco-cli 1.0.5 → 1.0.6
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/ask.js +10 -1
package/package.json
CHANGED
package/src/commands/ask.js
CHANGED
|
@@ -2,6 +2,8 @@ const chalk = require('chalk');
|
|
|
2
2
|
const { getApiKey, getConfig } = require('../utils/config');
|
|
3
3
|
const { getBots, sendMessage } = require('../utils/api');
|
|
4
4
|
const { getSkillPrompts } = require('../utils/skills');
|
|
5
|
+
const { getMemoryPrompt } = require('../utils/memory');
|
|
6
|
+
const { getAgentsPrompt } = require('../utils/agents');
|
|
5
7
|
|
|
6
8
|
async function ask(question) {
|
|
7
9
|
const apiKey = getApiKey();
|
|
@@ -21,6 +23,13 @@ async function ask(question) {
|
|
|
21
23
|
|
|
22
24
|
// Skill prompts'ları yükle
|
|
23
25
|
const skillPrompts = getSkillPrompts();
|
|
26
|
+
const memoryPrompt = getMemoryPrompt(defaultBotId);
|
|
27
|
+
const agentsPrompt = getAgentsPrompt();
|
|
28
|
+
|
|
29
|
+
let systemPrompt = '';
|
|
30
|
+
if (skillPrompts) systemPrompt += skillPrompts;
|
|
31
|
+
if (agentsPrompt) systemPrompt += '\n\n' + agentsPrompt;
|
|
32
|
+
if (memoryPrompt) systemPrompt += '\n\n' + memoryPrompt;
|
|
24
33
|
|
|
25
34
|
// Loading animasyonu
|
|
26
35
|
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
@@ -32,7 +41,7 @@ async function ask(question) {
|
|
|
32
41
|
}, 80);
|
|
33
42
|
|
|
34
43
|
try {
|
|
35
|
-
const response = await sendMessage(apiKey, defaultBotId, question, null,
|
|
44
|
+
const response = await sendMessage(apiKey, defaultBotId, question, null, systemPrompt);
|
|
36
45
|
|
|
37
46
|
clearInterval(loadingInterval);
|
|
38
47
|
process.stdout.write('\r');
|