@digipair/skill-chatbot 0.2.4 → 0.2.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/index.cjs2.js +5 -5
- package/index.esm2.js +5 -5
- package/package.json +1 -1
package/index.cjs2.js
CHANGED
@@ -40971,9 +40971,9 @@ let ChatbotService = class ChatbotService {
|
|
40971
40971
|
var _context_private;
|
40972
40972
|
const session = `${context.request.digipair}-${context.request.body.userId}`;
|
40973
40973
|
var _context_private_VESPA_SERVER;
|
40974
|
-
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, maxHistory = 100, system = `
|
40974
|
+
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, maxHistory = 100, system = `You are a useful assistant, capable of explaining concepts in an easy-to-understand manner. If you're not sure of an answer, you can say "I don't know" or "I'm not sure."`, question = 'Hello, how can I help you?' } = params;
|
40975
40975
|
let messages = [];
|
40976
|
-
const history1 = await this.searchDocuments(baseUrl, session, `is_parent = true and
|
40976
|
+
const history1 = await this.searchDocuments(baseUrl, session, `is_parent = true and (role contains "assistant" or role contains "user") order by date desc limit ${maxHistory}`);
|
40977
40977
|
messages = history1.sort((a, b)=>a.date - b.date).map((document)=>({
|
40978
40978
|
role: document.role,
|
40979
40979
|
content: document.content
|
@@ -41045,13 +41045,13 @@ let ChatbotService = class ChatbotService {
|
|
41045
41045
|
const session = `${context.request.digipair}-${context.request.body.userId}`;
|
41046
41046
|
var _context_private_OLLAMA_SERVER, _context_private_VESPA_SERVER;
|
41047
41047
|
const { modelName = 'mistral', temperature = 0, baseUrlOllama = (_context_private_OLLAMA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.OLLAMA_SERVER) != null ? _context_private_OLLAMA_SERVER : OLLAMA_SERVER, baseUrlVespa = (_context_private_VESPA_SERVER = (_context_private1 = context.private) == null ? void 0 : _context_private1.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, promptSummary = `
|
41048
|
-
|
41048
|
+
Summary of conversation history:
|
41049
41049
|
{summary}
|
41050
41050
|
|
41051
|
-
|
41051
|
+
New messages:
|
41052
41052
|
{history}
|
41053
41053
|
|
41054
|
-
|
41054
|
+
Summarize the conversation history in a short, clear and concise text, taking into account the new messages.`, command = [], assistant, sources, logs } = params;
|
41055
41055
|
const input = context.request.body;
|
41056
41056
|
const date = Date.now();
|
41057
41057
|
var _input_inputs;
|
package/index.esm2.js
CHANGED
@@ -40949,9 +40949,9 @@ let ChatbotService = class ChatbotService {
|
|
40949
40949
|
var _context_private;
|
40950
40950
|
const session = `${context.request.digipair}-${context.request.body.userId}`;
|
40951
40951
|
var _context_private_VESPA_SERVER;
|
40952
|
-
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, maxHistory = 100, system = `
|
40952
|
+
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, maxHistory = 100, system = `You are a useful assistant, capable of explaining concepts in an easy-to-understand manner. If you're not sure of an answer, you can say "I don't know" or "I'm not sure."`, question = 'Hello, how can I help you?' } = params;
|
40953
40953
|
let messages = [];
|
40954
|
-
const history1 = await this.searchDocuments(baseUrl, session, `is_parent = true and
|
40954
|
+
const history1 = await this.searchDocuments(baseUrl, session, `is_parent = true and (role contains "assistant" or role contains "user") order by date desc limit ${maxHistory}`);
|
40955
40955
|
messages = history1.sort((a, b)=>a.date - b.date).map((document)=>({
|
40956
40956
|
role: document.role,
|
40957
40957
|
content: document.content
|
@@ -41023,13 +41023,13 @@ let ChatbotService = class ChatbotService {
|
|
41023
41023
|
const session = `${context.request.digipair}-${context.request.body.userId}`;
|
41024
41024
|
var _context_private_OLLAMA_SERVER, _context_private_VESPA_SERVER;
|
41025
41025
|
const { modelName = 'mistral', temperature = 0, baseUrlOllama = (_context_private_OLLAMA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.OLLAMA_SERVER) != null ? _context_private_OLLAMA_SERVER : OLLAMA_SERVER, baseUrlVespa = (_context_private_VESPA_SERVER = (_context_private1 = context.private) == null ? void 0 : _context_private1.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, promptSummary = `
|
41026
|
-
|
41026
|
+
Summary of conversation history:
|
41027
41027
|
{summary}
|
41028
41028
|
|
41029
|
-
|
41029
|
+
New messages:
|
41030
41030
|
{history}
|
41031
41031
|
|
41032
|
-
|
41032
|
+
Summarize the conversation history in a short, clear and concise text, taking into account the new messages.`, command = [], assistant, sources, logs } = params;
|
41033
41033
|
const input = context.request.body;
|
41034
41034
|
const date = Date.now();
|
41035
41035
|
var _input_inputs;
|